The process could not be started. : Cannot instantiate process definition

Hi Team,

Iam getting below error when i try to start process.

The process could not be started. : Cannot instantiate process definition SimpleDemo:3:c5e1aaa8-21fb-11ea-b5c4-9cb6d0c2b847: Unknown property used in expression: #{cflag}. Cause: Cannot resolve identifier ‘cflag’

My java class is below process.bpmn (4.7 KB)

package com.camunda.demo.SimpleDemo;

import java.util.Random;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;

public class CheckWeatherDelegate implements JavaDelegate {

@Override
public void execute(DelegateExecution execution) throws Exception {
	
	Random random=new Random();
	
	
	execution.setVariable("cflag", random.nextBoolean());
	// TODO Auto-generated method stub

}

}

Can you please help me on this issue .

Regards
Ravi Babu.

Hi @RaviBabu,

The class attribute of the service task “check Weather” in your model is set to
org.camunda.bpm.engine.delegate.DelegateExecution

Where it should be set to
com.camunda.demo.SimpleDemo.CheckWeatherDelegate

1 Like

Hi ,

Thank you for looking into my error . I changed class attribute as com.camunda.demo.SimpleDemo.CheckWeatherDelegate** but still getting same error .process.bpmn (4.7 KB)

Hi @RaviBabu,

Try to set camunda:asyncAfter=“true” on Service Task

By default process state is only stored to the database when token reaches a wait state.
“A wait state is a task which is performed later , which means that the engine persists the current execution to the database and waits to be triggered again”.

https://docs.camunda.org/manual/latest/user-guide/process-engine/transactions-in-processes/#wait-states

And since service task is not a wait state then asynchronous Continuations can be used to add transaction boundaries.

https://docs.camunda.org/manual/latest/user-guide/process-engine/transactions-in-processes/#transaction-boundaries

I tried camunda:asyncAfter=“true” but still same issue.

process.bpmn (4.7 KB) .

Iam still facing the problem , Can any one please help me on this issue ?

@RaviBabu from your model service task element “Check Weather” is not connected to the exclusive gateway.

image

Try this bpmn file which i corrected it: process.bpmn (5.9 KB)

1 Like

@aravindhrs

Thank you so much , it worked this time .