Service task execution after timer event posing dependancy on EAR deployment

Hi Guys,

I am having a intermediate timer catch event followed by a service task in the bpmn model.
The timer expires after the set duration and service task is executing as intended.

Camunda process engine (v 7.3) is configured as a subsystem in my Wildly 8 application server.
The service task following timer is given a CDI named bean method invocation as an expression.

I am facing issue when the timer event is started and the application server is shutdown and restarted after the timer expiration time.

Upon server startup the service task is immediately evaluating the expression and gets failed as the expression does not resolve to a CDI bean method invocation at that time. This is because my application ear which contains the CDI bean is not completely deployed in the server when the service task is trying to execute.

I would greatly appreciate if you could help me understand how we can make the service task execution happen only after the application ear containing the CDI bean is completely deployed. ie, how can I set the dependency to my Process Application deployment for the Process Engine Job execution?
Please help.

Hi @syed,

Please post your process engine configuration.

Cheers,
Thorben

Hi @thorben

Please find the configuration below.

 <process-engine name="default" default="true">
                        <datasource>
                            java:jboss/datasources/ProcessEngineDS
                        </datasource>
                        <history-level>
                            full
                        </history-level>
                        <configuration>
                            org.camunda.bpm.container.impl.jboss.config.ManagedJtaProcessEngineConfiguration
                        </configuration>
                        <properties>
                            <property name="jobExecutorAcquisitionName">
                                default
                            </property>
                            <property name="isAutoSchemaUpdate">
                                true
                            </property>
                            <property name="authorizationEnabled">
                                true
                            </property>
                        </properties>
                    </process-engine>

Thanks,
Syed

Add the following property:

<property name="jobExecutorDeploymentAware">true</property>

The job executor will then only acquire jobs for process applications that are currently deployed.

Cheers,
Thorben

2 Likes

Thanks much @thorben. It worked and issue is fixed.

@thorben We are planning to run the same process application on a wildfly cluster with multiple nodes.

ie Process Application A on Node 1 and Node 2

So if we set the deploymentaware property to true,

<property name="jobExecutorDeploymentAware">true</property>

Would you please help us understand the behavior in below scenario.

  1. Create timer event on Node 1
  2. Kill Node 1

When the timer expires, would the service task associated with timer execute on Node 2 or wait for Node 1 to come up and running again?
We will be following the homogeneous cluster setup.

The timer will be executed on node 2. When both nodes are running, it will be executed on either node 1 or node 2.

@thorben Thanks for the quick reply.

By the way, I came across this forum post explaining the same scenario depicted above but was answered differently

https://forum.camunda.io/t/job-executor-into-homogeneous-environment/3334/6

Could you please confirm?

The information I gave above is the expected behavior. If this is not performed (and everything else is correct), there is a bug. If this is critical for you, I recommend you check this behavior yourself by making appropriate tests.