wso2bps 3.6.0 async tasks

122 views Asked by At

I need to create parallel running service tasks in my process.

Try to create the simplest flow with async property usage:

enter image description here

With loop cardinality = 5 (for example)

I found that in activiti.xml configuration it's required to add this property:

    <property name="asyncExecutorActivate" value="true" />

But flow still runs in one thread.

What i'm missing?

How to activate async correctly?

1

There are 1 answers

0
daggett On
  1. to activate async parallel execution in the example above - need to set async on Call Service and not on Sub Process

  2. as soon as we use async we have to configure process engine to be async

    otherwise you will meet this king of exception:

    org.activiti.engine.ActivitiOptimisticLockingException: VariableInstanceEntity[id=15317, name=nrOfActiveInstances, type=integer, longValue=1, textValue=1] was updated by another transaction concurrently

    the parameters of activiti engine on wso2bps stored here: conf/activiti.xml

    just add the following properties to bean id="processEngineConfiguration"

    <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
       ...
       <property name="asyncExecutorActivate" value="true" />
       <property name="asyncExecutorEnabled" value="true" />
       ...
    </bean>
    

    warn: don't know if it's feature or bug. subprocess will catch correctly all thread endings only if you set async on end events of subprocess...

after those changes, the process from question works great in multithread mode.