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