cancel
Showing results for 
Search instead for 
Did you mean: 

Assignees

mabukhaled
Champ in-the-making
Champ in-the-making
i crated new custom Assignees its called CopyToAssignees and i  set that Assignees mandatory false and when i start workflow and not select value for CopyToAssignees  there is problem  and i got the mssage below:

Please correct the errors below then click OK.
A system error happened during the operation: Variable InboundWF_CopyToAssignee' is not a Collection


model


<?xml version="1.0" encoding="UTF-8"?>
   <!–
      Filename: InboundWF-WorkflowModel.xml Description: This file describes
      the model for the InboundWF Workflow Author: mahmoud abukhaled
   –>

   <!– Definition of new Model –>

<model name="InboundWF:CS-OutboundWFworkflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>InboundWF Custom Model</description>
   <author>Mahmoud Abukhaled</author>
   <version>1.0</version>
   <!–
      Imports are required to allow references to definitions in other
      models
   –>
   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0"
         prefix="d" />
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
      <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
      <import uri="http://www.hulool.com/workflow/model/1.0" prefix="CSMersalWF" />
      <import uri="http://www.ds.alfresco.security.extension.com"
         prefix="sec" />

   </imports>
   <!– Introduction of new namespaces defined by this model –>

   <namespaces>

      <namespace uri="http://www.hulool.com/workflow/inbound/model/1.0"
         prefix="InboundWF" />



   </namespaces>


   <types>

      <type name="InboundWF:StartInbound">

         <parent>bpm:startTask</parent>

      </type>


      <type name="InboundWF:CreateNewInbound">

         <parent>bpm:workflowTask</parent>

         <properties>
            <property name="InboundWF:ApplicationNumber">
               <type>d:int</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
            </property>

            <property name="InboundWF:ExternalWaredApplicationNumber">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
            </property>


            <property name="InboundWF:ApplicationType">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
               <constraints>
                  <constraint ref="sec:applicationTypeValue" />
               </constraints>
            </property>




            <property name="InboundWF:Category">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>

            </property>

            <property name="InboundWF:Subject"><!–tittle –>
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>

            </property>


            <property name="InboundWF:Confidentiality">
               <type>d:boolean</type>
               <mandatory>false</mandatory>
               <default>false</default>
            </property>


            <property name="InboundWF:Sealed">
               <type>d:boolean</type>
               <mandatory>false</mandatory>
               <default>false</default>
            </property>


            <property name="InboundWF:Priority">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
               <constraints>
                  <constraint ref="sec:applicationPriorityValue" />
               </constraints>
            </property>


            <property name="InboundWF:DataEntryOperatorEntity">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>

            </property>


            <property name="InboundWF:DataEntryOperator">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>

            </property>


            <property name="InboundWF:DeliveryWay">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
               <constraints>
                  <constraint ref="sec:deliveryWayValue" />
               </constraints>
            </property>


            <property name="InboundWF:Sender">
               <title>Send To Direction</title>
               <type>d:text</type>
               <mandatory enforced="true">false</mandatory>
               <multiple>false</multiple>
               <constraints>
                  <constraint ref="sec:contactValue" />
               </constraints>
            </property>

            <!–sentto–>







            <property name="InboundWF:ActionTemplate">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
               <constraints>
                  <constraint ref="sec:actionTemplateValue" />
               </constraints>
            </property>

         </properties>


         <mandatory-aspects>
            <aspect>CSMersalWF:CSMersal</aspect>

            <aspect>InboundWF:SentToAssignee</aspect>
         </mandatory-aspects>

      </type>


      <type name="InboundWF:NewInbound">

         <parent>InboundWF:CreateNewInbound</parent>

         <properties>
            <property name="InboundWF:reviewOutcomeRouting">
               <type>d:text</type>
               <default>Save</default>
               <constraints>
                  <constraint type="LIST">
                     <parameter name="allowedValues">
                        <!–
                           TODO: Determine if priority values can be mapped to
                           human-readable strings
                        –>
                        <list>
                           <value>Routing</value>
                           <value>Save</value>
                           <value>SendBack</value>
                        </list>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
         </properties>

         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
            <property name="bpm:outcomePropertyName">
               <default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome
               </default>
            </property>
         </overrides>


         <mandatory-aspects>
            <aspect>CSMersalWF:CSMersal</aspect>
            <aspect>InboundWF:AssigneesVariables</aspect>
            <aspect>InboundWF:SentToAssignee</aspect>
         </mandatory-aspects>
      </type>


      <type name="InboundWF:Routing">
         <parent>InboundWF:CreateNewInbound</parent>

         <properties>
            <!–   Route to –>

            <property name="InboundWF:RoutineAction">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
               <constraints>
                  <constraint ref="sec:routingActionValue" />
               </constraints>
            </property>

            <!–  Copy to  –>

            <property name="InboundWF:RoutingDate">
               <type>d:date</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
            </property>



            <property name="InboundWF:StudyingPeriod">
               <type>d:int</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
            </property>

         </properties>

         <mandatory-aspects>

            <aspect>InboundWF:AssigneesVariables</aspect>
            <aspect>InboundWF:RouteToAssignee</aspect>
            <aspect>InboundWF:CopyToAssignee</aspect>
         </mandatory-aspects>

      </type>


      <type name="InboundWF:CopyTo">



         <parent>InboundWF:CreateNewInbound</parent>


         <mandatory-aspects>
            <aspect>CSMersalWF:CSMersal</aspect>
            <aspect>InboundWF:AssigneesVariables</aspect>

            <aspect>InboundWF:CopyToAssignee</aspect>
         </mandatory-aspects>

      </type>


   </types>


   <aspects>


      <aspect name="InboundWF:SentToAssignee">
         <associations>

            <association name="InboundWF:SentToAssignee">
               <source>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>true</mandatory>
                  <many>false</many>
               </target>
            </association>

         </associations>
      </aspect>


      <aspect name="InboundWF:RouteToAssignee">
         <associations>

            <association name="InboundWF:RouteToAssignee">
               <source>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>true</mandatory>
                  <many>false</many>
               </target>
            </association>

         </associations>
      </aspect>

      <aspect name="InboundWF:CopyToAssignee">
         <associations>

            <association name="InboundWF:CopyToAssignee">
               <source>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>

         </associations>
      </aspect>


      <aspect name="InboundWF:AssigneesVariables">
         <title> Inbound Assignees Variables</title>

         <properties>
            <property name="InboundWF:PreviousAssignee">
               <type>d:noderef</type>
               <mandatory>true</mandatory>
               <multiple>false</multiple>
            </property>

            <property name="InboundWF:CurrentAssignee">
               <type>d:noderef</type>
               <mandatory>true</mandatory>
               <multiple>false</multiple>
            </property>



         </properties>
      </aspect>



   </aspects>

