cancel
Showing results for 
Search instead for 
Did you mean: 

Task assigment exception

kerkira67
Champ in-the-making
Champ in-the-making
I tried to write a workflow which used the task assignment mechanism described in the Workflow Administration section of the Wiki.

It deploys ok but when I start the workflow (using the "Start Advenced Workflow" command from the context menu of a document) at the last step of the wizard I get an exception whose stacktrace ends with the following message:

Caused by: org.jbpm.JbpmException: actor-id expression '#{bpm_assignee.properties['cm:userName']}' returned null

I also tried the adhoc workflow example, which gives the same problem.

Any clue?

Thanks

Roberto
3 REPLIES 3

kerkira67
Champ in-the-making
Champ in-the-making
I add some info to the previous post, so that you can better understand my problem.

Here is my process definition:
——-BEGIN PROCESS DEFINITION——-
<?xml version="1.0" encoding="UTF-8"?>

<process-definition
  xmlns="urn:jbpm.org:jpdl-3.1"  name="Negoziazione Commesse">
   <swimlane name="initiator">
   </swimlane>
   <swimlane name="assignee">
        <assignment actor-id="#{bpm_assignee.properties['cm:userName']}"/>
   </swimlane>
   <swimlane name="Direttore Ufficio Programmazione Operativa">
   <assignment actor-id="ftuzi"/>
   </swimlane>
   <start-state name="Invio bozza PdGP">
      <task name="nc:InvioBozzaPdGP" swimlane="initiator">
         <controller>
            <variable name="Istituto" access="read,write,required" mapped-name="Istituto"></variable>
            <variable name="Dipartimento" access="read,write,required" mapped-name="Dipartimento"></variable>
         </controller>
      </task>
      <transition name="" to="Adeguamento PdGP (dipartimento)"></transition>
   </start-state>
   <task-node name="Adeguamento PdGP (dipartimento)">
      <task name="nc:RevisioneQuotaDipartimenti" swimlane="assignee" ></task>
      <transition name="" to="Adeguamento PdGP (Progettazione Operativa)"></transition>
   </task-node>
   <task-node name="Adeguamento PdGP (Progettazione Operativa)">
      <task name="nc:RevisioneQuotaDipartimenti" swimlane="Direttore Ufficio Programmazione Operativa"></task>
      <task name="nc:AssegnazioneQuotaArea" swimlane="Direttore Ufficio Programmazione Operativa"></task>
      <transition name="" to="Invia PdGP definitivo a dipartimento"></transition>
   </task-node>
   <task-node name="Invia PdGP definitivo a dipartimento">
      <task name="nc:InviaPdGPDefinitivoADipartimento" swimlane="Direttore Ufficio Programmazione Operativa"></task>
      <transition name="" to="Invia PdGP definitivo ad istituto"></transition>
   </task-node>
   <task-node name="Invia PdGP definitivo ad istituto">
      <task name="nc:InviaPdGPDefinitivoAdIstituto" swimlane="assignee"></task>
      <transition name="" to="Adeguamento su SIGLA e stampa"></transition>
   </task-node>
   <task-node name="Adeguamento su SIGLA e stampa">
      <task name="nc:AdeguamentoPdGPIstituto" swimlane="initiator"></task>
      <task name="nc:NotificaAProgettazioneOperativa" swimlane="initiator"></task>
      <transition name="" to="Fine"></transition>
   </task-node>
   <end-state name="Fine"></end-state>
</process-definition>

——-END PROCESS DEFINITION——-

Here is my task model:

——-BEGIN TASK MODEL——-
<?xml version="1.0" encoding="UTF-8"?>

<model name="nc:NegoziazioneCommesseModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

  <imports>
     <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
     <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
    
  </imports>

  <namespaces>
     <namespace uri="http://www.cnr.it/model/workflow/1.0" prefix="nc"/>
  </namespaces>
 
  <constraints>
        <constraint name="nc:istituti" type="LIST">
            <parameter name="allowedValues">
                <!–  TODO: Determine if priority values can be mapped to human-readable strings –>
                <list>
                    <value>IASI</value>
                    <value>IAC</value>
                    <value>IIT</value>
                </list>
            </parameter>
        </constraint>
        <constraint name="nc:dipartimenti" type="LIST">
            <parameter name="allowedValues">
                <!–  TODO: Determine if priority values can be mapped to human-readable strings –>
                <list>
                    <value>Terra ed ambiente</value>
                    <value>ICT</value>
                    <value>Diritto</value>
                </list>
            </parameter>
        </constraint>
       
        </constraints>
  <types>

     <type name="nc:InvioBozzaPdGP">
        <parent>bpm:startTask</parent>
        <properties>
           <property name="nc:Istituto">
              <type>d:text</type>
                   <constraints>
                        <constraint ref="nc:istituti" />
                    </constraints>
              </property>
           <property name="ncSmiley Very Happyipartimento">
              <type>d:text</type>
              <constraints>
                        <constraint ref="nc:dipartimenti" />
                    </constraints>
           </property>
        </properties>

        <mandatory-aspects>
           <aspect>bpm:assignee</aspect>
        </mandatory-aspects>
     </type>

     <type name="nc:RevisioneQuotaDipartimenti" description="Revisione quota dipartimenti" >
        <parent>bpm:workflowTask</parent>
         <properties>
           <property name="ncSmiley Very Happyepartment">
              <type>d:text</type>
           </property>
        </properties>
     </type>

     <type name="nc:AssegnazioneQuotaArea">
        <parent>bpm:workflowTask</parent>
     </type>
    
     <type name="nc:InviaPdGPDefinitivoADipartimento">
        <parent>bpm:workflowTask</parent>
     </type>
    
      <type name="nc:InviaPdGPDefinitivoAdIstituto">
        <parent>bpm:workflowTask</parent>
     </type>
      <type name="nc:AdeguamentoPdGPIstituto">
        <parent>bpm:workflowTask</parent>
     </type>
     <type name="nc:NotificaAProgettazioneOperativa">
        <parent>bpm:workflowTask</parent>
     </type>
  </types>
  
</model>

—-END TASK MODEL—–

Here is the beginning of the stack trace that is printed onto the standard output when I complete the start workflow wizard:

18:24:42,921 ERROR [ui.common.Utils] E occorso un errore di sistema durante loperazione: Failed to signal transition 'null' from workflow task 'jbpm$7'
org.alfresco.service.cmr.workflow.WorkflowException: Failed to signal transition 'null' from workflow task 'jbpm$7'

and here is the last message of the same stack trace:

Caused by: org.jbpm.JbpmException: actor-id expression '#{bpm_assignee.properties['cm_userName']}' returned null
        at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignmentActorIdExpr(TaskMgmtInstance.java:226)
        at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:196)
        … 81 more


Please help me because I have to implement this workflow as soon as possible, in order to show that alfresco is suitable for our purposes.

Thanks
Roberto

davidc
Star Contributor
Star Contributor
I haven't tried your process definition, but I think the issue is:

<controller>
<variable name="Istituto" access="read,write,required" mapped-name="Istituto"></variable>
<variable name="Dipartimento" access="read,write,required" mapped-name="Dipartimento"></variable>
</controller>

When a task controller is specified the only variables passed to/returned from the task, are those listed.  This means that bpm:assignee is not pushed back into the process, and therefore not found, when the swimlane assignment is resolved.

I don't think you need the controller at all.  In that case, you can refer to Istituto as nc_Istituto, and Dipartimento as nc_Dipartimento in your process definition.

kerkira67
Champ in-the-making
Champ in-the-making
Thanks.

The problem was exactly the one you pointed out.

Roberto