I am implementing a workflow management system, where the workflow developer overloads a little process function and inherits from a Workflow
class. The class offers a method named add_component
in order to add a component to the workflow (a component is the execution of a software or can be more complex).
My Workflow
class in order to display status needs to know what components have been added to the workflow. To do so I tried 2 things:
- execute the process function 2 times, the first time allow to gather all components required, the second one is for the real execution. The problem is, if the workflow developer do something else than adding components (add element in a databases, create a file) this will be done twice!
- parse the python code of the function to extract only the
add_component
lines, this works but if some components are in aif
/else
statement and the component should not be executed, the component apears in the monitoring!
I'm wondering if there is other solution (I thought about making my workflow being an XML or something to parse easier but this is less flexible).