Where he set his gateway expression using the modeler to #{not weather} and #{weather} but with me it fails to resolve the variable
Here is my code which is identical to the one used in the video
public class CheckWeatherDelegate implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
Random rando =new Random();
execution.setVariable("name","Niall");
execution.setVariable("weather", rando.nextBoolean());
}
}
But it fails, I then tried changing the expression to the following below but nothing workds
${!weather} and {weather}
${not weather} and {weather}
#{not weather} and #{weather}
Where and how should I set the variables, I though you only set them using execution.setVariable(âweatherâ, rando.nextBoolean()); and set the expression in bpmn using the modeler to #{not weather} and #{weather} , I do not know where else I must define the variable like.
The error
The process could not be started. :
Cannot instantiate process definition SimpleDemo:1:9e2fac46-6de6-11e8-9ad2-402cf4108c7d: Unknown property used in expression: ${weather}. Cause: Cannot resolve identifier âweatherâ
In your above model, the evaluation of the condition is reached in the same transaction started the process as there are no wait states before. which means your variables havenât been stored to the database yet.
Please set asyncAfter attribute of âCheck weatherâ service task to true. as below
camunda:asyncAfter="true"
This way, asynchronous continuations will break the execution flow (end the transaction) & your variables will be stored before execution reaches the gateway.
@hassang2h I set the asyncAfter attribute of âCheck weatherâ to true but I still get the error, I attached the BPMN with the settings here
@ Nial I attached it the BPMN here I followed the video steps 2 - Camunda Tutorial for Java Developers on Vimeo but its not working for me. Another thing I also wanted to ensure is #{not weather} and #{weather} the correct expression or did I also mix the expression up because this is how it is done in the video?
When I start the process in Camunda engine I still get the error
The process could not be started. :
Cannot instantiate process definition SimpleDemo:1:52646dd7-6e37-11e8-b96b-402cf4108c7d: Unknown property used in expression: #{weather}. Cause: Cannot resolve identifier âweatherâ
Looks like there is a very annoying little problem with the way youâve connected up the symbols.
If you move the sequence flow which is going from the service task to the gateway youâll notice that itâs not connected in the way in which it seems:
Neill, this is just because you have dropped in the service activity box by dragging and dropping. and in your case its sits very well and the connectors adjusts automatically. But its not for all who follows your tutorials. Hence this.
I gone through the same problem⌠but its a problems and errors make us learning moreâŚ
Just wanted to let you know⌠to take care to mention this in your tutorials.
I think itâs more of a UX problem - and i think there are plans to mark overlapping sequence flows red so that people will be able to spot this problems faster.