Hey guys,
I did the Advanced Java tutorial where Niall creates sub-process etc. Then I wanted to transfer it to my real project and run into problems.
I have a main process “Forschungsantrag” and a sub process “Pruefen”. The sub process is called after a user task in the main process. The sub process itself is a service task which is triggered by the expression "#{pruefenUnterlagen}. I tried to set the this variable trough my java class and set it to “true”.
That is my java code:
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 {
// TODO Auto-generated method stub
Random rando = new Random();
execution.setVariable("name", "demo");
execution.setVariable("weatherOK", rando.nextBoolean());
execution.setVariable("antragAbgelehnt", rando.nextBoolean());
}
}
Now if I start my process and I want to complete the first User task it says:
Cannot instantiate process definition Forschungsantrag:1:d82cd2ee-16d6-11ea-9f0f-0242ac110002: Unknown property used in expression: #{not antragAbgelehnt}. Cause: Cannot resolve identifier ‘antragAbgelehnt’
I assume the problem is, that I didn’t hand over the variable “antragAbgelehnt”, but the gateways in the process need this variable.
In general I don’t know exactly why the error above occurs and how I can handle it. Any help would be great Attached you can although find the main process (process.bpmn) and the sub process (pruefen.bpmn)
Thank you and I wish you a good night!
Pruefen.bpmn (2.2 KB) process.bpmn (12.6 KB)