[jboss-user] [jBPM] - Re: jbpm5 RULEFLOW VARIABLE CHANGED null

Luis Tamayo do-not-reply at jboss.com
Fri Sep 2 19:46:45 EDT 2011


Luis Tamayo [http://community.jboss.org/people/luis.tamayo] created the discussion

"Re: jbpm5 RULEFLOW VARIABLE CHANGED null"

To view the discussion, visit: http://community.jboss.org/message/624560#624560

--------------------------------------------------------------
Thanks, here is the file:

<?xml version="1.0" encoding="UTF-8"?> 
<definitions id="Definition"
             targetNamespace=" http://www.jboss.org/drools http://www.jboss.org/drools"
             typeLanguage=" http://www.java.com/javaTypes http://www.java.com/javaTypes"
             expressionLanguage=" http://www.mvel.org/2.0 http://www.mvel.org/2.0"
             xmlns=" http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/20100524/MODEL"
             xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation=" http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
             xmlns:g=" http://www.jboss.org/drools/flow/gpd http://www.jboss.org/drools/flow/gpd"
             xmlns:bpmndi=" http://www.omg.org/spec/BPMN/20100524/DI http://www.omg.org/spec/BPMN/20100524/DI"
             xmlns:dc=" http://www.omg.org/spec/DD/20100524/DC http://www.omg.org/spec/DD/20100524/DC"
             xmlns:di=" http://www.omg.org/spec/DD/20100524/DI http://www.omg.org/spec/DD/20100524/DI"
             xmlns:tns=" http://www.jboss.org/drools http://www.jboss.org/drools">


  <itemDefinition id="_personaVarItem" structureRef="com.lincoln.jbpm.model.Persona" />
  <itemDefinition id="_correoItem" structureRef="com.lincoln.jbpm.model.Correo" />


  <process processType="Private" isExecutable="true" id="org.drools.bpmn2.RequerimientoPermiso" name="Requerimiento Permiso" >


    <extensionElements>
     <tns:import name="java.io.*" />
    </extensionElements>
    <!-- process variables -->
    <property id="personaVar" itemSubjectRef="_personaVarItem"/>
    <property id="correo" itemSubjectRef="_correoItem"/>


    <!-- nodes -->
    <startEvent id="_1" name="Start" />
    <userTask id="_2" name="Solicitud Empleado" >
      <ioSpecification>
        <dataInput id="_2_correoInput" name="correo" />
        <dataInput id="_2_personaInput" name="persona" />
        <dataInput id="_2_ContentInput" name="Content" />
        <dataInput id="_2_TaskNameInput" name="TaskName" />
        <dataOutput id="_2_personaOutput" name="persona" />
        <dataOutput id="_2_correoOutput" name="correo" />
        <inputSet>
          <dataInputRefs>_2_correoInput</dataInputRefs>
          <dataInputRefs>_2_personaInput</dataInputRefs>
          <dataInputRefs>_2_ContentInput</dataInputRefs>
          <dataInputRefs>_2_TaskNameInput</dataInputRefs>
        </inputSet>
        <outputSet>
          <dataOutputRefs>_2_personaOutput</dataOutputRefs>
          <dataOutputRefs>_2_correoOutput</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <sourceRef>correo</sourceRef>
        <targetRef>_2_correoInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>personaVar</sourceRef>
        <targetRef>_2_personaInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2_ContentInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression"></from>
          <to xsi:type="tFormalExpression">_2_ContentInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Solicitud de empleado #{personaVar.id}  #{personaVar.name} </from>
          <to xsi:type="tFormalExpression">_2_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataOutputAssociation>
        <sourceRef>_2_personaOutput</sourceRef>
        <targetRef>personaVar</targetRef>
      </dataOutputAssociation>
      <dataOutputAssociation>
        <sourceRef>_2_correoOutput</sourceRef>
        <targetRef>correo</targetRef>
      </dataOutputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>operator</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>
    <businessRuleTask id="_3" name="Correo Requerimiento" g:ruleFlowGroup="envio correo" >
    </businessRuleTask>
    <userTask id="_4" name="Aprobacion Requerimiento" >
      <ioSpecification>
        <dataInput id="_4_personaInput" name="persona" />
        <dataInput id="_4_correoInput" name="correo" />
        <dataInput id="_4_ContentInput" name="Content" />
        <dataInput id="_4_TaskNameInput" name="TaskName" />
        <dataOutput id="_4_personaOutput" name="persona" />
        <dataOutput id="_4_correoOutput" name="correo" />
        <inputSet>
          <dataInputRefs>_4_personaInput</dataInputRefs>
          <dataInputRefs>_4_correoInput</dataInputRefs>
          <dataInputRefs>_4_ContentInput</dataInputRefs>
          <dataInputRefs>_4_TaskNameInput</dataInputRefs>
        </inputSet>
        <outputSet>
          <dataOutputRefs>_4_personaOutput</dataOutputRefs>
          <dataOutputRefs>_4_correoOutput</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <sourceRef>personaVar</sourceRef>
        <targetRef>_4_personaInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>correo</sourceRef>
        <targetRef>_4_correoInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_4_ContentInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression"></from>
          <to xsi:type="tFormalExpression">_4_ContentInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_4_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Aprobacion requerimiento #{personaVar.id}  #{personaVar.name} </from>
          <to xsi:type="tFormalExpression">_4_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataOutputAssociation>
        <sourceRef>_4_personaOutput</sourceRef>
        <targetRef>personaVar</targetRef>
      </dataOutputAssociation>
      <dataOutputAssociation>
        <sourceRef>_4_correoOutput</sourceRef>
        <targetRef>correo</targetRef>
      </dataOutputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>doctor</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>
    <endEvent id="_6" name="End" >
        <terminateEventDefinition/>
    </endEvent>
    <task id="_7" name="envio email" tns:taskName="Email" >
      <extensionElements>
        <tns:onEntry-script scriptFormat=" http://www.java.com/java http://www.java.com/java">
          <script>try{


FileWriter fstream = new FileWriter("c:/emailinscripttask.txt");


  com.lincoln.jbpm.model.Persona pers = (com.lincoln.jbpm.model.Persona)kcontext.getVariable("personaVar");
    BufferedWriter out = new BufferedWriter(fstream);
  if(pers == null  ){
   out.write("la huevaa es null"  );
   } else {
  out.write("caho Java bpm " + pers.getName() );
  }
  //Close the output stream
  out.close();
  } catch (Exception e){
            e.printStackTrace();
  }</script>
        </tns:onEntry-script>
        <tns:onExit-script scriptFormat=" http://www.java.com/java http://www.java.com/java">
          <script>try{


FileWriter fstream = new FileWriter("c:/emailoutscripttask.txt");


  com.lincoln.jbpm.model.Persona pers = (com.lincoln.jbpm.model.Persona)kcontext.getVariable("personaVar");
    BufferedWriter out = new BufferedWriter(fstream);
  if(pers == null  ){
   out.write("la huevaa es null"  );
   } else {
  out.write("caho Java bpm " + pers.getName() );
  }
  //Close the output stream
  out.close();
  } catch (Exception e){
            e.printStackTrace();
  }</script>
        </tns:onExit-script>
      </extensionElements>
      <ioSpecification>
        <dataInput id="_7_personaInput" name="persona" />
        <dataInput id="_7_FromInput" name="From" />
        <dataOutput id="_7_personaOutput" name="persona" />
        <inputSet>
          <dataInputRefs>_7_personaInput</dataInputRefs>
          <dataInputRefs>_7_FromInput</dataInputRefs>
        </inputSet>
        <outputSet>
          <dataOutputRefs>_7_personaOutput</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <sourceRef>personaVar</sourceRef>
        <targetRef>_7_personaInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_7_FromInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression"> mailto:luis.tamayo at lincoln-grp.com luis.tamayo at lincoln-grp.com</from>
          <to xsi:type="tFormalExpression">_7_FromInput</to>
        </assignment>
      </dataInputAssociation>
      <dataOutputAssociation>
        <sourceRef>_7_personaOutput</sourceRef>
        <targetRef>personaVar</targetRef>
      </dataOutputAssociation>
    </task>


    <!-- connections -->
    <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />
    <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />
    <sequenceFlow id="_3-_4" sourceRef="_3" targetRef="_4" />
    <sequenceFlow id="_7-_6" sourceRef="_7" targetRef="_6" />
    <sequenceFlow id="_4-_7" sourceRef="_4" targetRef="_7" />


  </process>


  <bpmndi:BPMNDiagram>
    <bpmndi:BPMNPlane bpmnElement="org.drools.bpmn2.RequerimientoPermiso" >
      <bpmndi:BPMNShape bpmnElement="_1" >
        <dc:Bounds x="100" y="100" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2" >
        <dc:Bounds x="237" y="103" width="155" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_3" >
        <dc:Bounds x="435" y="107" width="155" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_4" >
        <dc:Bounds x="671" y="106" width="162" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_6" >
        <dc:Bounds x="1066" y="112" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_7" >
        <dc:Bounds x="900" y="111" width="100" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="_1-_2" >
        <di:waypoint x="124" y="124" />
        <di:waypoint x="314" y="127" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-_3" >
        <di:waypoint x="314" y="127" />
        <di:waypoint x="512" y="131" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_3-_4" >
        <di:waypoint x="512" y="131" />
        <di:waypoint x="752" y="130" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_7-_6" >
        <di:waypoint x="950" y="135" />
        <di:waypoint x="1090" y="136" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_4-_7" >
        <di:waypoint x="752" y="130" />
        <di:waypoint x="950" y="135" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>


</definitions>
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/624560#624560]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110902/070ae81e/attachment-0001.html 


More information about the jboss-user mailing list