For example I have a workflow which can start immediately or with a delay (startTime
variable).
Right after the startEvent
I have an exclusiveGateway
where I check if the flow should go on or wait until startTime
.
<exclusiveGateway id="startGateway" default="startSequenceFlow3"/>
<sequenceFlow id="startSequenceFlow1" sourceRef="startGateway" targetRef="startTimer">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${startTime != null}]]></conditionExpression>
</sequenceFlow>
Starting the workflow passing a variable startTime
works fine, but passing no startTime
throws an exception:
Cannot resolve identifier 'startTime'
What would be the best way to check if startTime
is set, since startTime != null
is not working? I would prefer not to pass a startTime
at all (not startTime=null
).
Code that I use including the variable:
variables.put("startTime", startTime);
ProcessInstance instance = runtimeService.startProcessInstanceByKey(processKey, variables);
or without:
ProcessInstance instance = runtimeService.startProcessInstanceByKey(processKey, variables);
Use the following expression:
${execution.getVariable('startTime') != null}