mirror of
https://github.com/Karaka-Management/oms-Workflow.git
synced 2026-01-11 06:48:41 +00:00
1.5 KiB
1.5 KiB
Every workflow can have up to 2 triggers (one existing trigger and one workflow specific trigger (trigger id))
Creating:
graph TD;
CREATE_TEMPLATE((Create))-->REGISTER_TRIGGER[Register template trigger]
REGISTER_TRIGGER-->CHECK_TYPE{Check type}
CHECK_TYPE--LISTENER-->REGISTER_TRIGGER_2[Register existing trigger]
CHECK_TYPE--TIMED-->REGISTER_CRON[Register cron job]
Running:
graph TD;
MAIN_TRIGGER((Trigger\nAction, Manual, Time))-->CREATE_INSTANCE[Create Instance in DB]
MAIN_TRIGGER-->HAS_SUB_TRIGGERS{Has Sub Triggers}
HAS_SUB_TRIGGERS--YES-->REGISTER_TRIGGER[Register sub triggers]
MAIN_TRIGGER-->RUN_CODE_1[Run Code]
RUN_CODE_1-->FORWARD_1[Run Code]
FORWARD_1-->CONDITION{Condition}
CONDITION-->RUN_CODE_3[Run Code]
How do workflow elements transfer data from one action to the next?
- Through request/response objects?
- Action 1 creates response
- Workflow takes result and forms new request (expands original request)
- Action 2 takes request and performs action
This means that after every action a general workflow function has to take over and generate the next request. However this is to be expected anyways?
// Sample Workflows
Billing:
- Get active subscriptions for the day
- option1: date (default = now)
- option2: client (default = wildcard for all)
- option3: payment type (default = cc, future = multiselect)
- Create new invoice based on subscription
- Is successful
- yes: send email
- no: inform sales person + deactivate benefits