AnsweredAssumed Answered

[bpm:assignee] Botón de Asignación de Usuario no aperece en workflow personalizado

Question asked by oskar201 on May 29, 2014
Latest reply on Jan 23, 2015 by feroi
Hola a todos!
Estoy desarrollando un flujo personalizado en Activiti para Alfresco. El flujo se despliega correctamente, cuando despliego el ejemplo incrustándole el nombre del usuario en la propiedad activiti:assignee="${…}" en el 'userTask' el flujo se inicia con normalidad, pero cuando intento que el usuario seleccione a qué usuario dirigir el flujo con activiti:assignee="${bpm_assignee.properties.userName}" , este falla. No se muestra en la interfaz share el botón de selección de usuario

Uso 3 archivos de configuración:

excercise11.bpm20.xml

<?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="exercise11" name="Final Exercise">
    <extensionElements>
      <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
        <activiti:field name="script">
          <activiti:string>logger.log("initializing…");</activiti:string>
        </activiti:field>
      </activiti:executionListener>
    </extensionElements>

    <startEvent id="alfrescoStartevent1" name="Alfresco start" activiti:formKey="wfge:startSopReview"></startEvent>
    <userTask id="usertask1" name="Review SOP" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="wfge:sopReview">
      <extensionElements>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>logger.log("task1 complete…");</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    ….


sopWorkflowModel.xml

<?xml version="1.0" encoding="UTF-8"?>
<model name="wfge:workflow-green-energy" xmlns="http://www.alfresco.org/model/dictionary/1.0">
    <description>example</description>
    <author>Training</author>
    <version>1.1</version>
   <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/workflow/1.0" prefix="wf"/>
   </imports>

   <namespaces>
      <namespace uri="http://www.alfresco.org/model/training/1.0" prefix="wfge"/>
   </namespaces>

   <types>
      <type name="wfge:startSopReview">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
         <aspect>wfge:instructionAspect</aspect>
         </mandatory-aspects>
      </type>
      <type name="wfge:sopReview">
         <parent>wf:activitiReviewTask</parent>
         <mandatory-aspects>
         <aspect>wfge:instructionAspect</aspect>         
         <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>    
      ….
</types>
<aspects>
      <aspect name="wfge:instructionAspect">
         <properties>
             <property name="wfge:instructions">
                <type>d:text</type>
                <mandatory>true</mandatory>
             </property>
         </properties>
      </aspect>
</aspects>   
</model>  


sop-workflow-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
    <!– Registration of workflow models –>   
   <bean id="ge.workflowBootstrap" parent="workflowDeployer">
    <property name="models">
       <list>
         <value>alfresco/extension/sopWorkflowModel.xml</value>
       </list>
     </property>
     <property name="workflowDefinitions">
        <list>
          <props>
       <prop key="engineId">activiti</prop>
       <prop key="location">alfresco/extension/exercise11.bpmn20.xml</prop>
       <prop key="mimetype">text/xml</prop>
       <prop key="redeploy">true</prop>
          </props>
       </list>
     </property>
   </bean>
</beans>


y finalmente se edita el archivo share-config-custom.xml


<config evaluator="string-compare" condition="activiti$exercise11">
      <forms>
         <form>
            <field-visibility>
               <show id="bpm:workflowDescription" />
               <show id="bpm:workflowDueDate" />
               <show id="bpm:workflowPriority" />
            <show id="bpm:assignee" />
               <show id="packageItems" />
               <show id="wfge:instructions" />
            </field-visibility>
            <appearance>
               <set id="" appearance="title" label-id="workflow.set.general" />
               <set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
               <set id="items" appearance="title" label-id="workflow.set.items" />
               <set id="other" appearance="title" label-id="workflow.set.other" />
               <set id="assignee" appearance="title" label-id="workflow.set.assignee" />
            <field id="bpm:assignee" label-id="workflow.field.assign_to" set="assignee" />
               <field id="bpm:workflowDescription" label-id="workflow.field.message">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl">
                     <control-param name="style">width: 95%</control-param>
                  </control>
               </field>
               <field id="wfge:instructions" label-id="Instructions for Reviewers" set="info">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                     <control-param name="style">width: 95%</control-param>                 
               </field>
            <field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info" />        


               <field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info">
                  <control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
               </field>
               <field id="packageItems" set="items" />
            </appearance>
         </form>
      </forms>
   </config>
   ….



La interfaz se muestra como el archivo adjunto … cualquier ayuda es bienvenida, gracias!

Attachments

Outcomes