Hi Team - Need quick and urgent help.
I have requirement where i have list of codes in my process which needs to run against DMN which gives decision and fail type as output. after all codes are executed, there are certain conditions on top of it based on fail type and decision to determine final decision .
How it is implemented:
1)DMN is created for every code and corresponding matching row will return decision and fail type
2) In BPMN - Created Business Rule task with implementation as Jobworker
3) In Jobworker - I have below code to call DMN for all codes :
@JobWorker(type="decisioneval",autocomplete=false)
public void getdecision(final Activated Job,Final JobClient client)
{
ZeebeClientBuilder clientbuilder=ZeebeClient.newClientBuilder.gatewayAddress("GATWAY ADDRESS HERE");
for (int i=0;i<codes.size;i++)
{
try(Zeebeclient client=clientbuilder.build())
{
inputJson=new JSONObject();
inputJson.put("riskCode",codes[i[);
EvaluateDecisionResponse decisioneval=client.newEvaluateDecisionCommand().decisionId("DECISION ID HERE").variables(inputJson.toString()).send().join();
//get the faill type and decision output from DMN call and store it in seperate arraylist
}
}
// After above for loop ..additional conditions are added on aggregation ( Arraylist outputs after dmn call for all codes ) and final decision is determined
at the end i am closing the worker with below
client.newCompleteCommand(job.getkey()).send.join();
Worker is executing fine when i run 2/3 request at time but if i run 40/50 request almost 20/30 request fails in worker with error
Worker failed to handle job with key sending fail command to broker java.lang.illegalMonitorStateException : current thread is not owner
2 questions :
1 . Can you please check if the way DMN is called in for loop is right ?
2. does increasing maxjobsactive,pollInterval will help here in worker method signature ?
Quick help will be appreciated .