fyhao / tns-webform-client

MIT License
1 stars 0 forks source link

To support onException in the Flow steps #438

Open fyhao opened 4 years ago

fyhao commented 4 years ago

Currently the workflow engine run flow with steps.

If there is exception in performing sequence of steps, if there is exception, it will be halt in the middle of any step.

Objective is to implement OnException to be triggered when there is any exception happened during execution of steps.

Current flow definition:

{
"someflow": {
  "steps": [
    {"type":"someTaskWithExceptionThrown"}
  ]
 }
}

Proposed onException syntax

{
"someflow": {
  "steps": [
    {"type":"someTaskWithExceptionThrown"}
  ],
  "onException": "exceptionHandlingFlow"
 },
"exceptionHandlingFlow": {
  "steps": [
    {"type":"handleException"}
  ]
 }
}

or

{
"someflow": {
  "steps": [
    {"type":"someTaskWithExceptionThrown"}
  ],
  "onException": "steps": [
    {"type":"handleException"}
  ],
 },
"exceptionHandlingFlow": {
  "steps": [
    {"type":"handleException"}
  ]
 }
}
fyhao commented 4 years ago

Only the first option can be implemented as of now