</model>

process-definition

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
   xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
   xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
   expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">

   <process id="CS-Inbound-WFPD" name="CS-Inbound-WFPD">

      <extensionElements>

         <activiti:executionListener event="start"
            class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">


            <activiti:field name="script">
               <activiti:string>
                  <!–

                     Application Statuses: 00 <-> draft 100 <-> new 200 <-> saved 300
                     <-> routed 400 <-> sentback
                  –>


                  execution.setVariable('CSMersalWF_AppStatus','00');

               </activiti:string>
            </activiti:field>
         </activiti:executionListener>
      </extensionElements>

      <startEvent id="StartInbound" name="StartInbound"
         activiti:formKey="InboundWF:StartInbound">

      </startEvent>

      <sequenceFlow id="flow1" sourceRef="StartInbound"
         targetRef="Inbound-CreateNewInbound">
      </sequenceFlow>

      <userTask id="Inbound-CreateNewInbound" name="CreateNewInbound"
         activiti:assignee="${initiator.properties.userName}"
         activiti:formKey="InboundWF:CreateNewInbound">
         <extensionElements>


            <activiti:taskListener event="create"
               expression="${inBoundTaskListener.setCreatorInfo(task,initiator,execution)}" />



            <activiti:taskListener event="create"
               expression="${inBoundTaskListener.setReceivingDate(task)}" />

            <activiti:taskListener event="create"
               expression="${inBoundTaskListener.setOwnership(task,initiator)}" />


            <activiti:taskListener event="complete"
               class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
               <activiti:field name="script">
                  <activiti:string>
                     execution.setVariable('InboundWF_SentToAssignee',
                     task.getVariable('InboundWF_SentToAssignee'));

                     execution.setVariable('InboundWF_ApplicationNumber',task.getVariable('InboundWF_ApplicationNumber'));
                     execution.setVariable('InboundWF_ExternalWaredApplicationNumber',task.getVariable('InboundWF_ExternalWaredApplicationNumber'));
                     execution.setVariable('InboundWF_ApplicationType',task.getVariable('InboundWF_ApplicationType'));
                     execution.setVariable('InboundWF_Category',task.getVariable('InboundWF_Category'));
                     execution.setVariable('InboundWF_Subject',task.getVariable('InboundWF_Subject'));
                     execution.setVariable('InboundWF_Confidentiality',task.getVariable('InboundWF_Confidentiality'));
                     execution.setVariable('InboundWF_Sealed',task.getVariable('InboundWF_Sealed'));
                     execution.setVariable('InboundWF_Priority',task.getVariable('InboundWF_Priority'));
                     execution.setVariable('InboundWF_DeliveryWay',task.getVariable('InboundWF_DeliveryWay'));
                     execution.setVariable('InboundWF_Sender',task.getVariable('InboundWF_Sender'));
                     execution.setVariable('InboundWF_ActionTemplate',task.getVariable('InboundWF_Sender'));
                     execution.setVariable('InboundWF_task_id','activiti$'+execution.getId());



                  </activiti:string>
               </activiti:field>
            </activiti:taskListener>
         </extensionElements>
      </userTask>



      <sequenceFlow id="assignApplicationIdFlow" sourceRef="Inbound-CreateNewInbound"
         targetRef="assignApplicationId">


      </sequenceFlow>







      <serviceTask id="assignApplicationId" name="Assign Application Id"
         activiti:expression="${sequenceUtil.getInboundId(execution.getVariable('InboundWF_task_id'))}"
         activiti:resultVariable="InboundWF_ApplicationNumber" />


      <sequenceFlow id="flow2" sourceRef="assignApplicationId"
         targetRef="Inbound-NewInbound">


         <extensionElements>



            <activiti:executionListener event="take"
               class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">


               <activiti:field name="script">
                  <activiti:string>



                     execution.setVariable('InboundWF_CurrentAssignee',InboundWF_SentToAssignee);
                     execution.setVariable('InboundWF_PreviousAssignee',initiator);
                     
                     
                     <!–

                        Application Statuses: 00 <-> draft 100 <-> new 200 <-> saved 300
                        <-> routed 400 <-> sentback
                     –>


                     execution.setVariable('CSMersalWF_AppStatus','100');

                  </activiti:string>
               </activiti:field>
            </activiti:executionListener>
         </extensionElements>



      </sequenceFlow>





      <userTask id="Inbound-NewInbound" name="NewInbound"
         activiti:formKey="InboundWF:NewInbound" activiti:assignee="${InboundWF_CurrentAssignee.properties.userName}">





         <extensionElements>
            <activiti:taskListener event="create"
               expression="${inBoundTaskListener.setReceivingDate(task)}" />

            <activiti:taskListener event="create"
               expression="${inBoundTaskListener.setOwnership(task,InboundWF_CurrentAssignee)}" />




            <activiti:taskListener event="complete"
               class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
               <activiti:field name="script">
                  <activiti:string>
                     execution.setVariable('InboundWF_reviewOutcomeRouting',task.getVariableLocal('InboundWF_reviewOutcomeRouting'));

                  </activiti:string>
               </activiti:field>
            </activiti:taskListener>
         </extensionElements>



      </userTask>


      <sequenceFlow id="flow3" sourceRef="Inbound-NewInbound"
         targetRef="Inbound-RoutingExclusiveGateway">
      </sequenceFlow>

      <exclusiveGateway id="Inbound-RoutingExclusiveGateway"
         name="Routnig Exclusive Gateway">
      </exclusiveGateway>




      <sequenceFlow id="flow4" name="Save"
         sourceRef="Inbound-RoutingExclusiveGateway" targetRef="EndParallelGateway">



         <extensionElements>

            <activiti:executionListener event="take"
               class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">


               <activiti:field name="script">
                  <activiti:string>
                     <!–

                        Application Statuses: 00 <-> draft 100 <-> new 200 <-> saved 300
                        <-> routed 400 <-> sentback
                     –>


                     execution.setVariable('CSMersalWF_AppStatus','200');

                  </activiti:string>
               </activiti:field>
            </activiti:executionListener>
         </extensionElements>


         <conditionExpression xsi:type="tFormalExpression"><![CDATA[${InboundWF_reviewOutcomeRouting == 'Save'}]]></conditionExpression>
      </sequenceFlow>



      <sequenceFlow id="flow5" name="SendBack"
         sourceRef="Inbound-RoutingExclusiveGateway" targetRef="Inbound-NewInbound">


         <extensionElements>



            <activiti:executionListener event="take"
               class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">


               <activiti:field name="script">
                  <activiti:string>

                     var tempAssignee=InboundWF_CurrentAssignee;

                     execution.setVariable('InboundWF_CurrentAssignee',InboundWF_PreviousAssignee);
                     execution.setVariable('InboundWF_PreviousAssignee',tempAssignee);


