cancel
Showing results for 
Search instead for 
Did you mean: 

Creating forms in share for a new workflow

vferia15
Champ in-the-making
Champ in-the-making
Hello everybody,
I’m developing a new workflow, called PropContratacionNominativav2.bpmn20.xml located at .. \tomcat\shared\classes\alfresco\extension\workflow
Here is the code:
<?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://activiti.org/bpmn20">
  <process id="PropContratacionNominativav2" name="Propuesta de Contratacion Nominativav2">
    <documentation>Propuesta de Contratacion Nominativa version 2</documentation>
    <startEvent id="start" name="Start" activiti:formKey="alo:submitGroupReviewTask"></startEvent>
    <userTask id="validacionResponsable" name="Validacion Responsable" activiti:candidateGroups="${bpm_groupAssignee.properties.authorityName}">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariable('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;

if ((bpm_workflowDescription == "")||(bpm_workflowDescription =="'null"))
{
task.description="Propuesta de contatacion nominativa recibida de "+initiator.properties['cm:firstName']+' ' +initiator.properties['cm:lastName'];
}

</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'));

//Almacenamos en una variable el comentario de este paso para mostrarlo en el siguiente
execution.setVariable('wf_comment', task.getVariable('bpm_comment'));

//Almacenamos la persona que tiene asignada la tarea para mostrarlo en el siguiente
task.setVariable("alo_userNameValAnt",task.assignee);
task.setVariable("alo_groupNameValAnt",bpm_groupAssignee.properties['cm:authorityName']);

</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <exclusiveGateway id="reviewDecision" name="Review Decision"></exclusiveGateway>
    <userTask id="validacionDireccion" name="Validacion Direccion" activiti:candidateGroups="GROUP_TABS_Direccion" activiti:formKey="alo:activitiReviewTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariable('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
execution.setVariable('alo_userNameValAnt',alo_userNameValAnt);
execution.setVariable('alo_groupNameValAnt',alo_groupNameValAnt);

//Nos interesa que los comentarios se muestren todos
if (wf_comment != "")
{
task.setVariable('bpm_comment',wf_comment);
}

nombreGrupo =  alo_groupNameValAnt.substring(alo_groupNameValAnt.lastIndexOf('_')+1);


task.description="Propuesta de contratacion nominativa revisada y aprobada por " + people.getPerson(alo_userNameValAnt).properties.firstName + " " + people.getPerson(alo_userNameValAnt).properties.lastName + " responsable de " + nombreGrupo;</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'));
task.setVariable("alo_userNameValAnt",task.assignee);
task.setVariable("alo_groupNameValAnt","GROUP_TABS_Direccion");
</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
    <userTask id="validacionPersonal" name="Validacion Personal" activiti:candidateGroups="GROUP_TABS_Personal" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariable('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;

//Nos interesa que los comentarios se muestren todos
if (wf_comment != "")
{
task.setVariable('bpm_comment',wf_comment);
}

execution.setVariable('alo_groupNameValAnt',alo_groupNameValAnt);

nombreGrupo =  alo_groupNameValAnt.substring(alo_groupNameValAnt.lastIndexOf('_')+1);

task.description="Propuesta de contratacion nominativa revisada y aprobada por " + people.getPerson(alo_userNameValAnt).properties.firstName + " " + people.getPerson(alo_userNameValAnt).properties.lastName + " responsable de " + nombreGrupo;
</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'));

//Almacenamos en una variable el comentario de este paso para mostrarlo en el siguiente
task.setVariable("alo_userNameValAnt",task.assignee);
task.setVariable("alo_groupNameValAnt","GROUP_TABS_Personal");</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
    <userTask id="aprobadoPersonal" name="Aprobado Personal" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:approvedTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;

//Nos interesa que los comentarios se muestren todos
if (wf_comment != "")
{
task.setVariable('bpm_comment',wf_comment);
}

nombreGrupo =  alo_groupNameValAnt.substring(alo_groupNameValAnt.lastIndexOf('_')+1);
task.description="Propuesta de contratacion nominativa revisada y aprobada por " + people.getPerson(alo_userNameValAnt).properties.firstName + " " + people.getPerson(alo_userNameValAnt).properties.lastName + " responsable del servicio " + nombreGrupo;</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('bpm_assignee', initiator);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <endEvent id="endevent3" name="End"></endEvent>
    <userTask id="rechazadoPersonal" name="Rechazado Personal" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:rejectedTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;

//Nos interesa que los comentarios se muestren todos
if (wf_comment != "")
{
task.setVariable('bpm_comment',wf_comment);
}

nombreGrupo =  alo_groupNameValAnt.substring(alo_groupNameValAnt.lastIndexOf('_')+1);

task.description="Propuesta de contratacion nominativa revisada y rechazada por " + people.getPerson(alo_userNameValAnt).properties.firstName + " " + people.getPerson(alo_userNameValAnt).properties.lastName + " responsable del servicio " + nombreGrupo ;</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('bpm_assignee', initiator);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <endEvent id="endevent4" name="End"></endEvent>
    <userTask id="rechazadoDireccion" name="Rechazado Direccion" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:rejectedTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;

//Nos interesa que los comentarios se muestren todos
if (wf_comment != "")
{
   task.setVariable('bpm_comment',wf_comment);
}
nombreGrupo =  alo_groupNameValAnt.substring(alo_groupNameValAnt.lastIndexOf('_')+1);

task.description="Propuesta de contratacion nominativa revisada y rechazada por " + people.getPerson(alo_userNameValAnt).properties.firstName + " " + people.getPerson(alo_userNameValAnt).properties.lastName + " responsable del servicio " + nombreGrupo;</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('bpm_assignee', initiator);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <endEvent id="endevent2" name="End"></endEvent>
    <userTask id="rechazadoResponsable" name="Rechazado Responsable" activiti:assignee="${initiator.properties.userName}" activiti:formKey="alo:rejectedTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;

//Nos interesa que los comentarios se muestren todos
if (wf_comment != "")
{
task.setVariable('bpm_comment',wf_comment);
}
nombreGrupo =  alo_groupNameValAnt.substring(alo_groupNameValAnt.lastIndexOf('_')+1);
task.description="Propuesta de contratacion nominativa revisada y rechazada por " + people.getPerson(alo_userNameValAnt).properties.firstName + " " + people.getPerson(alo_userNameValAnt).properties.lastName + " responsable del servicio " + nombreGrupo;</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('bpm_assignee', initiator);
</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow1" name="" sourceRef="start" targetRef="validacionResponsable"></sequenceFlow>
    <sequenceFlow id="flow2" name="" sourceRef="validacionResponsable" targetRef="reviewDecision"></sequenceFlow>
    <sequenceFlow id="flow3" name="" sourceRef="reviewDecision" targetRef="validacionDireccion">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_reviewOutcome == 'Approve'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow4" name="" sourceRef="reviewDecision" targetRef="rechazadoResponsable"></sequenceFlow>
    <sequenceFlow id="flow5" name="" sourceRef="rechazadoResponsable" targetRef="endevent1"></sequenceFlow>
    <sequenceFlow id="flow6" name="" sourceRef="validacionDireccion" targetRef="exclusivegateway1"></sequenceFlow>
    <sequenceFlow id="flow7" name="" sourceRef="exclusivegateway1" targetRef="validacionPersonal">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_reviewOutcome == 'Approve'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow9" name="" sourceRef="rechazadoDireccion" targetRef="endevent2"></sequenceFlow>
    <sequenceFlow id="flow10" name="" sourceRef="validacionPersonal" targetRef="exclusivegateway2"></sequenceFlow>
    <sequenceFlow id="flow11" name="" sourceRef="exclusivegateway1" targetRef="rechazadoDireccion"></sequenceFlow>
    <sequenceFlow id="flow12" name="" sourceRef="aprobadoPersonal" targetRef="endevent3"></sequenceFlow>
    <sequenceFlow id="flow13" name="" sourceRef="exclusivegateway2" targetRef="aprobadoPersonal">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_reviewOutcome == 'Approve'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow14" name="" sourceRef="exclusivegateway2" targetRef="rechazadoPersonal"></sequenceFlow>
    <sequenceFlow id="flow15" name="" sourceRef="rechazadoPersonal" targetRef="endevent4"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_PropContratacionNominativav2">
    <bpmndi:BPMNPlane bpmnElement="PropContratacionNominativav2" id="BPMNPlane_PropContratacionNominativav2">
      <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
        <omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="validacionResponsable" id="BPMNShape_validacionResponsable">
        <omgdc:Bounds height="55" width="105" x="105" y="190"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="reviewDecision" id="BPMNShape_reviewDecision">
        <omgdc:Bounds height="40" width="40" x="250" y="197"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="validacionDireccion" id="BPMNShape_validacionDireccion">
        <omgdc:Bounds height="55" width="105" x="330" y="137"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
        <omgdc:Bounds height="40" width="40" x="475" y="144"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="validacionPersonal" id="BPMNShape_validacionPersonal">
        <omgdc:Bounds height="55" width="105" x="555" y="84"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
        <omgdc:Bounds height="40" width="40" x="700" y="91"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="aprobadoPersonal" id="BPMNShape_aprobadoPersonal">
        <omgdc:Bounds height="55" width="105" x="780" y="31"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent3" id="BPMNShape_endevent3">
        <omgdc:Bounds height="35" width="35" x="925" y="41"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="rechazadoPersonal" id="BPMNShape_rechazadoPersonal">
        <omgdc:Bounds height="55" width="105" x="780" y="151"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent4" id="BPMNShape_endevent4">
        <omgdc:Bounds height="35" width="35" x="925" y="161"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="rechazadoDireccion" id="BPMNShape_rechazadoDireccion">
        <omgdc:Bounds height="55" width="105" x="555" y="204"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
        <omgdc:Bounds height="35" width="35" x="700" y="214"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="rechazadoResponsable" id="BPMNShape_rechazadoResponsable">
        <omgdc:Bounds height="55" width="105" x="330" y="257"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35" width="35" x="475" y="267"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="65" y="217"></omgdi:waypoint>
        <omgdi:waypoint x="105" y="217"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="210" y="217"></omgdi:waypoint>
        <omgdi:waypoint x="250" y="217"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="270" y="197"></omgdi:waypoint>
        <omgdi:waypoint x="270" y="164"></omgdi:waypoint>
        <omgdi:waypoint x="330" y="164"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="270" y="237"></omgdi:waypoint>
        <omgdi:waypoint x="270" y="284"></omgdi:waypoint>
        <omgdi:waypoint x="330" y="284"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="435" y="284"></omgdi:waypoint>
        <omgdi:waypoint x="475" y="284"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="435" y="164"></omgdi:waypoint>
        <omgdi:waypoint x="475" y="164"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="495" y="144"></omgdi:waypoint>
        <omgdi:waypoint x="495" y="111"></omgdi:waypoint>
        <omgdi:waypoint x="555" y="111"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
        <omgdi:waypoint x="660" y="231"></omgdi:waypoint>
        <omgdi:waypoint x="700" y="231"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
        <omgdi:waypoint x="660" y="111"></omgdi:waypoint>
        <omgdi:waypoint x="700" y="111"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
        <omgdi:waypoint x="495" y="184"></omgdi:waypoint>
        <omgdi:waypoint x="495" y="231"></omgdi:waypoint>
        <omgdi:waypoint x="555" y="231"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
        <omgdi:waypoint x="885" y="58"></omgdi:waypoint>
        <omgdi:waypoint x="925" y="58"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
        <omgdi:waypoint x="720" y="91"></omgdi:waypoint>
        <omgdi:waypoint x="720" y="58"></omgdi:waypoint>
        <omgdi:waypoint x="780" y="58"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
        <omgdi:waypoint x="720" y="131"></omgdi:waypoint>
        <omgdi:waypoint x="720" y="178"></omgdi:waypoint>
        <omgdi:waypoint x="780" y="178"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
        <omgdi:waypoint x="885" y="178"></omgdi:waypoint>
        <omgdi:waypoint x="925" y="178"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

To use it, I have definided a new contextModel called aloeModel.xml located at ..\tomcat\shared\classes\alfresco\extension\model    based on workflowModel.xml
Here is the code:

 <?xml version="1.0" encoding="UTF-8"?>

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

    <description>Modelo de datos para Proyecto Aloe</description>
    <author>Victor Feria</author>
    <version>1.0</version>

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

    <namespaces>
        <namespace uri="http://tabaiba.es/model/aloe/0.1" prefix="alo"/>
    </namespaces>

    <types>

      <!–  Submit review to multiple people (as included in a group) –>
      <type name="alo:submitGroupReviewTask">
         <parent>wf:submitGroupReviewTask</parent>
         <mandatory-aspects>
            <aspect>alo:empleado</aspect>
         </mandatory-aspects>

      </type> 

     
   <type name="alo:activitiReviewTask">   
   <parent>wf:activitiReviewTask</parent>
         <mandatory-aspects>
            <aspect>alo:empleado</aspect>
         </mandatory-aspects>       
   </type>
   <type name="alo:approvedTask">
         <parent>wf:approvedTask</parent>
      </type>

      <type name="alo:rejectedTask">
         <parent>wf:rejectedTask</parent>
      </type>
   </types>

<aspects>
    <aspect name="alo:empleado">
        <properties>
            <property name="alo:nombre">
                <type>d:text</type>
            </property>
            <property name="alo:apellidos">
                <type>d:text</type>
            </property>
            <property name="alo:dni">
                <type>d:text</type>
            </property>
        </properties>
    </aspect>
    <aspect name="alo:pasosAnteriores">
        <properties>
            <property name="alo:userNameValAnt">
                <type>d:text</type>
            </property>
            <property name="alo:groupNameValAnt">
                <type>d:text</type>
            </property>           
            <property name="alo:userNameValInicial">
                <type>d:text</type>
            </property>
            <property name="alo:groupNameValInicial">
                <type>d:text</type>
            </property>            
        </properties>
    </aspect>   

</aspects>
   

</model>
Until here everything seems to be correct. I have checked the repository console http://localhost:8080/alfresco/faces/jsp/admin/repoadmin-console.jsp and with the command show models all I obtain:
Last command: show models all
Duration: 15ms
—–
IsLoaded: Y , RepoVersion: null , RepoName: aloeModel.xml , ModelQName: {http://tabaiba.es/model/aloe/0.1}aloeModel , Description: Modelo de datos para Proyecto Aloe , Author: Victor Feria , Published: null , Version: 1.0

Now I want to create a new workflow form, to do this I have created the file share-config-custom.xml  located at ..\tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension
My issue is that my changes in share-config-custom.xml  doesn’t affect the form showed, it ‘s always the same. If I do a hide instead of show the form doesn’t change.

<alfresco-config>


<!– Document Library config section –>
<config evaluator="string-compare" condition="DocumentLibrary">

<aspects>
    <!– Aspects that a user can see –>
    <visible>
        <aspect name="alo:empleados" />
        <aspect name="alo:pasosAnteriores" />
    </visible>
    <!– Aspects that a user can add. Same as "visible" if left empty –>
    <addable>
    </addable>
    <!– Aspects that a user can remove. Same as "visible" if left empty
    –>
    <removeable>
    </removeable>
</aspects>

<types>
    <type name="alo:submitGroupReviewTask">
    </type> 
   
    <type name="alo:activitiReviewTask">   
    </type>
   
    <type name="alo:approvedTask">
    </type>

    <type name="alo:rejectedTask">
    </type>
</types>
</config>





<config evaluator="aspect" condition="alo:empleados">
    <forms>
        <form>
            <field-visibility>
                <show id="alo:nombre" />
                <show id="alo:apellidos" />
                <show id="alo:dni" />
            </field-visibility>
            <appearance>
                <field id="alo:nombre" label-id="workflow.field.nombre" />
                <field id="alo:apellidos" label-id="workflow.field.apellidos" />
                <field id="alo:dni" label-id="workflow.field.dni" />
            </appearance>
        </form>
    </forms>
</config>


<config evaluator="task-type" condition="alo:submitGroupReviewTask">
    <forms>
        <form id="workflow-details">
            <field-visibility>
               <show id="bpm:groupAssignee" />
               <show id="wf:requiredApprovePercent" />
               <show id="packageItems" />

            </field-visibility>
            <appearance>
               <set id="" appearance="title" label-id="workflow.set.workflow.more_info" />
               <set id="items" appearance="title" label-id="workflow.set.items" />
              
               <field id="bpm:groupAssignee" label-id="workflow.field.review_group" />
               <field id="wf:requiredApprovePercent" />
               <field id="packageItems" set="items" />
            </appearance>
         </form>
        
         <form>
            <field-visibility>
               <show id="message" />
               <show id="taskOwner" />
               <show id="bpm:workflowPriority" />
               <show id="bpm:workflowDueDate" />
               <show id="bpm:taskId" />
               <show id="wf:requiredApprovePercent" />
               <show id="bpm:status" />
               <show id="packageItems" />
               <show id="alo:nombre" />
               <show id="alo:apellidos" />
               <show id="alo:dni" />
      
            </field-visibility>
            <appearance>
               <set id="" appearance="title" label-id="workflow.set.task.info" />
               <set id="info" appearance="" template="/org/alfresco/components/form/3-column-set.ftl" />
               <set id="progress" appearance="title" label-id="workflow.set.task.progress" />
               <set id="items" appearance="title" label-id="workflow.set.items" />
              
               <field id="message">
                  <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
               <field id="taskOwner" set="info" />
               <field id="bpm:taskId" set="info">
                  <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
               <field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info" read-only="true">
                  <control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
               </field>
               <field id="bpm:workflowDueDate" set="info" label-id="workflow.field.due">
                  <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
               <field id="wf:requiredApprovePercent" set="info" />
               <field id="bpm:status" set="progress" />
               <field id="packageItems" set="items" />
               <field id="alo:nombre" label-id="workflow.field.nombre">
                <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
               <field id="alo:apellidos" label-id="workflow.field.apellidos">
                <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
               <field id="alo:dni" label-id="workflow.field.dni">
                <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
            </appearance>
         </form>
      </forms>
   </config>

</alfresco-config>

Of course I have restarted tomcat after a change in share-config-custom.xml and of course the PropContratacionNominativav2.bpmn20.xml has been deployed from workflow console with

deploy activiti alfresco/extension/workflow/PropContratacionNominativav2.bpmn20.xml

I don’t know what I’m doing wrong and why the form doesn't follow my changes in share-config-custom.xml 

Please could somebody help me?
Regards
Víctor
13 REPLIES 13

wimc
Champ in-the-making
Champ in-the-making
Mathieu

Thanks a lot for a great tool.

<blockquote>
Next in the roadmap:

We will create a rule that parse an activiti workflow definition and automatically create corresponding type and forms before deploying the workflow.
Should be done by end of april.
</blockquote>

Where can I get more functionality about this?  It is possible to create the types and forms for an Activiti workflow through the BeCPG tool?

clperkins
Champ on-the-rise
Champ on-the-rise
Sorry for not fully explaining my previous statement and Matthieu you're absolutely correct about being able to create task  and start task models with this wonderful tool, but when it comes to creating the forms I do not see the appropriate evaluator types in the drop-down selection. The only available options are "node-type", "model-type", and "aspect". The two that I see used in  workflow form definitions are "string-compare" and "task-type" evaluators.  I think I am using your 0.4a release though so this may have changed. Of course, this is easily overcome by just editing the xml files directly after creating them in the Model Designer. Aside from that, this is easily one of the best tools I've used with Alfresco/Share. Keep up the good work Matthieu!

midoscofield
Champ in-the-making
Champ in-the-making
Hello,
So to summarize,
1-definitions of workflows are put into "shared\classes\alfresco\extension\workflow" and may be reloaded by using http://127.0.0.1:8080/alfresco/faces/jsp/admin/workflow-console.jsp
2-Models are put into "shared\classes\alfresco\extension\model" and may be reloaded by using http://127.0.0.1:8080/alfresco/faces/jsp/admin/repoadmin-console.jsp
3-config is put into tomcat\shared\classes\alfresco\extension\web-client-config-custom.xml and maybe reloaded by using http://127.0.0.1:8080/alfresco/faces/jsp/admin/webclientconfig-console.jsp
But the third one don't work when i try to reload (web-client-config-custom.xml)
Any idea ?

Hello,

regarding number 3: I placed web-client-config-custom.xml in  tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension  and then reload was  successful, but I did not reach the end of configuroation yet Smiley Happy

I'm new to Alfresco - can you describe in few words the difference between placing xml files mentioned above in shared/classes/alfresco and placing them in WEB-INF/classes/alfresco?

thanks in advance