Execution Engine#
The execution engine is responsible to execute the steps defined in the Business Scenario until the end of the execution. During the execution, some interaction with the user may happen and when it occurs, it follows the format defined in the Business Scenario (JSON).
The principles behind the execution are as follows:
- The
startstep is executed. When it finishes the execution, it will move to thenextstep - Some steps require some user interaction, therefore they will only move to the
nextstep when a proper answer is provided - The result of the execution of the step (either by come calculation or user answer) will be stored in a list of answers using the property
resultKeyas unique identification- It is the responsibility of the builder of the scenario to make sure the keys are unique within the entire set of steps
Conditionsteps allow the evaluation of previous answers to determine which step to move next.Foreachloop allows to iterate a full list of items, one at the time, executing an alternative set of steps- The results will be placed in an array on the answers identified by the
resultKey
- The results will be placed in an array on the answers identified by the
CallScenariosteps will load, prepare and execute a sub-scenario. The collection of answers and results of the entire sub-scenario will be stored in answers of the caller scenario under theresultKeyproperty, allowing the access of the answers and therefore reusing scenarios.- Sub-scenarios can call other other sub-scenarios
- There is no forever-loop verification in place, because there could be proper exit conditions properly implemented
- When no next step to continue, the execution engine will execute the
finallystep (if any) following the exact same rules as defined for thestartstep. - When no next step is defined in the
finallyexecution, the engine will evaluate theresultTypeoption and elaborate a set of pre-defined steps that will, i.e., inform the user that all the required information was already collected and ask for a confirmation to continue. If theresultTypeis set tocustomthe scenario builder can create his own end action. - When everything is handled, the engine will execute the
endstep where it is expected to return the result of the scenario in either a Master Data format or by executing a script that will make the necessary changes in the system.