我有凸輪進程問題,看起來像this。 此過程在步驟SetId和CreateObjectsForId(都是JavaDelegates)中以非確定性方式無休止地循環。Camunda/Activiti進程在JavaDelegate的環境中循環
我正在使用camunda 7.5。
我有一些BaseJavaDelegate實現這樣的:從例如執行
@Override
public void execute(DelegateExecution aExecution) throws Exception
{
logBefore(aExecution);
try
{
executeInTry(aExecution);
}
catch(Throwable aEx)
{
aEx.printStackTrace();
throw new BpmnError("GENERIC_ERROR_CODE", aEx.getMessage());
}
logAfter(aExecution);
}
登錄:
01.06.2017 15:32:53,902;pool-6-thread-2:...wf.base.BaseJavaDelegate;callExecuteInTry;DEBUG;
Starting task:
ProcessDefinitionId: ...Process1:1:1
ProcessInstanceId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ExecutionId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ActivityId: SetId
TransactionId: null
...
01.06.2017 15:32:54,664;pool-6-thread-2:...wf.base.BaseJavaDelegate;callExecuteInTry;DEBUG;
Ended task:
ProcessDefinitionId: ...Process1:1:1
ProcessInstanceId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ExecutionId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ActivityId: SetId
TransactionId: null
...
Starting task:
ProcessDefinitionId: ...Process1:1:1
ProcessInstanceId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ExecutionId: d161958b-46ce-11e7-8483-005056b37c6b
ActivityId: CreateObjectsForId
TransactionId: null
...
01.06.2017 15:37:53,886;pool-6-thread-3:...wf.base.BaseJavaDelegate;callExecuteInTry;DEBUG;
Starting task:
ProcessDefinitionId: ...Process1:1:1
ProcessInstanceId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ExecutionId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ActivityId: SetId
TransactionId: null
...
01.06.2017 15:37:53,893;pool-6-thread-3:...wf.base.BaseJavaDelegate;callExecuteInTry;DEBUG;
Ended task:
ProcessDefinitionId: ...Process1:1:1
ProcessInstanceId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ExecutionId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ActivityId: SetId
TransactionId: null
...
Starting task:
ProcessDefinitionId: ...Process1:1:1
ProcessInstanceId: ae2ecf43-46ce-11e7-8483-005056b37c6b
ExecutionId: d161958b-46ce-11e7-8483-005056b37c6b
ActivityId: CreateObjectsForId
TransactionId: null
從日誌可以看出,SETID開始第二時間,同時CreateObjectsForId永遠不會結束。 執行過程中不會引發異常。 前面的步驟都是在同一個線程中執行的,但是當循環開始時,進程開始使用另一個線程/兩個線程。
我試圖繞過這個問題,設計過程像this。 這次SetId步驟的實現知道它是第二次進入,並且專用門進程應該更進一步。
不幸的是,這個過程仍然循環!我的代碼沒有例外。沒有OptimisticLockException。 Camunda沒有任何其他例外。 我不知道還有什麼可以導致過程循環像這樣。
請添加Camunda版本和整個BPMN XML您的過程。 – thorben