How to use task as parameter?

when I use the Internal Context Variables “task” it’s make an error.

The process model fragment is shown below:

 <bpmn:userTask id="Activity_1o3jw90" name="数据审批" camunda:assignee="${commonService.assignee(execution)}">
      <bpmn:extensionElements>
        <camunda:taskListener expression="${commonService.assignee(task)}" event="complete" />
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0ifte93</bpmn:incoming>
      <bpmn:outgoing>Flow_0170e6s</bpmn:outgoing>
    </bpmn:userTask>

Then when I execute the process I get the following error :slight_smile:

An error happened while submitting the task form :
Cannot submit task form e2efe5a6-ff81-11ed-ae28-005056c00001: ENGINE-03051 There was an exception while invoking the TaskListener. Message: 'Error while evaluating expression: ${commonService.assignee(task)}. Cause: Cannot coerce from class org.camunda.bpm.engine.impl.persistence.entity.TaskEntity to interface org.camunda.bpm.engine.delegate.DelegateExecution'

What should I do?
Thanks a lot.

  • I found the reason, I used Java overloading caused.
    String assignee(DelegateTask delegateTask);
    String assignee(DelegateExecution delegateExecution);
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.