08-17-2015 07:58 AM
execution.setVariable('putwf_wfName', bpm_workflowDescription);
execution.setVariable('putwf_wfName', taskInstance.id);
<?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:xsd="http://www.w3.org/2001/XMLSchema" 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="echoShellLinux" isExecutable="true">
<startEvent id="theStart"></startEvent>
<sequenceFlow id="flow-mystart" sourceRef="theStart" targetRef="shellEcho">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<variable name="bpm_workflowDescription" access="read" />
<activiti:field name="script">
<activiti:string>
<![CDATA[logger.log("Here we are !!!");]]>
execution.setVariable('wf_dt', 'MyParam1');
execution.setVariable('putwf_wfName', bpm_workflowDescription);
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
</sequenceFlow>
<serviceTask id="shellEcho" activiti:type="shell">
<extensionElements>
<activiti:field name="command">
<activiti:string><![CDATA[/home/ultra/alfresco/projects/logme.sh]]></activiti:string>
</activiti:field>
<activiti:field name="arg1">
<activiti:expression>${wf_dt}</activiti:expression>
</activiti:field>
<activiti:field name="arg2">
<activiti:expression>${putwf_wfName}</activiti:expression>
</activiti:field>
<activiti:field name="outputVariable">
<activiti:string><![CDATA[resultVar]]></activiti:string>
</activiti:field>
</extensionElements>
</serviceTask>
<sequenceFlow id="sequenceFlow-92315e42-3ba1-480e-8788-c57ca217bbe2" sourceRef="shellEcho" targetRef="theTask"></sequenceFlow>
<userTask id="theTask" name="keep-alive task"></userTask>
<sequenceFlow id="sequenceFlow-4ab2aa0a-f004-4296-8ead-58d2f0438c25" sourceRef="theTask" targetRef="theEnd"></sequenceFlow>
<endEvent id="theEnd"></endEvent>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_echoShellLinux">
<bpmndi:BPMNPlane bpmnElement="echoShellLinux" id="BPMNPlane_echoShellLinux">
<bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
<omgdc:Bounds height="35.0" width="35.0" x="70.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="shellEcho" id="BPMNShape_shellEcho">
<omgdc:Bounds height="60.0" width="100.0" x="80.0" y="0.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="theTask" id="BPMNShape_theTask">
<omgdc:Bounds height="60.0" width="100.0" x="230.0" y="0.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
<omgdc:Bounds height="35.0" width="35.0" x="295.0" y="150.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow-mystart" id="BPMNEdge_flow-mystart">
<omgdi:waypoint x="87.0" y="140.0"></omgdi:waypoint>
<omgdi:waypoint x="42.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="42.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="80.0" y="30.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow-92315e42-3ba1-480e-8788-c57ca217bbe2" id="BPMNEdge_sequenceFlow-92315e42-3ba1-480e-8788-c57ca217bbe2">
<omgdi:waypoint x="180.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="192.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="192.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="230.0" y="30.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow-4ab2aa0a-f004-4296-8ead-58d2f0438c25" id="BPMNEdge_sequenceFlow-4ab2aa0a-f004-4296-8ead-58d2f0438c25">
<omgdi:waypoint x="330.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="342.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="342.0" y="30.0"></omgdi:waypoint>
<omgdi:waypoint x="312.0" y="150.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
08-18-2015 04:21 AM
<![CDATA[logger.log(workflow);]]>
I need workflow instance id and current workflow node so I can send those values to my external shell script. Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.