Timer boundary event : Unknown property used in expression

I have a process variable called “taskResolveDate” is a String datatype and has a value “2019-01-20T09:00:00Z”.

My Springbean definition is like:

@Component("workflowUtil")
public class WorkflowUtil {
  public LocalDateTime getISOLocalDateTime(String dateValue) {
    return LocalDateTime.parse(dateValue);
  }
}

And I configured in bpmn timer boundary event like:

image

The same in xml format:

<bpmn:timerEventDefinition>
  <bpmn:timeDate xsi:type="bpmn:tFormalExpression">${workflowUtil.getISOLocalDateTime(taskResolveDate)}</bpmn:timeDate>
</bpmn:timerEventDefinition>

I was getting below error:

[org.camunda.bpm.engine.context] [logError] @ 156 : ENGINE-16004 Exception while closing command context: Unknown property used in expression: ${workflowUtil.getISOLocalDateTime(taskResolveDate)}. Cause: Cannot resolve identifier 'taskResolveDate' 
org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: ${workflowUtil.getISOLocalDateTime(taskResolveDate)}. Cause: Cannot resolve identifier 'taskResolveDate'
	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:60)
	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:48)
	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.initializeConfiguration(TimerDeclarationImpl.java:114)
	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.postInitialize(TimerDeclarationImpl.java:142)
	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.postInitialize(TimerDeclarationImpl.java:36)
	at org.camunda.bpm.engine.impl.jobexecutor.JobDeclaration.createJobInstance(JobDeclaration.java:120)
	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.createTimer(TimerDeclarationImpl.java:169)

Hi @aravindhrs,

maybe it is a problem related to variable scope.

Cheers,
Tassilo

When starting the workflow(startProcessInstanceByKey) with variable taskResolveDate and i was trying to read this property in Timer start event(interrupting) in a event subprocess.

If its a variableScope, we can’t access processvariables into eventSubprocess?

I have event subprocess in my model like below:

<bpmn:subProcess id="Resolve_Event_SubProcess" name="Event Subprocess - Resolve " triggeredByEvent="true">

So Should i have to set Variable scope like below?

<camunda:executionListener event="start">
        <camunda:script scriptFormat="groovy"><![CDATA[execution.setVariable("taskResolveDate", "2019-01-21T11:00:00Z","Resolve_Event_SubProcess");]]></camunda:script>
</camunda:executionListener>

Hi @aravindhrs,

if you start the process with the variable {{taskResolveDate}} it is set to the local scope of the Start Event. Due to this reason it is not available in the Event Subprocess.

Cheers,
Tassilo

@tasso94 Here’s my bpmn file:
workflownew.bpmn (9.8 KB)

i’m starting the process with variable taskResolveDate which is String type.

In Timer start event i was converting to date using this function,

public class WorkflowUtil {
  public LocalDateTime getISOLocalDateTime(String dateValue) {
    return LocalDateTime.parse(dateValue);
  }
}

After setting variable scope also facing issues. Let me know how to resolve the variablescope issue?