AnsweredAssumed Answered

activiti error while custommizing assignee.

Question asked by wajdi.ghribi on Jun 17, 2013
HI,
i want to make a two steps Verif/appro workflow using activiti,every thing is worked but when i want to customize the assignees alfresco shows this error message when clicking on "start workflow" <c> org.alfresco.service.cmr.workflow.WorkflowException: 05170015 Impossible de démarrer le workflow activiti$wajdi2017:1:6104.</c>
those are my process and my model, help please.

process:

<?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="wajdi2018" name="wajdi2018" isExecutable="true">
    <userTask id="usertask8" name="Vérification" activiti:assignee="${scwf_Verificateur.properties.userName}" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>/* next two lines are workarounds ACT-765, ACT-766 */
                if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
    <sequenceFlow id="flow54" sourceRef="usertask8" targetRef="exclusivegateway1"></sequenceFlow>
    <sequenceFlow id="flow55" sourceRef="exclusivegateway1" targetRef="alfrescoUsertask1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_reviewOutcome == 'Reject'}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="alfrescoUsertask1" name="Alfresco User Task" activiti:assignee="${initiator.properties.userName}" activiti:formKey="scwf:submitHelloWorldTask"></userTask>
    <sequenceFlow id="flow56" sourceRef="alfrescoUsertask1" targetRef="usertask8"></sequenceFlow>
    <startEvent id="alfrescoStartevent1" name="Alfresco start" activiti:formKey="scwf:submitHelloWorldTask"></startEvent>
    <sequenceFlow id="flow59" sourceRef="alfrescoStartevent1" targetRef="usertask8"></sequenceFlow>
    <exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
    <endEvent id="endevent2" name="End"></endEvent>
    <sequenceFlow id="flow61" sourceRef="exclusivegateway2" targetRef="endevent2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_reviewOutcome == 'Approve'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow62" sourceRef="exclusivegateway2" targetRef="usertask8">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_reviewOutcome == 'Reject'}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="alfrescoUsertask2" name="Approbation" activiti:assignee="${scwf_Approbateur.properties.userName}" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>/* next two lines are workarounds ACT-765, ACT-766 */
                if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow63" sourceRef="exclusivegateway1" targetRef="alfrescoUsertask2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_reviewOutcome == 'Approve'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow64" sourceRef="alfrescoUsertask2" targetRef="exclusivegateway2"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_wajdi2018">
    <bpmndi:BPMNPlane bpmnElement="wajdi2018" id="BPMNPlane_wajdi2018">
      <bpmndi:BPMNShape bpmnElement="usertask8" id="BPMNShape_usertask8">
        <omgdc:Bounds height="55.0" width="105.0" x="200.0" y="80.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
        <omgdc:Bounds height="40.0" width="40.0" x="400.0" y="89.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="alfrescoUsertask1" id="BPMNShape_alfrescoUsertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="120.0" y="212.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="alfrescoStartevent1" id="BPMNShape_alfrescoStartevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="40.0" y="90.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
        <omgdc:Bounds height="40.0" width="40.0" x="670.0" y="87.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
        <omgdc:Bounds height="35.0" width="35.0" x="755.0" y="90.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="alfrescoUsertask2" id="BPMNShape_alfrescoUsertask2">
        <omgdc:Bounds height="55.0" width="105.0" x="480.0" y="82.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow54" id="BPMNEdge_flow54">
        <omgdi:waypoint x="305.0" y="107.0"></omgdi:waypoint>
        <omgdi:waypoint x="400.0" y="109.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow55" id="BPMNEdge_flow55">
        <omgdi:waypoint x="420.0" y="129.0"></omgdi:waypoint>
        <omgdi:waypoint x="500.0" y="216.0"></omgdi:waypoint>
        <omgdi:waypoint x="261.0" y="235.0"></omgdi:waypoint>
        <omgdi:waypoint x="225.0" y="239.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow56" id="BPMNEdge_flow56">
        <omgdi:waypoint x="172.0" y="212.0"></omgdi:waypoint>
        <omgdi:waypoint x="252.0" y="135.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow59" id="BPMNEdge_flow59">
        <omgdi:waypoint x="75.0" y="107.0"></omgdi:waypoint>
        <omgdi:waypoint x="200.0" y="107.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow61" id="BPMNEdge_flow61">
        <omgdi:waypoint x="710.0" y="107.0"></omgdi:waypoint>
        <omgdi:waypoint x="755.0" y="107.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow62" id="BPMNEdge_flow62">
        <omgdi:waypoint x="690.0" y="87.0"></omgdi:waypoint>
        <omgdi:waypoint x="491.0" y="5.0"></omgdi:waypoint>
        <omgdi:waypoint x="252.0" y="80.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow63" id="BPMNEdge_flow63">
        <omgdi:waypoint x="440.0" y="109.0"></omgdi:waypoint>
        <omgdi:waypoint x="480.0" y="109.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow64" id="BPMNEdge_flow64">
        <omgdi:waypoint x="585.0" y="109.0"></omgdi:waypoint>
        <omgdi:waypoint x="670.0" y="107.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>


