08-26-2013 04:08 PM
<?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://www.activiti.org/test">
<process isExecutable="true" id="invoice" name="Faktury">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>execution.setVariable('wf_financialControlGroup', groups.getGroup('Kontrola_finansowa').getFullName());
execution.setVariable('wf_managementGroup', groups.getGroup('Management').getFullName());
execution.setVariable('wf_ConaccGroup', groups.getGroup('Conacc').getFullName());
execution.setVariable('wf_invoicePaymentGroup', groups.getGroup('Platnicy_faktur').getFullName());
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
<startEvent id="start" name="Start" activiti:formKey="iwf:invoice">
</startEvent>
<userTask id="financialInvoiceApproval" name="Zatwierdzenie finansowe" activiti:candidateGroups="${wf_financialControlGroup}" activiti:formKey="iwf:financialInvoiceApproval">
<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.dueDate = bpm_workflowDueDate;
</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if(task.getVariable('iwf_suma') > 10000 ) {
var temp = "true"; }
execution.setVariable('iwf_sprawdzenie', temp);
execution.setVariable('bpm_dueDate', task.dueDate);
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="mgmtApproval" name="Zatwierdzenie Managment" activiti:candidateGroups="${wf_managementGroup}" activiti:formKey="iwf:mgmtApproval">
<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.dueDate = bpm_dueDate;</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('iwf_mgmtReviewOutcome', task.getVariable('iwf_mgmtReviewOutcome'));</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="invoicePayment" name="Opłacenie faktury" activiti:candidateGroups="${wf_financialControlGroup},${wf_invoicePaymentGroup}" activiti:formKey="iwf:invoicePayment">
<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.dueDate = bpm_dueDate;</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="runAs"><activiti:string>admin</activiti:string></activiti:field>
<activiti:field name="script">
<activiti:string>
var iwf_suma = task.getVariable('iwf_suma');
var iwf_sprzedawca = task.getVariable('iwf_sprzedawcap');
var child = bpm_package.children[0];
child.properties["cm:description"] = "Data płatności: " + bpm_dueDate + "\n" + "Suma: " + iwf_suma + "\n" + "Sprzedawca: " + iwf_sprzedawca;
child.addTags([iwf_suma,iwf_sprzedawca]);
child.save();
var dest = companyhome.childByNamePath("Sites/zatwierdzone-faktury/documentLibrary/ZatwierdzoneFaktury");
child.move(dest);
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<exclusiveGateway id="kDecision" name="10k decision"></exclusiveGateway>
<sequenceFlow id="flow1" sourceRef="start" targetRef="financialInvoiceApproval"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="financialInvoiceApproval" targetRef="kDecision"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="kDecision" targetRef="mgmtApproval"><conditionExpression xsi:type="tFormalExpression"><![CDATA[${iwf_sprawdzenie == "true"}]]></conditionExpression></sequenceFlow>
<sequenceFlow id="flow4" sourceRef="kDecision" targetRef="invoicePayment"></sequenceFlow>
<sequenceFlow id="flow5" sourceRef="mgmtApproval" targetRef="invoicePayment"><conditionExpression xsi:type="tFormalExpression"><![CDATA[${iwf_mgmtReviewOutcome == "Zatwierdź"}]]></conditionExpression></sequenceFlow>
<sequenceFlow id="flow6" sourceRef="invoicePayment" targetRef="endevent1"></sequenceFlow>
<endEvent id="endevent1" name="End"></endEvent>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
<bpmndi:BPMNPlane bpmnElement="invoice" id="BPMNPlane_invoice">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="70.0" y="270.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="financialInvoiceApproval" id="BPMNShape_financialInvoiceApproval">
<omgdc:Bounds height="55.0" width="105.0" x="170.0" y="260.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="kDecision" id="BPMNShape_kDecision">
<omgdc:Bounds height="40.0" width="40.0" x="340.0" y="267.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="invoicePayment" id="BPMNShape_invoicePayment">
<omgdc:Bounds height="55.0" width="105.0" x="450.0" y="260.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="mgmtApproval" id="BPMNShape_mgmtApproval">
<omgdc:Bounds height="55.0" width="105.0" x="308.0" y="370.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="620.0" y="270.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="105.0" y="287.0"></omgdi:waypoint>
<omgdi:waypoint x="170.0" y="287.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="275.0" y="287.0"></omgdi:waypoint>
<omgdi:waypoint x="340.0" y="287.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="360.0" y="307.0"></omgdi:waypoint>
<omgdi:waypoint x="360.0" y="370.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="360.0" y="370.0"></omgdi:waypoint>
<omgdi:waypoint x="502.0" y="315.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="380.0" y="287.0"></omgdi:waypoint>
<omgdi:waypoint x="450.0" y="287.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="555.0" y="287.0"></omgdi:waypoint>
<omgdi:waypoint x="620.0" y="287.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8"?>
<model name="iwf:myworkflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<imports>
<!– Import Alfresco Dictionary Definitions –>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<!– Import Alfresco System Definitions –>
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<!– Import User Model Definitions –>
<import uri="http://www.alfresco.org/model/user/1.0" prefix="usr" />
<import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
</imports>
<namespaces>
<namespace uri="http://www.alfresco.org/model/iWorkflow/1.0" prefix="iwf"/>
</namespaces>
<types>
<type name="iwf:invoice">
<parent>bpm:startTask</parent>
<overrides>
</overrides>
<mandatory-aspects>
<aspect>iwf:sum</aspect>
<aspect>iwf:sprzedawca</aspect>
</mandatory-aspects>
</type>
<type name="iwf:financialInvoiceApproval">
<parent>bpm:activitiOutcomeTask</parent>
<overrides>
<property name="bpm:packageActionGroup">
<default>add_package_item_actions</default>
</property>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpm:outcomePropertyName">
<default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome</default>
</property>
</overrides>
<mandatory-aspects>
<aspect>iwf:sum</aspect>
<aspect>iwf:sprzedawca</aspect>
</mandatory-aspects>
</type>
<type name="iwf:mgmtApproval">
<parent>bpm:activitiOutcomeTask</parent>
<properties>
<property name="iwf:mgmtReviewOutcome">
<type>d:text</type>
<default>Odrzuć</default>
<constraints>
<constraint name="iwf:mgmtReviewOutcomeOptions" type="LIST">
<parameter name="allowedValues">
<list>
<value>Zatwierdź</value>
<value>Odrzuć</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
</properties>
<overrides>
<property name="bpm:packageActionGroup">
<default>add_package_item_actions</default>
</property>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpm:outcomePropertyName">
<default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome
</default>
</property>
</overrides>
<mandatory-aspects>
<aspect>iwf:sum</aspect>
<aspect>iwf:sprzedawca</aspect>
</mandatory-aspects>
</type>
<type name="iwf:invoicePayment">
<parent>bpm:workflowTask</parent>
<overrides>
<property name="bpm:packageActionGroup">
<default>add_package_item_actions</default>
</property>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpm:outcomePropertyName">
<default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome</default>
</property>
</overrides>
<mandatory-aspects>
<aspect>iwf:sum</aspect>
<aspect>iwf:sprzedawca</aspect>
</mandatory-aspects>
</type>
</types>
<aspects>
<aspect name="iwf:sprzedawca">
<properties>
<property name="iwf:sprzedawcap">
<title>Sprzedawca</title>
<description>Sprzedawca</description>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
</aspect>
<aspect name="iwf:sum">
<properties>
<property name="iwf:suma">
<title>Suma faktury</title>
<description>Suma faktury</description>
<type>d:int</type>
<mandatory>true</mandatory>
</property>
</properties>
</aspect>
</aspects>
</model>
09-04-2013 01:24 PM
<config evaluator="task-type" condition="MYwf:submitMYTask">
<forms>
<form id="workflow-details">
09-04-2013 04:49 PM
<form id="workflow-details">
09-04-2013 07:28 PM
${iwf_sprawdzenie == "false"}
09-05-2013 02:45 AM
${iwf_sprawdzenie == "false"}
09-17-2013 06:12 AM
09-18-2013 04:23 AM
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.