AnsweredAssumed Answered

Custom Assignment Handler and 2 arguments function

Question asked by akakunin on Dec 7, 2010
Latest reply on Dec 8, 2010 by frederikheremans1
Hi!

I'm trying to use custom assignment handler introduced in Activiti 5.0 final. So, I have task like this:

      <userTask id="usertask2" name="Review Asset"
         activiti:candidateGroups="${liferayGroups.getGroups(execution, &quot;Administrator&quot;)}">
         <extensionElements>
            <activiti:formProperty id="outputTransition" type="enum" required="true">
               <activiti:value id="Approve" label="Approve"/>
               <activiti:value id="Reject" label="Reject"/>
            </activiti:formProperty>
         </extensionElements>
      </userTask>


and I have bean like:

@Service("liferayGroups")
public class LiferayGroups {
   private static Log _log = LogFactoryUtil.getLog(LiferayGroups.class);
   
   public String getGroups(ExecutionImpl execution, String groups) {
      _log.info("Convet groups : " + groups);
                // some code here
        }
}

The thing is - I need execution context in my code to corrently process "groups" specified in the process definition.

My problem: process is not deployed at all - deploy() method return deployment - but no any process-definition related to it.
Wierd thing - there is nothing in logs - no any error or warn message.

I did some experiments - it looks like Activiti do not like 2 arguments in the function - if I'm using function with 1 argument like

activiti:candidateGroups="${liferayGroups.getGroups(&quot;Administrator&quot;)}"
or

activiti:candidateGroups="${liferayGroups.getGroups(execution)}"

everything deployed well.

So, is it possible to use more then 1 argument in custom handler? or - is it possible to access (somehow) excetion from custom assginment handler by other way then passing it as argument?

Outcomes