Skip to content
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

Overlapping matches aren't handled correctly #113

Open
AndreiBondarenko opened this issue Jan 13, 2021 · 0 comments
Open

Overlapping matches aren't handled correctly #113

AndreiBondarenko opened this issue Jan 13, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@AndreiBondarenko
Copy link

ISSUE

When running a rule that has overlapping matches as an FRule the frontend doesn't produce an error, making it look as if all is well. However, the transformation engine raises following exception:

Exception in thread Thread-18:
Traceback (most recent call last):
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\pytcore\tcore\messages.py", line 241, in to_label_mapping
    sourceNode = source_graph.get_node(self[label])
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\pytcore\core\himesis.py", line 135, in get_node
    raise KeyError('Node not found with specified id. Make sure to only create nodes via Himesis.add_node(): ' + str(guid))
KeyError: 'Node not found with specified id. Make sure to only create nodes via Himesis.add_node(): 1ce09e75-0052-4ece-89d0-acefa03f5ab0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Andrei\Downloads\atompm-portable\platform\WinPython\WPy32-3830\python-3.8.3\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\mtworker.py", line 26, in run
    self._onmsg(self._msg)
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\mtworker.py", line 217, in _onmessage
    getattr(self._ptcal,mode.lower())()
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\ptcal.py", line 986, in step
    self._doWhenLastStepFeedbackReceived(self._step)
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\ptcal.py", line 169, in _doWhenLastStepFeedbackReceived
    utils.doWhen(
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\utils.py", line 20, in doWhen
    callback()
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\ptcal.py", line 1089, in _step
    (res,ai) = runRule(nr)
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\ptcal.py", line 1005, in runRule
    self.packet = ar.packet_in(self.packet)
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\pytcore\rules\frule.py", line 42, in packet_in
    packet = self.W.packet_in(packet)
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\pytcore\tcore\rewriter.py", line 46, in packet_in
    mapping = match.to_label_mapping(packet.graph)
  File "C:\Users\Andrei\Downloads\atompm-portable\AToMPM\mt\ptcal\pytcore\tcore\messages.py", line 243, in to_label_mapping
    raise Exception('The matched node %s does not exist' % label)
Exception: The matched node 2 does not exist

I think this should be handled by the pytcore's resolver?

HOW TO REPRODUCE?

Reproduce using following example:

Create a rule that looks as follows:

image

Schedule it as an FRule:

image

Apply the schedule to a model that has overlapping matches for aforementioned rule:

image

Observe as the rule is applied without producing an error in the frontend.

@BentleyJOakes BentleyJOakes added the bug Something isn't working label Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants