flowable-engine icon indicating copy to clipboard operation
flowable-engine copied to clipboard

When start a process , sometimes is right, sometimes is wrong in 6.5.0

Open alpeace opened this issue 2 years ago • 1 comments

Describe the bug In Flowable-engine 6.5.0, when I start a new process instance by a message then the business key I send in is not set a right process instance. Sometimes is work, sometimes is not work.

Expected behavior When create a new process instance, whatever use startProcessInstanceByKey() or startProcessInstanceById(), and send businessKey, Most of the time, got a wrong table line in table - act_ru_execution, like this: [Only one line!] INSERT INTO portal.act_ru_execution(ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PARENT_ID_, PROC_DEF_ID_, SUPER_EXEC_, ROOT_PROC_INST_ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_, IS_EVENT_SCOPE_, IS_MI_ROOT_, SUSPENSION_STATE_, CACHED_ENT_STATE_, TENANT_ID_, NAME_, START_ACT_ID_, START_TIME_, START_USER_ID_, LOCK_TIME_, IS_COUNT_ENABLED_, EVT_SUBSCR_COUNT_, TASK_COUNT_, JOB_COUNT_, TIMER_JOB_COUNT_, SUSP_JOB_COUNT_, DEADLETTER_JOB_COUNT_, VAR_COUNT_, ID_LINK_COUNT_, CALLBACK_ID_, CALLBACK_TYPE_, REFERENCE_ID_, REFERENCE_TYPE_, PROPAGATED_STAGE_INST_ID_) VALUES ('1564917788231860224', 1, '1564917788231860224', NULL, '1564917788231860224', 'leave:1:1564177594876690432', NULL, '1564917788231860224', 'sid-3EFA5641-5727-44EF-B0FF-DC5386CD2B7F', 1, 0, 0, 0, 0, 1, NULL, '', NULL, NULL, '2022-08-31 18:07:30.138', NULL, NULL, 1, 0, 1, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL); Expected: I want create two lines in table, like this : [Two Lines] INSERT INTO portal.act_ru_execution(ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PARENT_ID_, PROC_DEF_ID_, SUPER_EXEC_, ROOT_PROC_INST_ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_, IS_EVENT_SCOPE_, IS_MI_ROOT_, SUSPENSION_STATE_, CACHED_ENT_STATE_, TENANT_ID_, NAME_, START_ACT_ID_, START_TIME_, START_USER_ID_, LOCK_TIME_, IS_COUNT_ENABLED_, EVT_SUBSCR_COUNT_, TASK_COUNT_, JOB_COUNT_, TIMER_JOB_COUNT_, SUSP_JOB_COUNT_, DEADLETTER_JOB_COUNT_, VAR_COUNT_, ID_LINK_COUNT_, CALLBACK_ID_, CALLBACK_TYPE_, REFERENCE_ID_, REFERENCE_TYPE_, PROPAGATED_STAGE_INST_ID_) VALUES ('1564917728119095296', 1, '1564917728110706688', NULL, '1564917728110706688', 'leave:1:1564177594876690432', NULL, '1564917728110706688', 'sid-3EFA5641-5727-44EF-B0FF-DC5386CD2B7F', 1, 0, 0, 0, 0, 1, NULL, '', NULL, NULL, '2022-08-31 18:07:15.806', NULL, NULL, 1, 0, 1, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL); INSERT INTO portal.act_ru_execution(ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PARENT_ID_, PROC_DEF_ID_, SUPER_EXEC_, ROOT_PROC_INST_ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_, IS_EVENT_SCOPE_, IS_MI_ROOT_, SUSPENSION_STATE_, CACHED_ENT_STATE_, TENANT_ID_, NAME_, START_ACT_ID_, START_TIME_, START_USER_ID_, LOCK_TIME_, IS_COUNT_ENABLED_, EVT_SUBSCR_COUNT_, TASK_COUNT_, JOB_COUNT_, TIMER_JOB_COUNT_, SUSP_JOB_COUNT_, DEADLETTER_JOB_COUNT_, VAR_COUNT_, ID_LINK_COUNT_, CALLBACK_ID_, CALLBACK_TYPE_, REFERENCE_ID_, REFERENCE_TYPE_, PROPAGATED_STAGE_INST_ID_) VALUES ('1564917728110706688', 1, '1564917728110706688', '1564917704190898177', NULL, 'leave:1:1564177594876690432', NULL, '1564917728110706688', NULL, 1, 0, 1, 0, 0, 1, NULL, '', NULL, 'startEvent1', '2022-08-31 18:07:15.804', '1543850752098029570', NULL, 1, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL);

Code processInstance = runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey, variables);

Additional context If set a bug point in this line of code, and step over , then pass ,the result is right! But , here have no bug point, the result like first SQL, only one line! So, i have no idea, help me!!!!!!!!!!!!!!

20220831181656 & businessKey is always have right value.

alpeace avatar Aug 31 '22 10:08 alpeace

I think it happend on generate id. I had found two tables have same id which created by StrongUuidGenerator.class. like : insert into ACT_RU_ACTINST ( ID, Parameters: 1565174718586159104(String) insert into ACT_RU_TASK (ID Parameters: 1565174718586159104(String),

DbSqlSession.java , insertedObjects , Execution: Map<Class<? extends Entity>, Map<String, Entity>> ExcutionImpl use this _id, then , second line overwrite the first line , with the same "_id".

On two and more tables will have not bugs, but in one table, in one Map, it could be..

alpeace avatar Sep 01 '22 03:09 alpeace