AnsweredAssumed Answered

problem with my code

Question asked by cjimenez1 on Jul 14, 2011
Latest reply on Jul 15, 2011 by cjimenez1
can you find any problem with my code? because I cannot and I stressed

<?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="ProcesoPublicar" name="Review And Approve Activiti Process">

    <startEvent id="eventoInicio" name="Inicio" activiti:formKey="ak:InicioPublicacion"></startEvent>

    <userTask id="tarea1" name="Tarea Revisar" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="ak:tareaRevisar">
      <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;</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('ak_reviewOutcome', task.getVariable('ak_reviewOutcome'));</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>
      execution.setVariable('ak_mail1', initiator.properties.email);
      execution.setVariable('ak_mail2', bpm_assignee.properties.email);
</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>

    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow1" name="" sourceRef="eventoInicio" targetRef="tarea1"></sequenceFlow>
    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
    <sequenceFlow id="flow2" name="" sourceRef="tarea1" targetRef="exclusivegateway1"></sequenceFlow>
    <sequenceFlow id="flow8" name="" sourceRef="exclusivegateway1" targetRef="endevent1">
      <extensionElements>
        <activiti:executionListener event="take" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
          <activiti:field name="script">
            <activiti:string>
      var mail = actions.create("mail");
      mail.parameters.to = ak_mail1;
      mail.parameters.subject = "Estado de la Publicacion";
      mail.parameters.from = ak_mail2;
      mail.parameters.text = "Lo sentimos, pero su articulo no fue aprobado";
      mail.execute(bpm_package);
      </activiti:string>
          </activiti:field>
        </activiti:executionListener>
      </extensionElements>
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${ak_reviewOutcome == 'Rechazar'}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="tarea2" name="Tarea Publicar" activiti:assignee="${ak_publicador.properties.userName}" activiti:formKey="ak:tareaPublicar">
    </userTask>
    <sequenceFlow id="flow9" name="" sourceRef="exclusivegateway1" targetRef="tarea2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${ak_reviewOutcome == 'Aprobar'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow10" name="" sourceRef="tarea2" targetRef="endevent1">
      <extensionElements>
        <activiti:executionListener event="take" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
          <activiti:field name="script">
            <activiti:string>
      var mail = actions.create("mail");
      mail.parameters.to = ak_mail1;
      mail.parameters.to_many =  ak_mail2;
      mail.parameters.from = ak_publicador.properties.mail;
      mail.parameters.subject = "Estado de la Publicacion";
      if(ak_estadoPublicacion == 'Publicar')
      {
         mail.parameters.text = "Su articulo fue publicado";
      }
      else
      {
         mail.parameters.text = "Su articulo no ha sido publicado";
      }
      mail.execute(bpm_package);
        </activiti:string>
          </activiti:field>
        </activiti:executionListener>
      </extensionElements>
    </sequenceFlow>
  </process>

  <bpmndi:BPMNDiagram id="BPMNDiagram_ProcesoPublicar">
    <bpmndi:BPMNPlane bpmnElement="ProcesoPublicar" id="BPMNPlane_ProcesoPublicar">
      <bpmndi:BPMNShape bpmnElement="eventoInicio" id="BPMNShape_eventoInicio">
        <omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="tarea1" id="BPMNShape_tarea1">
        <omgdc:Bounds height="55" width="105" x="125" y="190"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35" width="35" x="670" y="290"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
        <omgdc:Bounds height="40" width="40" x="285" y="197"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="tarea2" id="BPMNShape_tarea2">
        <omgdc:Bounds height="55" width="105" x="400" y="100"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="65" y="217"></omgdi:waypoint>
        <omgdi:waypoint x="125" y="217"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="230" y="217"></omgdi:waypoint>
        <omgdi:waypoint x="285" y="217"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
        <omgdi:waypoint x="305" y="237"></omgdi:waypoint>
        <omgdi:waypoint x="305" y="307"></omgdi:waypoint>
        <omgdi:waypoint x="670" y="307"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
        <omgdi:waypoint x="305" y="197"></omgdi:waypoint>
        <omgdi:waypoint x="305" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="400" y="127"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
        <omgdi:waypoint x="505" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="687" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="687" y="290"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

Outcomes