+++ /dev/null
-<?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="procAnnulationSignature" name="Workflow annulation signature" isExecutable="true">
- <startEvent id="startAnnulationSignature" name="Début workflow annulation signature">
- <extensionElements>
- <activiti:formProperty id="nodeRef" name="Référence Alfresco du document dont on veut annuler la signature" type="string" required="true"></activiti:formProperty>
- </extensionElements>
- </startEvent>
- <scriptTask id="scriptExecutionQuery" name="Recherche instance processus signature" scriptFormat="javascript" activiti:autoStoreVariables="false">
- <script>logger.debug("scriptExecutionQuery IN");
-var dossierId = nodeRef;
-logger.info("Demande d'annulation de signature pour le dossier " + dossierId);
-var runtimeService = processEngine.getRuntimeService();
-var signatureExecution = runtimeService.createExecutionQuery().processInstanceBusinessKey(dossierId).processDefinitionKey("procSignature").singleResult();
-if (signatureExecution != null) {
- execution.setVariable("dossierId", dossierId);
- execution.setVariable("processInstanceId", signatureExecution.getProcessInstanceId());
- execution.setVariable("executionId", signatureExecution.getId());
- var codeRetour = runtimeService.getVariable(signatureExecution.getId(), "codeRetour");
- execution.setVariable("codeRetour", codeRetour);
- logger.debug("Le code retour de création dossier parapheur est " + codeRetour);
- logger.debug("Une instance de processus de signature a été trouvée avec l'identifiant " + signatureExecution.getProcessInstanceId());
-} else {
- execution.setVariable("processInstanceId", null);
- execution.setVariable("codeRetour", null);
- logger.info("Aucune instance de processus de signature n'a été trouvée pour le dossier " + dossierId);
-}
-logger.debug("scriptExecutionQuery OUT");</script>
- </scriptTask>
- <sequenceFlow id="flow1" sourceRef="startAnnulationSignature" targetRef="scriptExecutionQuery"></sequenceFlow>
- <exclusiveGateway id="exclusivegateway1" name="Test existence processus signature"></exclusiveGateway>
- <sequenceFlow id="flow2" sourceRef="scriptExecutionQuery" targetRef="exclusivegateway1"></sequenceFlow>
- <scriptTask id="scriptDeleteProcess" name="Suppression instance processus signature" scriptFormat="javascript" activiti:autoStoreVariables="false">
- <script>logger.debug("scriptDeleteProcess IN");
-logger.debug("Demande de suppression instance de processus " + processInstanceId);
-var runtimeService = processEngine.getRuntimeService();
-runtimeService.deleteProcessInstance(processInstanceId, "Demande d'annulation de signature pour le dossier " + dossierId);
-logger.debug("L'instance de processus " + processInstanceId + " a été supprimée");
-logger.debug("scriptDeleteProcess OUT");</script>
- </scriptTask>
- <sequenceFlow id="flow3" name="Instance trouvée" sourceRef="exclusivegateway1" targetRef="scriptDeleteProcess">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${processInstanceId != null}]]></conditionExpression>
- </sequenceFlow>
- <exclusiveGateway id="exclusivegateway2" name="Test création dossier parapheur"></exclusiveGateway>
- <sequenceFlow id="flow4" sourceRef="scriptDeleteProcess" targetRef="exclusivegateway2"></sequenceFlow>
- <scriptTask id="scriptExercerDroitRemords" name="Exercice droit remords dossier parapheur" scriptFormat="javascript" activiti:autoStoreVariables="false">
- <script>logger.debug("scriptExercerDroitRemords IN");
-logger.debug("Exercice droit de remords sur le dossier " + dossierId + " au parapheur.");
-if (clientParapheur.exercerDroitRemordDossier(dossierId)) {
- logger.info("Le dossier " + dossierId + " a été correctement retiré de la bannette de son destinataire.");
-} else {
- logger.error("Une erreur a eu lieu : " + clientParapheur.getMessageRetour());
-}
-logger.debug("scriptExercerDroitRemords OUT");</script>
- </scriptTask>
- <endEvent id="endevent1" name="Fin workflow annulation signature"></endEvent>
- <sequenceFlow id="flow5" sourceRef="exclusivegateway1" targetRef="endevent1"></sequenceFlow>
- <sequenceFlow id="flow6" name="Dossier non créé" sourceRef="exclusivegateway2" targetRef="endevent1">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${codeRetour == null || codeRetour.equals("KO")}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="flow7" name="Dossier parapheur créé" sourceRef="exclusivegateway2" targetRef="scriptExercerDroitRemords"></sequenceFlow>
- <sequenceFlow id="flow8" sourceRef="scriptExercerDroitRemords" targetRef="endevent1"></sequenceFlow>
- </process>
- <bpmndi:BPMNDiagram id="BPMNDiagram_procAnnulationSignature">
- <bpmndi:BPMNPlane bpmnElement="procAnnulationSignature" id="BPMNPlane_procAnnulationSignature">
- <bpmndi:BPMNShape bpmnElement="startAnnulationSignature" id="BPMNShape_startAnnulationSignature">
- <omgdc:Bounds height="35.0" width="35.0" x="30.0" y="60.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="scriptExecutionQuery" id="BPMNShape_scriptExecutionQuery">
- <omgdc:Bounds height="55.0" width="131.0" x="110.0" y="50.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
- <omgdc:Bounds height="40.0" width="40.0" x="284.0" y="57.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="scriptDeleteProcess" id="BPMNShape_scriptDeleteProcess">
- <omgdc:Bounds height="55.0" width="131.0" x="420.0" y="50.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
- <omgdc:Bounds height="40.0" width="40.0" x="465.0" y="144.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="scriptExercerDroitRemords" id="BPMNShape_scriptExercerDroitRemords">
- <omgdc:Bounds height="55.0" width="131.0" x="420.0" y="220.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
- <omgdc:Bounds height="35.0" width="35.0" x="287.0" y="147.0"></omgdc:Bounds>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
- <omgdi:waypoint x="65.0" y="77.0"></omgdi:waypoint>
- <omgdi:waypoint x="110.0" y="77.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
- <omgdi:waypoint x="241.0" y="77.0"></omgdi:waypoint>
- <omgdi:waypoint x="284.0" y="77.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
- <omgdi:waypoint x="324.0" y="77.0"></omgdi:waypoint>
- <omgdi:waypoint x="420.0" y="77.0"></omgdi:waypoint>
- <bpmndi:BPMNLabel>
- <omgdc:Bounds height="14.0" width="81.0" x="282.0" y="60.0"></omgdc:Bounds>
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
- <omgdi:waypoint x="485.0" y="105.0"></omgdi:waypoint>
- <omgdi:waypoint x="485.0" y="144.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
- <omgdi:waypoint x="304.0" y="97.0"></omgdi:waypoint>
- <omgdi:waypoint x="304.0" y="142.0"></omgdi:waypoint>
- <omgdi:waypoint x="322.0" y="164.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
- <omgdi:waypoint x="465.0" y="164.0"></omgdi:waypoint>
- <omgdi:waypoint x="322.0" y="164.0"></omgdi:waypoint>
- <bpmndi:BPMNLabel>
- <omgdc:Bounds height="14.0" width="83.0" x="452.0" y="144.0"></omgdc:Bounds>
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
- <omgdi:waypoint x="485.0" y="184.0"></omgdi:waypoint>
- <omgdi:waypoint x="485.0" y="220.0"></omgdi:waypoint>
- <bpmndi:BPMNLabel>
- <omgdc:Bounds height="42.0" width="100.0" x="494.0" y="163.0"></omgdc:Bounds>
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
- <omgdi:waypoint x="420.0" y="247.0"></omgdi:waypoint>
- <omgdi:waypoint x="304.0" y="248.0"></omgdi:waypoint>
- <omgdi:waypoint x="304.0" y="182.0"></omgdi:waypoint>
- </bpmndi:BPMNEdge>
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
-</definitions>
\ No newline at end of file