Closed fro0m closed 5 months ago
The best way to do this is via customizing the script engine. If you run into an error during some sort of external call, the script engine can catch it and send it back to the workflow, using the catch
method. I'm actually putting an example of this together, which I can point you to when I finish it, but hopefully this gives you some guidance in the meantime.
This PR https://github.com/sartography/SpiffWorkflow/pull/403 contains documentation for a new example that sends an event to a running workflow based on the outcome of a service task.
Thank you! Waiting for later details
Here is some example code for generating events: https://github.com/sartography/spiff-example-cli/blob/main/spiff_example/misc/event_handler.py
And the accompanying docs: https://spiffworkflow.readthedocs.io/en/latest/bpmn/script_engine.html#generating-bpmn-events-inside-the-scripting-environment
I actually ended up writing a custom service task instead of using the script engine, because that was easier to do in the example application, but you could do this in either place (there's a note about this in the docs).
Let me know if this helps -- if anything is not clear enough I can attempt to update the docs based on any comments you have.
Did this help answer your question?
Closing since I haven't received any feedback.
Trying to make BPMN to interact with some external services, so the idea is to get external events in Python and issue signals to the BPMN process running. Please advice how to do it.