Hi
I'm looking at all the alternatives for assigning a task to a user/group that Camunda has on offer to workout what would be best for us to use.
"When using Spring or CDI it is possible to use the custom assignment attributes as described in the section above and delegate to a bean using a task listener with an expression that listens to task create events. In the following example, the assignee will be set by calling the findManagerOfEmployee on the ldapService Spring/CDI bean. The emp parameter that is passed is a process variable>."
Where you can then use:
<userTask id="task" name="My Task" camunda:assignee="${ldapService.findManagerForEmployee(emp)}"/>
or
<userTask id="task" name="My Task" camunda:candidateUsers="${ldapService.findAllSales()}"/>
I have created the FakeLdapService class as in the docs and configured a bean within the Spring applicationContext.xml file as follows:
<bean id="ldapService" class="co.za.itdynamics.assignment.FakeLdapService" />
However am always getting errors and cannot get this working
1) For the "camunda:assignee="${ldapService.findManagerForEmployee(emp)}"" option on server startup (if using the Started implementation of InitialisingBean runtimeService.startProcessInstanceByKey("customassignment"); ) I get the following error:
SEVERE: Error while closing command context
org.camunda.bpm.engine.ProcessEngineException: Error while evaluating expression: ${ldapService.findManagerForEmpl
oyee(emp)}. Cause: Could not lookup beanmanager in jndi. If no jndi is available, set the beanmanger to the 'local
Instance' property of this class.
at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:61)
at org.camunda.bpm.engine.impl.bpmn.behavior.UserTaskActivityBehavior.handleAssignments(UserTaskActivityBe
havior.java:114)
at org.camunda.bpm.engine.impl.bpmn.behavior.UserTaskActivityBehavior.execute(UserTaskActivityBehavior.jav
a:97)...
.....
....
...
...
...
2) For the "camunda:candidateUsers="${ldapService.findAllSales()}"/>" option. Server starts up correctly... however at run time when I try to move a process to the task with this configuration I get the following error:
Server Error: Cannot submit task form 531a76a3-3e70-11e4-90f1-d4bed948baf9: Unknown property used in expression: ${ldapService.findAllSales()}. Cause: Cannot resolve identifier 'ldapService'
Is there any steps that I have missed here?