Hi
I am generating a fake-process that gets called in a test, so I do not have to bootstrap the called process.
Basically it looks like this:
BpmnModelInstance assignmentProcess = Bpmn.createExecutableProcess("taskAssignment") .startEvent("start") .serviceTask("setCandidateGroup") .endEvent() .done(); ServiceTask serviceTask = assignmentProcess.getModelElementsByType(ServiceTask.class).stream().findFirst().get(); serviceTask.setCamundaDelegateExpression("${setCandidateGroup}");
But: my code does not find the delegateExpression … I just want to set a key=value process variable. Is there an easier way to achieve this? Maybe something like
servicetask.execute("execution.setVariable('key','value')");