Hey, I have a problem recently in my production servers that I am unable to replicate on a development locally and happens intermittently.
For context, I am using a Spring boot application (v3.2.5) with flowable engine (v7.0.0).
Situation:
I have a custom task called JavascriptTask that runs some javascript code inside. The functionality does not really matter. This task extends from a base ServiceTask class that implements JavaDelegate. The JavascriptTask is annotated a @Component to be registered as a spring bean. So the definitions for the classes look something like this:
public abstract class ServiceTask implements JavaDelegate {...//code}
@Component
public class JavascriptTask extends ServiceTask
The only configurations done to the flowable process engine is through a configuration class via Spring, the code replicated below
@Configuration
@AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE)
@AutoConfigureAfter(ProcessEngineAutoConfiguration.class)
@Slf4j
public class CustomFlowableEngineConfiguration {
@Autowired TaskMetricsListener taskMetricsListener;
@Autowired TaskErrorListener taskErrorListener;
@Bean
EngineConfigurationConfigurer<SpringProcessEngineConfiguration> engineConfigurationConfigurer() {
return engineConfiguration -> {
engineConfiguration.setEventListeners(List.of(taskMetricsListener, taskErrorListener));
};
}
}
This set of code works fine 99.9% of the time. However, in some instances started with this task, we observe error log lines saying: Unknown property used in expression ${javascriptTask}
. This then causes the javascript to fail for no reason and stop functioning.
Here’s a snippet of the XML we have for this task
<bpmn:serviceTask id="Activity_0x6hm42" name="Javascript Task" flowable:delegateExpression="${javascriptTask}" flowable:async="true">
<bpmn:extensionElements>
<flowable:taskListener event="create" delegateExpression="${javascriptTask}"/>
<flowable:failedJobRetryTimeCycle>R3/PT30S</flowable:failedJobRetryTimeCycle>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1gvi67e</bpmn:incoming>
<bpmn:outgoing>Flow_0x1qxrk</bpmn:outgoing>
</bpmn:serviceTask>`
The worse part is that we cannot replicate this issue on our local machines. Only when it goes to production does it ever occur.
What could potentially be the problem? Please assist. Thanks!