<!–

                        Application Statuses: 00 <-> draft 100 <-> new 200 <-> saved 300
                        <-> routed 400 <-> sentback
                     –>


                     execution.setVariable('CSMersalWF_AppStatus','400');
                  </activiti:string>
               </activiti:field>
            </activiti:executionListener>
         </extensionElements>


         <conditionExpression xsi:type="tFormalExpression"><![CDATA[${InboundWF_reviewOutcomeRouting == 'SendBack'}]]></conditionExpression>

      </sequenceFlow>








      <sequenceFlow id="flow6" name="Routing"
         sourceRef="Inbound-RoutingExclusiveGateway" targetRef="Inbound-Routing">

         <extensionElements>



            <activiti:executionListener event="take"
               class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">


               <activiti:field name="script">
                  <activiti:string>

                     <!–

                        Application Statuses: 00 <-> draft 100 <-> new 200 <-> saved 300
                        <-> routed 400 <-> sentback
                     –>

                     execution.setVariable('CSMersalWF_AppStatus','300');
                  </activiti:string>
               </activiti:field>
            </activiti:executionListener>
         </extensionElements>




         <conditionExpression xsi:type="tFormalExpression"><![CDATA[${InboundWF_reviewOutcomeRouting == 'Routing'}]]></conditionExpression>
      </sequenceFlow>


      <userTask id="Inbound-Routing" name="Routing"
         activiti:assignee="${InboundWF_CurrentAssignee.properties.userName}"
         activiti:formKey="InboundWF:Routing">

         <extensionElements>

            <activiti:taskListener event="create"
               expression="${inBoundTaskListener.setOwnership(task,InboundWF_CurrentAssignee)}" />
               <activiti:taskListener event="complete"
               expression="${inBoundTaskListener.checkCopyAssignee(execution)}" />

            <activiti:taskListener event="complete"
               class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
               <activiti:field name="script">
                  <activiti:string>

                     execution.setVariable('InboundWF_CopyToAssignee',
                     task.getVariable('InboundWF_CopyToAssignee'));

                     execution.setVariable('InboundWF_RouteToAssignee',
                     task.getVariable('InboundWF_RouteToAssignee'));
                     
                     
                     
                  </activiti:string>
               </activiti:field>
            </activiti:taskListener>
         </extensionElements>

      </userTask>

      <sequenceFlow id="flow7" sourceRef="Inbound-Routing"
         targetRef="parallelgateway1">
      </sequenceFlow>


      <parallelGateway id="parallelgateway1" name="Parallel Gateway">
      </parallelGateway>




      <sequenceFlow id="flow9" name="RoutingTO" sourceRef="parallelgateway1"
         targetRef="Inbound-NewInbound">

         <extensionElements>



            <activiti:executionListener event="take"
               class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">


               <activiti:field name="script">
                  <activiti:string>


                     execution.setVariable('InboundWF_PreviousAssignee',InboundWF_CurrentAssignee);
                     execution.setVariable('InboundWF_CurrentAssignee',InboundWF_RouteToAssignee);






                  </activiti:string>
               </activiti:field>
            </activiti:executionListener>
         </extensionElements>

      </sequenceFlow>


      <sequenceFlow id="flow8" name="CopyTo" sourceRef="parallelgateway1"
         targetRef="Inbound-CopyTo">



      </sequenceFlow>



      <userTask id="Inbound-CopyTo" name="CopyTo" activiti:formKey="InboundWF:CopyTo"
         activiti:assignee="${reviewAssignee.properties.userName}">



         <extensionElements>
            <activiti:taskListener event="create"
               expression="${inBoundTaskListener.setReceivingDate(task)}" />

            <activiti:taskListener event="create"
               expression="${inBoundTaskListener.setOwnership(task,reviewAssignee)}" />

            <activiti:taskListener event="complete"
               class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
               <activiti:field name="script">
                  <activiti:string>

                     execution.setVariable('InboundWF_reviewOutcomeCopyTo',
                     task.getVariableLocal('InboundWF_reviewOutcomeCopyTo'));

                  </activiti:string>
               </activiti:field>
            </activiti:taskListener>
         </extensionElements>




         <!– For each assignee, task is created –>
         <multiInstanceLoopCharacteristics
            isSequential="false">
            <loopDataInputRef >InboundWF_CopyToAssignee</loopDataInputRef>
            <inputDataItem name="reviewAssignee" />


         </multiInstanceLoopCharacteristics>


      </userTask>




      <sequenceFlow id="flow10" sourceRef="Inbound-CopyTo"
         targetRef="EndParallelGateway">

      </sequenceFlow>



      <parallelGateway id="EndParallelGateway" name="End Parallel Gateway">
      </parallelGateway>


      <sequenceFlow id="flow11" sourceRef="EndParallelGateway"
         targetRef="end">



      </sequenceFlow>


      <endEvent id="end" />



   </process>

</definitions>
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
Your workflow model looks okey.
But it looks like this is because of the manipulation you are doing via script in you process definition file.
Just try once removing all the scripts related to that copyTOAssignee property.
Hope it should work.

mabukhaled
Champ in-the-making
Champ in-the-making
thanks for your replay …

i did what you told me  to do and still same its not working

A system error happened during the operation: Variable InboundWF_CopyToAssignee' is not a Collection