267 lines
12 KiB
XML
Executable File
267 lines
12 KiB
XML
Executable File
<?xml version="1.0" encoding="UTF-8"?>
|
|
<definitions id="Definition"
|
|
targetNamespace="http://www.jboss.org/drools"
|
|
typeLanguage="http://www.java.com/javaTypes"
|
|
expressionLanguage="http://www.mvel.org/2.0"
|
|
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
|
|
xmlns:g="http://www.jboss.org/drools/flow/gpd"
|
|
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
|
|
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
|
|
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
|
|
xmlns:tns="http://www.jboss.org/drools">
|
|
|
|
<itemDefinition id="_maiaItem" structureRef="java.util.Map" />
|
|
<itemDefinition id="_taskMetaDataItem" structureRef="com.fp.simple.dto.TaskInfo" />
|
|
<itemDefinition id="_mainTaskItem" structureRef="com.fp.simple.dto.TaskInfo" />
|
|
<itemDefinition id="_actualTaskItem" structureRef="java.util.List" />
|
|
|
|
<process processType="Private" isExecutable="true" id="test" name="test" tns:packageName="maia.flows" tns:version="1" >
|
|
|
|
<extensionElements>
|
|
<tns:import name="com.fp.simple.flow.FlowUtil" />
|
|
<tns:import name="com.fp.simple.dto.TaskInfo" />
|
|
<tns:import name="java.util.Map" />
|
|
<tns:import name="java.util.ArrayList" />
|
|
</extensionElements>
|
|
<!-- process variables -->
|
|
<property id="maia" itemSubjectRef="_maiaItem"/>
|
|
<property id="taskMetaData" itemSubjectRef="_taskMetaDataItem"/>
|
|
<property id="mainTask" itemSubjectRef="_mainTaskItem"/>
|
|
<property id="actualTask" itemSubjectRef="_actualTaskItem"/>
|
|
|
|
<!-- nodes -->
|
|
<startEvent id="_1" name="Start" />
|
|
<endEvent id="_2" name="End" >
|
|
<terminateEventDefinition/>
|
|
</endEvent>
|
|
<userTask id="_3" name="Tomar Acción" >
|
|
<ioSpecification>
|
|
<dataInput id="_3_maiaInput" name="maia" />
|
|
<dataInput id="_3_taskMetaDataInput" name="taskMetaData" />
|
|
<dataInput id="_3_SkippableInput" name="Skippable" />
|
|
<dataInput id="_3_TaskNameInput" name="TaskName" />
|
|
<dataInput id="_3_GroupIdInput" name="GroupId" />
|
|
<dataOutput id="_3_taskMetaDataOutput" name="taskMetaData" />
|
|
<inputSet>
|
|
<dataInputRefs>_3_maiaInput</dataInputRefs>
|
|
<dataInputRefs>_3_taskMetaDataInput</dataInputRefs>
|
|
<dataInputRefs>_3_SkippableInput</dataInputRefs>
|
|
<dataInputRefs>_3_TaskNameInput</dataInputRefs>
|
|
<dataInputRefs>_3_GroupIdInput</dataInputRefs>
|
|
</inputSet>
|
|
<outputSet>
|
|
<dataOutputRefs>_3_taskMetaDataOutput</dataOutputRefs>
|
|
</outputSet>
|
|
</ioSpecification>
|
|
<dataInputAssociation>
|
|
<sourceRef>maia</sourceRef>
|
|
<targetRef>_3_maiaInput</targetRef>
|
|
</dataInputAssociation>
|
|
<dataInputAssociation>
|
|
<sourceRef>taskMetaData</sourceRef>
|
|
<targetRef>_3_taskMetaDataInput</targetRef>
|
|
</dataInputAssociation>
|
|
<dataInputAssociation>
|
|
<targetRef>_3_SkippableInput</targetRef>
|
|
<assignment>
|
|
<from xsi:type="tFormalExpression">false</from>
|
|
<to xsi:type="tFormalExpression">_3_SkippableInput</to>
|
|
</assignment>
|
|
</dataInputAssociation>
|
|
<dataInputAssociation>
|
|
<targetRef>_3_TaskNameInput</targetRef>
|
|
<assignment>
|
|
<from xsi:type="tFormalExpression">#{maia.request.subject}</from>
|
|
<to xsi:type="tFormalExpression">_3_TaskNameInput</to>
|
|
</assignment>
|
|
</dataInputAssociation>
|
|
<dataInputAssociation>
|
|
<targetRef>_3_GroupIdInput</targetRef>
|
|
<assignment>
|
|
<from xsi:type="tFormalExpression">#{taskMetaData.groupId}</from>
|
|
<to xsi:type="tFormalExpression">_3_GroupIdInput</to>
|
|
</assignment>
|
|
</dataInputAssociation>
|
|
<dataOutputAssociation>
|
|
<sourceRef>_3_taskMetaDataOutput</sourceRef>
|
|
<targetRef>taskMetaData</targetRef>
|
|
</dataOutputAssociation>
|
|
<potentialOwner>
|
|
<resourceAssignmentExpression>
|
|
<formalExpression>#{taskMetaData.userId}</formalExpression>
|
|
</resourceAssignmentExpression>
|
|
</potentialOwner>
|
|
</userTask>
|
|
<scriptTask id="_4" name="Evaluar" scriptFormat="http://www.java.com/java" >
|
|
<script>FlowUtil.evalRule(taskMetaData.getRuleCode(), maia);
|
|
System.out.println("Variables Maia Antes "+taskMetaData.getRuleCode()+">>"+maia+" "+taskMetaData);
|
|
taskMetaData.setUserId((maia.get("userId")!=null)?""+maia.get("userId"):null);
|
|
taskMetaData.setGroupId((maia.get("groupId")!=null)?""+maia.get("groupId"):null);
|
|
taskMetaData.setAction((maia.get("action")!=null)?""+maia.get("action"):null);
|
|
if(maia.get("internalCode")!=null){
|
|
taskMetaData.setInternalCode(maia.get("internalCode"));
|
|
}
|
|
maia.remove("userId");
|
|
maia.remove("groupId");
|
|
maia.remove("action");
|
|
maia.remove("internalCode");
|
|
|
|
System.out.println("Variables Maia "+taskMetaData.getRuleCode()+">>"+maia+" "+taskMetaData);</script>
|
|
</scriptTask>
|
|
<scriptTask id="_5" name="Determinar Autorizador" scriptFormat="http://www.java.com/java" >
|
|
<script>System.out.println("Preparar");</script>
|
|
</scriptTask>
|
|
<exclusiveGateway id="_6" name="Gateway" gatewayDirection="Diverging" />
|
|
<exclusiveGateway id="_7" name="Gateway" gatewayDirection="Converging" />
|
|
<exclusiveGateway id="_8" name="Gateway" gatewayDirection="Diverging" />
|
|
<userTask id="_9" name="Resolver Problema Previo" >
|
|
<ioSpecification>
|
|
<inputSet>
|
|
</inputSet>
|
|
<outputSet>
|
|
</outputSet>
|
|
</ioSpecification>
|
|
</userTask>
|
|
<exclusiveGateway id="_10" name="Gateway" gatewayDirection="Converging" />
|
|
<scriptTask id="_11" name="Preparar Tarea" scriptFormat="http://www.java.com/java" >
|
|
<script>mainTask=taskMetaData;
|
|
actualTask=new java.util.ArrayList();
|
|
kcontext.setVariable("actualTask",actualTask);</script>
|
|
</scriptTask>
|
|
<scriptTask id="_12" name="Registrar Tarea" >
|
|
<script>actualTask.add(taskMetaData);
|
|
taskMetaData=mainTask;</script>
|
|
</scriptTask>
|
|
<scriptTask id="_13" name="Finaliza Tarea" >
|
|
<script>actualTask.add(taskMetaData);</script>
|
|
</scriptTask>
|
|
|
|
<!-- connections -->
|
|
<sequenceFlow id="_13-_2" sourceRef="_13" targetRef="_2" />
|
|
<sequenceFlow id="_5-_3" sourceRef="_5" targetRef="_3" />
|
|
<sequenceFlow id="_10-_4" sourceRef="_10" targetRef="_4" />
|
|
<sequenceFlow id="_6-_5" sourceRef="_6" targetRef="_5" name="ACCION" tns:priority="1" >
|
|
<conditionExpression xsi:type="tFormalExpression" language="http://www.java.com/java" >return "A".equals(taskMetaData.getAction());</conditionExpression>
|
|
</sequenceFlow>
|
|
<sequenceFlow id="_4-_6" sourceRef="_4" targetRef="_6" />
|
|
<sequenceFlow id="_6-_7" sourceRef="_6" targetRef="_7" name="NO REQUERIDO" >
|
|
<conditionExpression xsi:type="tFormalExpression" language="http://www.java.com/java" >return !("A".equals(taskMetaData.getAction()));</conditionExpression>
|
|
</sequenceFlow>
|
|
<sequenceFlow id="_8-_7" sourceRef="_8" targetRef="_7" name="FIN" tns:priority="1" >
|
|
<conditionExpression xsi:type="tFormalExpression" language="http://www.java.com/java" >return taskMetaData.getResponse().compareTo("R")!=0;</conditionExpression>
|
|
</sequenceFlow>
|
|
<sequenceFlow id="_3-_8" sourceRef="_3" targetRef="_8" />
|
|
<sequenceFlow id="_8-_9" sourceRef="_8" targetRef="_9" name="REVISAR" tns:priority="1" >
|
|
<conditionExpression xsi:type="tFormalExpression" language="http://www.java.com/java" >return taskMetaData.getResponse().compareTo("R")==0;</conditionExpression>
|
|
</sequenceFlow>
|
|
<sequenceFlow id="_11-_10" sourceRef="_11" targetRef="_10" />
|
|
<sequenceFlow id="_12-_10" sourceRef="_12" targetRef="_10" />
|
|
<sequenceFlow id="_1-_11" sourceRef="_1" targetRef="_11" />
|
|
<sequenceFlow id="_9-_12" sourceRef="_9" targetRef="_12" />
|
|
<sequenceFlow id="_7-_13" sourceRef="_7" targetRef="_13" />
|
|
|
|
</process>
|
|
|
|
<bpmndi:BPMNDiagram>
|
|
<bpmndi:BPMNPlane bpmnElement="test" >
|
|
<bpmndi:BPMNShape bpmnElement="_1" >
|
|
<dc:Bounds x="48" y="108" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_2" >
|
|
<dc:Bounds x="852" y="24" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_3" >
|
|
<dc:Bounds x="435" y="119" width="133" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_4" >
|
|
<dc:Bounds x="132" y="24" width="97" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_5" >
|
|
<dc:Bounds x="238" y="121" width="170" height="49" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_6" >
|
|
<dc:Bounds x="300" y="24" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_7" >
|
|
<dc:Bounds x="600" y="24" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_8" >
|
|
<dc:Bounds x="600" y="120" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_9" >
|
|
<dc:Bounds x="504" y="192" width="241" height="49" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_10" >
|
|
<dc:Bounds x="156" y="192" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_11" >
|
|
<dc:Bounds x="12" y="192" width="121" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_12" >
|
|
<dc:Bounds x="288" y="192" width="128" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_13" >
|
|
<dc:Bounds x="696" y="24" width="121" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNEdge bpmnElement="_13-_2" >
|
|
<di:waypoint x="756" y="48" />
|
|
<di:waypoint x="876" y="48" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_5-_3" >
|
|
<di:waypoint x="323" y="145" />
|
|
<di:waypoint x="501" y="143" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_10-_4" >
|
|
<di:waypoint x="180" y="216" />
|
|
<di:waypoint x="180" y="48" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_6-_5" >
|
|
<di:waypoint x="324" y="48" />
|
|
<di:waypoint x="323" y="145" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_4-_6" >
|
|
<di:waypoint x="180" y="48" />
|
|
<di:waypoint x="324" y="48" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_6-_7" >
|
|
<di:waypoint x="324" y="48" />
|
|
<di:waypoint x="624" y="48" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_8-_7" >
|
|
<di:waypoint x="624" y="144" />
|
|
<di:waypoint x="624" y="48" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_3-_8" >
|
|
<di:waypoint x="501" y="143" />
|
|
<di:waypoint x="624" y="144" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_8-_9" >
|
|
<di:waypoint x="624" y="144" />
|
|
<di:waypoint x="624" y="216" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_11-_10" >
|
|
<di:waypoint x="72" y="216" />
|
|
<di:waypoint x="180" y="216" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_12-_10" >
|
|
<di:waypoint x="352" y="216" />
|
|
<di:waypoint x="180" y="216" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_1-_11" >
|
|
<di:waypoint x="72" y="132" />
|
|
<di:waypoint x="72" y="216" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_9-_12" >
|
|
<di:waypoint x="624" y="216" />
|
|
<di:waypoint x="352" y="216" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_7-_13" >
|
|
<di:waypoint x="624" y="48" />
|
|
<di:waypoint x="756" y="48" />
|
|
</bpmndi:BPMNEdge>
|
|
</bpmndi:BPMNPlane>
|
|
</bpmndi:BPMNDiagram>
|
|
|
|
</definitions> |