(and alternatives to a workflow engine)
Problem:
I have various inputs with various attributes.
For example {name: john, country: US} and {name: Jose, country: MX}
And I have the following workflows for the task Enter Country
US citizen:
Step1 Validate US Passport
Step2 Declare Goods at Customs
Non US citizen
Step1 Provide Visa
Step2 Validate Country passport
Step3 Declare Goods at Customs
(Bear with me as I am trying to think of a coherent example)
There are steps that are shared between workflows and depending on result (pass or fail) it can trigger another task (something like Rejected from country
)
The two options are:
Place the decision logic on each step itself, where the inputs are provided.
- pros - no duplication.
- cons - complicated to read what steps are used.
Place the decision as the first step and have it pick a workflow as the initial step
- pros - easy to read.
- cons - possible duplication.
In the future there maybe a need to float this logic to the users to create custom workflows.
What is the best approach for this type of problem?