09-07-2016 09:45 PM
09-08-2016 02:58 AM
12-09-2016 06:52 AM
Hi Tijs,
I'm new with activity, so, I'm sorry if I write something wrong.
We have deployed activity 5.9 with Websphere Application Server in a clustered environment ( composed by 3 servers )
In our activiti process definition there are three TimerEventDefinition tags in 3 different points of the flow.
It happens that, when a new process instance has been created, the following exception is thrown :
>>Error while closing command context
>> org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[23398646] was updated by another transaction concurrently
>>at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:452)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:348)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:149)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:105)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.jobexecutor.AcquireJobsRunnable.run(AcquireJobsRunnable.java:57)
at java.lang.Thread.run(Thread.java:790)
After that I see the following log lines
>>endAborted throws error event with errorCode 'aborted', but no catching boundary event was defined. Execution will simply be ended (none end event semantics).
and the process execution stops.
If I run the process in a standalone environment , everything works well
Please, could you help me to check out where the problem is ?
Here, a simplified version of process definition:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<signal id="maxRetriesReached" name="maxRetriesReached"></signal>
<process id="Test" name="Test">
<startEvent id="start" name="Start">
<extensionElements>
<activiti:formProperty id="maxRetry" name="Max retries" expression="#{maxRetry}" variable="maxRetry" required="true" readable="true" writable="true"></activiti:formProperty>
</extensionElements>
</startEvent>
<endEvent id="endSuccess" name="endSuccess"></endEvent>
<scriptTask id="initCounter" name="initCounter" scriptFormat="groovy">
<script><![CDATA[def counter = 0
execution.setVariable("counter", counter)]]></script>
</scriptTask>
<exclusiveGateway id="counterCheck" name="counterCheck" default="counterCheckKO"></exclusiveGateway>
<serviceTask id="processAction" name="Processing" activiti:expression="#{xxxxxx}"></serviceTask>
<scriptTask id="incrementCounter" name="Increment counter" scriptFormat="groovy">
<script><![CDATA[counter++]]></script>
</scriptTask>
<receiveTask id="waitForResponse" name="Waiting for response"></receiveTask>
<boundaryEvent id="requestTimeout" name="Request timeout" cancelActivity="true" attachedToRef="waitForResponse">
<timerEventDefinition>
<timeDuration>PT2H</timeDuration>
</timerEventDefinition>
</boundaryEvent>
<exclusiveGateway id="reasonCheck" name="Check reason" default="reasonCheckNotFound"></exclusiveGateway>
<boundaryEvent id="retryTimer" name="Retry timer" cancelActivity="true" attachedToRef="waiForRetry">
<timerEventDefinition>
<timeDuration>PT24H</timeDuration>
</timerEventDefinition>
</boundaryEvent>
<endEvent id="endMaxRetriesReached" name="endMaxRetriesReached">
<errorEventDefinition errorRef="maxRetriesReached"></errorEventDefinition>
</endEvent>
<intermediateCatchEvent id="wait1sec2" name="wait1sec2">
<timerEventDefinition>
<timeDuration>PT1S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<intermediateCatchEvent id="wait1sec" name="wait1sec">
<timerEventDefinition>
<timeDuration>PT1S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<exclusiveGateway id="actionCheck" name="actionCheck"></exclusiveGateway>
<sequenceFlow id="flow1" name="" sourceRef="start" targetRef="wait1sec"></sequenceFlow>
<sequenceFlow id="flow2" name="" sourceRef="initCounter" targetRef="counterCheck"></sequenceFlow>
<sequenceFlow id="counterCheckOK" name="counter<maxRetry " sourceRef="counterCheck" targetRef="processAction">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[#{counter<maxRetry}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="counterCheckKO" name="counter>=maxRetry " sourceRef="counterCheck" targetRef="endMaxRetriesReached">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[#{counter>=maxRetry }]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow4" name="" sourceRef="processAction" targetRef="incrementCounter"></sequenceFlow>
<sequenceFlow id="flow5" name="" sourceRef="incrementCounter" targetRef="waitForResponse"></sequenceFlow>
<sequenceFlow id="reasonCheckOK" name="ok" sourceRef="reasonCheck" targetRef="endSuccess"></sequenceFlow>
<sequenceFlow id="reasonCheckNotFound" name="notfound" sourceRef="reasonCheck" targetRef="waiForRetry">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[#{reason == null}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow8" name="" sourceRef="waiForRetry" targetRef="wait1sec2"></sequenceFlow>
<sequenceFlow id="flow9" name="" sourceRef="retryTimer" targetRef="counterCheck"></sequenceFlow>
</process>
</definitions>
Thank you very much in advance
12-22-2016 04:48 AM
Hi Francesa,
Activiti on WebSphere can be a bit more difficult. It's because of how WebSphere handles transaction manager. So, you may need to spend some effort on creating a custom transaction manager in order to have Activiti run successfully on WebSphere.
Have a look at Heiko's answer in this thread: Running Activiti on WebSphere Application Server
We are currently running Activiti successfully under WebSphere Application Server 8.x. You are right, there are some things to take care of, mainly transaction handling and asynchronous support via managed threads.
While the first is rather easy as Activiti supports Spring and Spring has a generalization of a transaction management which includes the use of WebSphere UnitOfWork Transaction management, simply search for an Activiti setup utilizing the WebSphereUOWTransactionManager and the SpringProcessEngineConfiguration. This shall lead you into the right direction. If this does not help, simply reply here and I will try to give further information. If your project does not allow spring, you are screwed here. We don't use (and don't like) Spring, and use it only because of its adaption for transaction management in our application designs. We rather stick with CDI which works great in combination with Activiti. For that to work, you'd have to combine the setup found in the SpringProcessEngineConfiguration with those found in the CdiProcessEngineConfiguration which is quite easy as there is not much added here.
Try what Heiko suggests and see if it fixes your issue.
Thanks,
Thong Huynh
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.