and my model:


<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="scwf:workflowmodel"
   xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Someco Workflow Model</description>
   <author>Jeff Potts</author>
   <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>
   <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" />
          <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="http://www.someco.com/model/workflow/1.0"
         prefix="scwf" />
         
   </namespaces>

   <types>
      <type name="scwf:submitHelloWorldTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="scwf:helloName">
               <type>d:text</type>
               <mandatory>true</mandatory>
               <multiple>false</multiple>
            </property>
         </properties>
         <mandatory-aspects>
              
                        <aspect>scwf:Verificateur</aspect>
                        <aspect>scwf:Approbateur</aspect>
                </mandatory-aspects>
      </type>
      
      <type name="scwf:submitReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>scwf:thirdPartyReviewable</aspect>
         </mandatory-aspects>
      </type>
     
        <type name="scwf:marketingReview">
            <parent>bpm:workflowTask</parent>
            <overrides>
                <property name="bpm:packageItemActionGroup">
                    <default>read_package_item_actions</default>
                </property>
            </overrides>
        </type>

        <type name="scwf:activitiMarketingReview">
            <parent>scwf:activitiReviewTask</parent>
        </type>
      
        <type name="scwf:test">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>scwf:thirdPartyReviewable</aspect>
         </mandatory-aspects>
      </type>
      
        <type name="scwf:operationsReview">
            <parent>bpm:workflowTask</parent>
            <overrides>
                <property name="bpm:packageItemActionGroup">
                    <default>read_package_item_actions</default>
                </property>
            </overrides>
        </type>

        <type name="scwf:activitiOperationsReview">
            <parent>scwf:activitiReviewTask</parent>
        </type>

        <type name="scwf:thirdPartyReview">
            <parent>bpm:workflowTask</parent>
            <overrides>
                <property name="bpm:packageItemActionGroup">
                    <default>read_package_item_actions</default>
                </property>
            </overrides>
        </type>
       
        <type name="scwf:activitiThirdPartyReview">
            <parent>scwf:activitiReviewTask</parent>
        </type>
       
        <type name="scwf:revise">
            <parent>bpm:workflowTask</parent>
            <overrides>
                <property name="bpm:packageItemActionGroup">
                    <default>edit_package_item_actions</default>
                </property>
            </overrides>
        </type>

        <type name="scwf:activitiRevise">
            <parent>bpm:activitiOutcomeTask</parent>
            <properties>
                <property name="scwf:reviseOutcome">
                    <type>d:text</type>
                    <default>Abort</default>
                    <constraints>
                        <constraint type="LIST">
                            <parameter name="allowedValues">
                                <list>
                                    <value>Re-submit</value>
                                    <value>Abort</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.someco.com/model/workflow/1.0}reviseOutcome</default>
                </property>
            </overrides>
        </type>

        <type name="scwf:activitiReviewTask">
            <parent>bpm:activitiOutcomeTask</parent>
            <properties>
                <property name="scwf:approveRejectOutcome">
                    <type>d:text</type>
                    <default>Reject</default>
                    <constraints>
                        <constraint type="LIST">
                            <parameter name="allowedValues">
                                <list>
                                    <value>Approve</value>
                                    <value>Reject</value>
                                </list>
                            </parameter>
                        </constraint>
                    </constraints>
                </property>
            </properties>              
            <overrides>
                <property name="bpm:packageItemActionGroup">
                    <default>read_package_item_actions</default>
                </property>
                <property name="bpm:outcomePropertyName">
                    <default>{http://www.someco.com/model/workflow/1.0}approveRejectOutcome</default>
                </property>
            </overrides>
           
        </type>

      <type name="scwf:activitiApprovedNotification">
          <parent>bpm:workflowTask</parent>
            <overrides>
                <property name="bpm:packageItemActionGroup">
                    <default>read_package_item_actions</default>
                </property>
            </overrides>         
      </type>
   </types>

   <aspects>
      <aspect name="scwf:thirdPartyReviewable">
         <title>Someco Third Party Reviewable</title>
         <properties>
            <property name="scwf:reviewerEmail">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
            </property>
         </properties>
      </aspect>
      
       <aspect name="scwf:Verificateur">
           <associations>
                <association name="scwf:Verificateur">
                        <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="scwf:Approbateur">
           <associations>
                <association name="scwf:Approbateur">
                        <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                        </source>
                        <target>
                        <class>cm:person</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                        </target>
                </association>
           </associations>
        </aspect>
       
   </aspects>
</model>


Outcomes