Skip to content

[PF-79] Variables with no init values referenced in arcs will cause arcs not to load #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

camperko
Copy link
Member

@camperko camperko commented Apr 8, 2025

Description

Fix loading arcs where referenced data had non integer init values

Fixes PF-79

Dependencies

No new dependencies were introduced

Third party dependencies

No new dependencies were introduced

Blocking Pull requests

There are no dependencies on other PR

How Has Been This Tested?

Manually tested in local dev env in running application

Name Tested on
OS Linux Mint 21
Runtime Node 20.13.1
Dependency Manager npm 10.8.0
Framework version Angular 13.3.1
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked with @...
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

…rcs not to load

- fix loading arcs where referenced data had non integer init values
@camperko camperko added Bugfix Fixing something that isn't working Improvement Improvement of an existing functionality labels Apr 8, 2025
@camperko camperko requested a review from mazarijuraj April 8, 2025 13:18
@camperko camperko self-assigned this Apr 8, 2025
if (reference instanceof Place) {
weight = reference.marking;
} else {
if (!!reference.init && !!reference.init.value && /^[1-9]\d*$/.test(reference.init.value.trim())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is also used in Builder, please refactor it into two static functions of ImportUtils. One for the whole line and one for just the regex test because it is also used separately in Builder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should work with values like "1.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix Fixing something that isn't working Improvement Improvement of an existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants