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

Manage step return values #226

Merged
merged 7 commits into from
Jan 10, 2023
Merged

Manage step return values #226

merged 7 commits into from
Jan 10, 2023

Conversation

ebousse
Copy link
Contributor

@ebousse ebousse commented Dec 16, 2022

Description

Until now, a GEMOC Studio execution engine was considering that executing a step would not produce any return value, even though some parts of the framework were expecting it to happen (eg. MSEOccurrence).

This PR fixes this, by requiring engines to support step return values, and by using said values correctly in the framework.

Changes

  • Change AbstractExecutionEngine to transform:
protected void afterExecutionStep()

into

protected void afterExecutionStep(Optional<Object> returnValue)

Which means all execution engines will have to adapt to this change

  • Change AbstractSequentialExecutionEngine to adapt to the above change

  • Change AbstractCommandBasedSequentialExecutionEngine to adapt to the above change, which means changing this operation:

protected def void executeOperation(Object caller, Object[] parameters, String className, String operationName, Runnable operation)

into

protected def void executeOperation(Object caller, Object[] parameters, String className, String operationName, Callable<Optional<Object>> operation)
  • (Bonus) Fix a bug that made step parameters added twice in a MSEOccurrence objet

Companion Pull Requests

@dvojtise dvojtise merged commit 155ad70 into master Jan 10, 2023
@dvojtise dvojtise deleted the stepReturn branch April 5, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants