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

Support target attribute for the send element #59

Open
EnricoGhiorzi opened this issue Oct 9, 2024 · 0 comments
Open

Support target attribute for the send element #59

EnricoGhiorzi opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working priority: high

Comments

@EnricoGhiorzi
Copy link

According to the SCXML specification, a send element should have either a target or targetexpr attribute specifying the URI (in our case, a SCXML state machine's id) of the intended event's recipient (Sec. 6.2.2). In case both attributes are missing, the expected behavior is to add the event to the external event queue of the sending session (somewhere inside Sec. C.1).

These are the common use-cases we have for the target attribute:

  • target="ID" to explicitely name the target in case it is known (e.g., a plugin returning SUCCESS/RUNNING/FAILURE to the bt).
  • targetexpr="_event.origin" to send the event back to the sender of the event that is currently being processed.
  • targetexpr="ORIGIN" where ORIGIN is a location's id of type URI (which normally is used to "save" a previous _event.origin). This is usually done when neither of the above options is available.

Currently, AS2FM omits the target from send elements, and this is an issue for the generation of the channel system.
It would need to:

  • If there is a target in the source XML, include that same target in the generated send (provided the id doesn't get changed during compilation).
  • If there is a targetexpr, translate the expression (at least covering the above use-cases).
  • If the target is implied by some ROS-specific element (e.g. the list of subscribers for a topic), introduce the target(s) explicitely.

In case of multiple targets, these have to be handled separately by sending the event individually. There is no "targetList"-like attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high
Projects
None yet
Development

No branches or pull requests

1 participant