-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BaseRestartWorkChain
: Factor out attachment of outputs (#5983)
When a work chain step returns an exit code, the work chain execution is aborted. A common use for the handlers of the `BaseRestartWorkChain` is exactly this, to stop work chain execution when a particular problem or situation is detected. The downside is that no other steps can be called by the work chain implementation, for example, the `results` step to still attach any (partial) results. Of course an implementation could copy the content of the `results` method in the handler to do so, but it would have to copy the contents in each handler that still wanted to attach the outputs, duplicating the work. Here, the actual attaching of the outputs is factored out of the `results` method to the `attach_outputs` method. This method can now easily be called inside a process handler that wants to attach outputs before returning an exit code to stop the work chain.
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters