paed01 / bpmn-engine

BPMN 2.0 execution engine. Open source javascript workflow engine.
MIT License
874 stars 167 forks source link

no conditional flow taken #119

Closed n0byk closed 3 years ago

n0byk commented 3 years ago

Hi 4 all. On production server take this error: errorHandler :>> ActivityError: no conditional flow taken all console output:

INFO  [1609251765062] (1 on bpmn-back): Server running on http://bpmn-back:80
2020-12-29T14:25:23.883Z bpmn-engine:bpmn:sequenceflow <flow_start_buy> init, <StartEvent_158yep3> -> <task_Buy>
2020-12-29T14:25:23.968Z bpmn-engine:bpmn:sequenceflow <flow_buy_gw> init, <task_Buy> -> <gateway_1>
2020-12-29T14:25:24.059Z bpmn-engine:bpmn:sequenceflow <flow_gw1_clean> init, <gateway_1> -> <task_clean>
2020-12-29T14:25:24.063Z bpmn-engine:bpmn:sequenceflow <flow_clean_gw2> init, <task_clean> -> <gateway_2>
2020-12-29T14:25:24.073Z bpmn-engine:bpmn:sequenceflow <flow_repair_gw2> init, <task_repair> -> <gateway_2>
2020-12-29T14:25:24.075Z bpmn-engine:bpmn:sequenceflow <flow_gw2_drive> init, <gateway_2> -> <task_Drive>
2020-12-29T14:25:24.085Z bpmn-engine:bpmn:sequenceflow <flow_drive_end> init, <task_Drive> -> <Event_19ebav7>
2020-12-29T14:25:24.165Z bpmn-engine:bpmn:sequenceflow <flow_gw1_repair> init, <gateway_1> -> <task_repair>
2020-12-29T14:27:04.059Z bpmn-engine:engine <a803770e-f17b-4b03-b157-d61e118f1510> execute
2020-12-29T14:27:04.070Z bpmn-engine:bpmn:definitions <Def> found 1 processes
2020-12-29T14:27:04.071Z bpmn-engine:bpmn:definitions <Def_bf7e813 (Def)> run
2020-12-29T14:27:04.075Z bpmn-engine:bpmn:definitions <Def_bf7e813 (Def)> enter
2020-12-29T14:27:04.076Z bpmn-engine:bpmn:definitions <Def_bf7e813 (Def)> start
2020-12-29T14:27:04.078Z bpmn-engine:bpmn:definitions <Def_bf7e813 (Def)> execute definition
2020-12-29T14:27:04.159Z bpmn-engine:bpmn:process <Process_1hf9394> initialized with executionId <Process_1hf9394_2873f995>
2020-12-29T14:27:04.164Z bpmn-engine:bpmn:process <Process_1hf9394> enter
2020-12-29T14:27:04.165Z bpmn-engine:bpmn:process <Process_1hf9394> start
2020-12-29T14:27:04.170Z bpmn-engine:bpmn:sequenceflow <flow_start_buy> init, <StartEvent_158yep3> -> <task_Buy>
2020-12-29T14:27:04.181Z bpmn-engine:bpmn:sequenceflow <flow_buy_gw> init, <task_Buy> -> <gateway_1>
2020-12-29T14:27:04.262Z bpmn-engine:bpmn:sequenceflow <flow_gw1_clean> init, <gateway_1> -> <task_clean>
2020-12-29T14:27:04.263Z bpmn-engine:bpmn:sequenceflow <flow_clean_gw2> init, <task_clean> -> <gateway_2>
2020-12-29T14:27:04.275Z bpmn-engine:bpmn:sequenceflow <flow_repair_gw2> init, <task_repair> -> <gateway_2>
2020-12-29T14:27:04.275Z bpmn-engine:bpmn:sequenceflow <flow_gw2_drive> init, <gateway_2> -> <task_Drive>
2020-12-29T14:27:04.464Z bpmn-engine:bpmn:sequenceflow <flow_drive_end> init, <task_Drive> -> <Event_19ebav7>
2020-12-29T14:27:04.665Z bpmn-engine:bpmn:sequenceflow <flow_gw1_repair> init, <gateway_1> -> <task_repair>
2020-12-29T14:27:05.060Z bpmn-engine:bpmn:process <Process_1hf9394_2873f995 (Process_1hf9394)> execute process
2020-12-29T14:27:05.164Z bpmn-engine:bpmn:startevent <StartEvent_158yep3> initialized with executionId <StartEvent_158yep3_3953eb38>
2020-12-29T14:27:05.168Z bpmn-engine:bpmn:startevent <StartEvent_158yep3> enter 
2020-12-29T14:27:05.169Z bpmn-engine:bpmn:startevent <StartEvent_158yep3> start 
2020-12-29T14:27:05.177Z bpmn-engine:bpmn:startevent <StartEvent_158yep3_3953eb38 (StartEvent_158yep3)> execute
2020-12-29T14:27:05.179Z bpmn-engine:bpmn:startevent <StartEvent_158yep3_3953eb38 (StartEvent_158yep3)> completed execution
2020-12-29T14:27:05.258Z bpmn-engine:bpmn:sequenceflow <flow_start_buy_take_33776c05 (flow_start_buy)> take, target <task_Buy>
INFO  [1609252025264] (1 on bpmn-back): flow <flow_start_buy> was taken StartEvent_158yep3 )
2020-12-29T14:27:05.273Z bpmn-engine:bpmn:usertask <task_Buy> enter 
2020-12-29T14:27:05.275Z bpmn-engine:bpmn:usertask <task_Buy> format run.start message content
2020-12-29T14:27:05.275Z bpmn-engine:bpmn:usertask <task_Buy> completed formatting run.start
2020-12-29T14:27:05.275Z bpmn-engine:bpmn:usertask <task_Buy> start 
2020-12-29T14:27:05.279Z bpmn-engine:bpmn:usertask <task_Buy_180b4a4a (task_Buy)> execute
2020-12-29T14:27:05.367Z bpmn-engine:bpmn:process <Process_1hf9394_2873f995 (Process_1hf9394)> left <StartEvent_158yep3> (bpmn:StartEvent), pending runs 1 [ 'task_Buy' ]
INFO  [1609252025573] (1 on bpmn-back): новый кейс :>> task_Buy
INFO  [1609252028373] (1 on bpmn-back): sendInfo :>> {"instance_id":"a803770e-f17b-4b03-b157-d61e118f1510","executionid":"task_Buy"} 
INFO  [1609252028460] (1 on bpmn-back): bpmn:UserTask <task_Buy> of a803770e-f17b-4b03-b157-d61e118f1510 is waiting for input
params :>>  {
  status: {
    task_status_id: '8536592a-7340-4e10-ac4b-a280652c9310',
    name: 'Выполнена'
  },
  task: {
    task_id: '88cd6a2e-a8af-4d6f-a0a9-8c99436ce7ba',
    title: 'task_Buy22222'
  }
}
task.data.form_result :>>  [ { value: 'Yes', field_name: 'needsCleaning' } ]
form_result 1 :>>  { needsCleaning: 'Yes' }
form_result 2 :>>  { needsCleaning: 'Yes' }
2020-12-29T14:27:47.991Z bpmn-engine:bpmn:usertask <task_Buy_180b4a4a (task_Buy)> completed execution
2020-12-29T14:27:47.996Z bpmn-engine:bpmn:sequenceflow <flow_buy_gw_take_635bc9d (flow_buy_gw)> take, target <gateway_1>
INFO  [1609252067997] (1 on bpmn-back): flow <flow_buy_gw> was taken task_Buy )
2020-12-29T14:27:48.003Z bpmn-engine:bpmn:inclusivegateway <gateway_1> enter 
2020-12-29T14:27:48.004Z bpmn-engine:bpmn:inclusivegateway <gateway_1> start 
2020-12-29T14:27:48.009Z bpmn-engine:bpmn:inclusivegateway <gateway_1_350727dc (gateway_1)> execute
2020-12-29T14:27:48.066Z bpmn-engine:bpmn:inclusivegateway <gateway_1_350727dc (gateway_1)> flow <flow_gw1_clean> evaluated to: false
2020-12-29T14:27:48.070Z bpmn-engine:bpmn:inclusivegateway <gateway_1_350727dc (gateway_1)> flow <flow_gw1_repair> evaluated to: false
2020-12-29T14:27:48.071Z bpmn-engine:error:bpmn:inclusivegateway <gateway_1> null
2020-12-29T14:27:48.086Z bpmn-engine:bpmn:process <Process_1hf9394_2873f995 (Process_1hf9394)> process execution error
2020-12-29T14:27:48.089Z bpmn-engine:bpmn:definitions <Def_bf7e813 (Def)> definition execution error
2020-12-29T14:27:48.161Z bpmn-engine:engine <a803770e-f17b-4b03-b157-d61e118f1510> error
2020-12-29T14:27:48.164Z bpmn-engine:bpmn:inclusivegateway <gateway_1_350727dc (gateway_1)> discarded
2020-12-29T14:27:48.165Z bpmn-engine:bpmn:sequenceflow <flow_gw1_clean_discard_762e639 (flow_gw1_clean)> discard, target <task_clean>
2020-12-29T14:27:48.165Z bpmn-engine:bpmn:sequenceflow <flow_gw1_repair_discard_2c8793e7 (flow_gw1_repair)> discard, target <task_repair>
INFO  [1609252068181] (1 on bpmn-back): errorHandler :>> ActivityError: <gateway_1> no conditional flow taken

On local develop this error not displayed and flow going to next step

BPMN template ``` flow_start_buy flow_start_buy flow_buy_gw flow_gw1_clean flow_clean_gw2 flow_repair_gw2 flow_clean_gw2 flow_gw2_drive flow_drive_end flow_gw1_repair flow_repair_gw2 flow_gw2_drive flow_drive_end flow_buy_gw flow_gw1_clean flow_gw1_repair next(null, this.environment.options.needsCleaning=="Yes"); next(null, this.environment.options.needsCleaning=="No"); ```

how to fix it? tnx

paed01 commented 3 years ago

I guess both conditions for gateway_1 is falsy. Set flow_gw1_repair as default flow and add:

console.log(this.environment.options);next(null, this.environment.options.needsCleaning=="Yes");

to condition of flow_gw1_clean to see what the value of needsCleaning actually is.

n0byk commented 3 years ago

@paed01 thank you! its resolve problem PS. Merry Christmas! and Happy New Year!