added message variable but need to fix setting it and payload w/ burnettk cullerton

This commit is contained in:
jasquat 2022-08-17 12:55:14 -04:00
parent 1de7e33f47
commit 395004c696
9 changed files with 330 additions and 266 deletions

View File

@ -4,7 +4,7 @@ import {
BpmnPropertiesProviderModule,
} from 'bpmn-js-properties-panel';
import FileSaver from 'file-saver';
import diagramXML from '../test/spec/bpmn/collaboration.bpmn';
import diagramXML from '../test/spec/bpmn/simple_collab.bpmn';
import spiffworkflow from './spiffworkflow';
const modelerEl = document.getElementById('modeler');

View File

@ -15,6 +15,14 @@ export function getRoot(element) {
return element;
}
export function isMessageElement(shapeElement) {
return (
is(shapeElement, 'bpmn:SendTask') ||
is(shapeElement, 'bpmn:ReceiveTask') ||
isMessageEvent(shapeElement)
);
}
export function isMessageEvent(shapeElement) {
const { eventDefinitions } = shapeElement.businessObject;
if (eventDefinitions && eventDefinitions[0]) {
@ -23,26 +31,39 @@ export function isMessageEvent(shapeElement) {
return false;
}
export function getMessageRefElement(businessObject) {
if (businessObject.$type === 'bpmn:IntermediateThrowEvent') {
const messageEventDefinition = businessObject.eventDefinitions[0];
export function canReceiveMessage(shapeElement) {
if (is(shapeElement, 'bpmn:ReceiveTask')) {
return true;
}
if (isMessageEvent(shapeElement)) {
return (
is(shapeElement, 'bpmn:StartEvent') || is(shapeElement, 'bpmn:CatchEvent')
);
}
return false;
}
export function getMessageRefElement(shapeElement) {
if (isMessageEvent(shapeElement)) {
const messageEventDefinition =
shapeElement.businessObject.eventDefinitions[0];
if (messageEventDefinition && messageEventDefinition.messageRef) {
return messageEventDefinition.messageRef;
}
} else if (
businessObject.$type === 'bpmn:SendTask' &&
businessObject.messageRef
isMessageElement(shapeElement) &&
shapeElement.businessObject.messageRef
) {
return businessObject.messageRef;
return shapeElement.businessObject.messageRef;
}
return '';
return null;
}
export function findFormalExpressions(businessObject) {
export function findFormalExpressions(shapeElement) {
const formalExpressions = [];
const messageRef = getMessageRefElement(businessObject);
const messageRef = getMessageRefElement(shapeElement);
if (messageRef) {
const root = getRoot(businessObject);
const root = getRoot(shapeElement.businessObject);
if (root.$type === 'bpmn:Definitions') {
for (const childElement of root.rootElements) {
if (childElement.$type === 'bpmn:CorrelationProperty') {
@ -99,7 +120,6 @@ export function findCorrelationKeys(element) {
if (rootElement.$type === 'bpmn:Collaboration') {
const currentKeys = rootElement.correlationKeys;
for (const correlationKey in currentKeys) {
const correlationProperties = [];
const currentCorrelation = rootElement.correlationKeys[correlationKey];
const currentProperty = {};
currentProperty.name = currentCorrelation.name;

View File

@ -16,7 +16,7 @@ export function MessageCorrelationsArray(props) {
const { commandStack } = props;
// const { elementRegistry } = props;
const formalExpressions = findFormalExpressions(element.businessObject);
const formalExpressions = findFormalExpressions(element);
const items = formalExpressions.map((formalExpression) => {
const id = `correlation-${formalExpression.correlationId}`;
const entries = MessageCorrelationGroup({

View File

@ -10,12 +10,11 @@ import {
*/
export function MessagePayload(props) {
const shapeElement = props.element;
const { commandStack } = props;
const debounce = useService('debounceInput');
const getMessagePayloadObject = () => {
const { businessObject } = shapeElement;
const taskMessage = getMessageRefElement(businessObject);
const taskMessage = getMessageRefElement(shapeElement);
const messages = findMessageModdleElements(businessObject);
if (taskMessage) {
for (const message of messages) {
@ -37,28 +36,26 @@ export function MessagePayload(props) {
const getValue = () => {
const messagePayloadObject = getMessagePayloadObject();
if (messagePayloadObject) {
return messagePayloadObject.payload;
return messagePayloadObject.messagePayload;
}
return '';
};
const setValue = (value) => {
const { businessObject } = shapeElement;
let MessagePayloadObject = getMessagePayloadObject();
if (!MessagePayloadObject) {
MessagePayloadObject = businessObject.$model.create(
let messagePayloadObject = getMessagePayloadObject();
if (!messagePayloadObject) {
messagePayloadObject = businessObject.$model.create(
'spiffworkflow:messagePayload'
);
// if (type !== SCRIPT_TYPE.bpmn) {
if (!businessObject.extensionElements) {
businessObject.extensionElements = businessObject.$model.create(
'bpmn:ExtensionElements'
);
}
businessObject.extensionElements.get('values').push(MessagePayloadObject);
// }
businessObject.extensionElements.get('values').push(messagePayloadObject);
}
MessagePayloadObject.payload = value;
messagePayloadObject.messagePayload = value;
};
return (

View File

@ -3,6 +3,7 @@ import { SelectEntry } from '@bpmn-io/properties-panel';
import {
findMessageModdleElements,
getMessageRefElement,
isMessageEvent,
} from '../MessageHelpers';
/**
@ -14,7 +15,8 @@ export function MessageSelect(props) {
const debounce = useService('debounceInput');
const getValue = () => {
const messageRefElement = getMessageRefElement(shapeElement.businessObject);
const messageRefElement = getMessageRefElement(shapeElement);
console.log('messageRefElement', messageRefElement);
if (messageRefElement) {
return messageRefElement.id;
}
@ -27,7 +29,7 @@ export function MessageSelect(props) {
const messages = findMessageModdleElements(shapeElement.businessObject);
for (const message of messages) {
if (message.id === value) {
if (businessObject.$type === 'bpmn:IntermediateThrowEvent') {
if (isMessageEvent(shapeElement)) {
const messageEventDefinition = businessObject.eventDefinitions[0];
messageEventDefinition.messageRef = message;
// call this to update the other elements in the props panel like payload
@ -35,7 +37,10 @@ export function MessageSelect(props) {
element: shapeElement,
moddleElement: businessObject,
});
} else if (businessObject.$type === 'bpmn:SendTask') {
} else if (
businessObject.$type === 'bpmn:ReceiveTask' ||
businessObject.$type === 'bpmn:SendTask'
) {
commandStack.execute('element.updateModdleProperties', {
element: shapeElement,
moddleElement: businessObject,

View File

@ -0,0 +1,76 @@
import { useService } from 'bpmn-js-properties-panel';
import { TextFieldEntry } from '@bpmn-io/properties-panel';
import {
findMessageModdleElements,
getMessageRefElement,
} from '../MessageHelpers';
/**
* Allows the creation, or editing of messageVariable at the bpmn:sendTask level of a BPMN document.
*/
export function MessageVariable(props) {
const shapeElement = props.element;
const debounce = useService('debounceInput');
const getMessageVariableObject = () => {
const { businessObject } = shapeElement;
const taskMessage = getMessageRefElement(shapeElement);
const messages = findMessageModdleElements(businessObject);
if (taskMessage) {
for (const message of messages) {
if (message.id === taskMessage.id) {
const { extensionElements } = message;
if (extensionElements) {
return message.extensionElements
.get('values')
.filter(function getInstanceOfType(e) {
return e.$instanceOf('spiffworkflow:messageVariable');
})[0];
}
}
}
}
return null;
};
const getValue = () => {
const messageVariableObject = getMessageVariableObject();
// console.log('messageVariableObject', messageVariableObject);
if (messageVariableObject) {
return messageVariableObject.messageVariable;
}
return '';
};
const setValue = (value) => {
const { businessObject } = shapeElement;
let messageVariableObject = getMessageVariableObject();
// console.log('messageVariableObject', messageVariableObject);
if (!messageVariableObject) {
messageVariableObject = businessObject.$model.create(
'spiffworkflow:messageVariable'
);
if (!businessObject.extensionElements) {
businessObject.extensionElements = businessObject.$model.create(
'bpmn:ExtensionElements'
);
}
businessObject.extensionElements
.get('values')
.push(messageVariableObject);
}
messageVariableObject.messageVariable = value;
};
return (
<TextFieldEntry
id="messageVariable"
element={shapeElement}
description="The name of the variable where we should store payload."
label="Variable Name"
getValue={getValue}
setValue={setValue}
debounce={debounce}
/>
);
}

View File

@ -3,8 +3,9 @@ import { is } from 'bpmn-js/lib/util/ModelUtil';
import { CorrelationKeysArray } from './CorrelationKeysArray';
import { MessageSelect } from './MessageSelect';
import { MessagePayload } from './MessagePayload';
import { MessageVariable } from './MessageVariable';
import { MessageCorrelationsArray } from './MessageCorrelationsArray';
import { isMessageEvent } from '../MessageHelpers';
import { isMessageElement, canReceiveMessage } from '../MessageHelpers';
const LOW_PRIORITY = 500;
@ -27,9 +28,11 @@ export default function MessagesPropertiesProvider(
elementRegistry
)
);
} else if (is(element, 'bpmn:SendTask') || isMessageEvent(element)) {
} else if (isMessageElement(element)) {
const messageIndex = findEntry(groups, 'message');
groups.splice(messageIndex, 1);
if (messageIndex) {
groups.splice(messageIndex, 1);
}
groups.push(
createMessageGroup(
element,
@ -97,37 +100,52 @@ function createMessageGroup(
commandStack,
elementRegistry
) {
const entries = [
{
id: 'selectMessage',
element,
component: MessageSelect,
isEdited: isTextFieldEntryEdited,
moddle,
commandStack,
},
];
if (canReceiveMessage(element)) {
entries.push({
id: 'messageVariable',
element,
component: MessageVariable,
isEdited: isTextFieldEntryEdited,
moddle,
commandStack,
});
} else {
entries.push({
id: 'messagePayload',
element,
component: MessagePayload,
isEdited: isTextFieldEntryEdited,
moddle,
commandStack,
});
}
entries.push({
id: 'messageCorrelations',
label: translate('Message Correlations'),
component: ListGroup,
...MessageCorrelationsArray({
element,
moddle,
commandStack,
elementRegistry,
}),
});
return {
id: 'messages',
label: translate('Message'),
entries: [
{
id: 'selectMessage',
element,
component: MessageSelect,
isEdited: isTextFieldEntryEdited,
moddle,
commandStack,
},
{
id: 'messagePayload',
element,
component: MessagePayload,
isEdited: isTextFieldEntryEdited,
moddle,
commandStack,
},
{
id: 'messageCorrelations',
label: translate('Message Correlations'),
component: ListGroup,
...MessageCorrelationsArray({
element,
moddle,
commandStack,
elementRegistry,
}),
},
],
entries,
};
}

View File

@ -31,7 +31,18 @@
"superClass": [ "Element" ],
"properties": [
{
"name": "payload",
"name": "messagePayload",
"isBody": true,
"type": "String"
}
]
},
{
"name": "messageVariable",
"superClass": [ "Element" ],
"properties": [
{
"name": "messageVariable",
"isBody": true,
"type": "String"
}

View File

@ -1,209 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" 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:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0qmxumb" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.0.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
<bpmn:collaboration id="my_collaboration">
<bpmn:participant id="buddy" name="Alpha" processRef="process_buddy" />
<bpmn:participant id="Person" name="Beta" processRef="random_person_process" />
<bpmn:messageFlow id="love_letter_flow" name="Message Flow" sourceRef="ActivitySendLetter" targetRef="Event_0ym6ptw" />
<bpmn:messageFlow id="Flow_0zpmqjr" name="Response Flow" sourceRef="Event_0e1t8xh" targetRef="Activity_1dagl6a" />
<bpmn:correlationKey name="invoice">
<bpmn:correlationPropertyRef>invoice_id</bpmn:correlationPropertyRef>
<bpmn:correlationPropertyRef>invoice_date</bpmn:correlationPropertyRef>
<bpmn:correlationPropertyRef>invoice_total</bpmn:correlationPropertyRef>
</bpmn:correlationKey>
<bpmn:correlationKey name="payment">
<bpmn:correlationPropertyRef>payment_id</bpmn:correlationPropertyRef>
<bpmn:correlationPropertyRef>payment_date</bpmn:correlationPropertyRef>
<bpmn:correlationPropertyRef>payment_total</bpmn:correlationPropertyRef>
</bpmn:correlationKey>
</bpmn:collaboration>
<bpmn:message id="send_invoice" name="Send Invoice">
<bpmn:extensionElements>
<spiffworkflow:messagePayload>
{
'invoice': { 'id': my_invoice_id, 'date': my_invoice_date, 'total': my_invoice_total }
}
</spiffworkflow:messagePayload>
</bpmn:extensionElements>
</bpmn:message>
<bpmn:message id="send_payment" name="Send Payment">
<bpmn:extensionElements>
<spiffworkflow:messagePayload>
{ 'payment':
{
'id': my_payment_id,
'date': my_payment_date,
'total': my_payment_total,
'invoice_id': invoice_id,
'invoice_date': invoice_data,
'invoice_amount': invoice_amount,
}
}
</spiffworkflow:messagePayload>
</bpmn:extensionElements>
</bpmn:message>
<bpmn:correlationProperty id="invoice_id" name="Invoice ID">
<bpmn:correlationPropertyRetrievalExpression messageRef="send_invoice">
<bpmn:formalExpression>invoice.invoice_id</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="send_payment">
<bpmn:formalExpression>payment.invoice_id</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:correlationProperty id="invoice_total" name="Invoice Total">
<bpmn:correlationPropertyRetrievalExpression messageRef="send_invoice">
<bpmn:formalExpression>invoice.total</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="send_payment">
<bpmn:formalExpression>payment.invoice_amount</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:correlationProperty id="invoice_date" name="Invoice Date">
<bpmn:correlationPropertyRetrievalExpression messageRef="send_invoice">
<bpmn:formalExpression>invoice.date</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="send_payment">
<bpmn:formalExpression>payment.invoice_date</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:correlationProperty id="payment_id" name="Payment ID">
<bpmn:correlationPropertyRetrievalExpression messageRef="send_payment">
<bpmn:formalExpression>payment.id</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:process id="process_buddy" name="Process Buddy" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_1bl6jeh</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sendTask id="ActivitySendLetter" name="Send Message" messageRef="love_letter">
<bpmn:incoming>Flow_1bl6jeh</bpmn:incoming>
<bpmn:outgoing>Flow_1vgtrb2</bpmn:outgoing>
</bpmn:sendTask>
<bpmn:sequenceFlow id="Flow_1bl6jeh" sourceRef="StartEvent_1" targetRef="ActivitySendLetter" />
<bpmn:sequenceFlow id="Flow_1vgtrb2" sourceRef="ActivitySendLetter" targetRef="Activity_1dagl6a" />
<bpmn:endEvent id="Event_01h5zqa">
<bpmn:incoming>Flow_1f0m6hd</bpmn:incoming>
</bpmn:endEvent>
<bpmn:receiveTask id="Activity_1dagl6a" name="Reveive Response">
<bpmn:incoming>Flow_1vgtrb2</bpmn:incoming>
<bpmn:outgoing>Flow_1ygtaxw</bpmn:outgoing>
</bpmn:receiveTask>
<bpmn:sequenceFlow id="Flow_1f0m6hd" sourceRef="Activity_0ra5uc1" targetRef="Event_01h5zqa" />
<bpmn:sequenceFlow id="Flow_1ygtaxw" sourceRef="Activity_1dagl6a" targetRef="Activity_0ra5uc1" />
<bpmn:manualTask id="Activity_0ra5uc1" name="Display Stuff">
<bpmn:incoming>Flow_1ygtaxw</bpmn:incoming>
<bpmn:outgoing>Flow_1f0m6hd</bpmn:outgoing>
</bpmn:manualTask>
</bpmn:process>
<bpmn:process id="random_person_process" name="Process" isExecutable="true">
<bpmn:startEvent id="Event_0ym6ptw">
<bpmn:outgoing>Flow_1bnzzx2</bpmn:outgoing>
<bpmn:messageEventDefinition id="MessageEventDefinition_05bnll8" />
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_11malws" sourceRef="Event_0e1t8xh" targetRef="Event_0yy6dsf" />
<bpmn:sequenceFlow id="Flow_1bnzzx2" sourceRef="Event_0ym6ptw" targetRef="Activity_15kdfc4" />
<bpmn:sequenceFlow id="Flow_07sdx2y" sourceRef="Activity_15kdfc4" targetRef="Event_0e1t8xh" />
<bpmn:endEvent id="Event_0yy6dsf">
<bpmn:incoming>Flow_11malws</bpmn:incoming>
</bpmn:endEvent>
<bpmn:intermediateThrowEvent id="Event_0e1t8xh">
<bpmn:incoming>Flow_07sdx2y</bpmn:incoming>
<bpmn:outgoing>Flow_11malws</bpmn:outgoing>
<bpmn:messageEventDefinition id="MessageEventDefinition_145e86u" />
</bpmn:intermediateThrowEvent>
<bpmn:scriptTask id="Activity_15kdfc4" name="Do Something">
<bpmn:incoming>Flow_1bnzzx2</bpmn:incoming>
<bpmn:outgoing>Flow_07sdx2y</bpmn:outgoing>
</bpmn:scriptTask>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="my_collaboration">
<bpmndi:BPMNShape id="Participant_12ffz3p_di" bpmnElement="buddy" isHorizontal="true">
<dc:Bounds x="129" y="190" width="889" height="290" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1vgtrb2_di" bpmnElement="Flow_1vgtrb2">
<di:waypoint x="370" y="265" />
<di:waypoint x="510" y="265" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1bl6jeh_di" bpmnElement="Flow_1bl6jeh">
<di:waypoint x="215" y="265" />
<di:waypoint x="270" y="265" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1f0m6hd_di" bpmnElement="Flow_1f0m6hd">
<di:waypoint x="770" y="265" />
<di:waypoint x="882" y="265" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1ygtaxw_di" bpmnElement="Flow_1ygtaxw">
<di:waypoint x="610" y="265" />
<di:waypoint x="670" y="265" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="179" y="247" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0p9c4se_di" bpmnElement="ActivitySendLetter">
<dc:Bounds x="270" y="225" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_01h5zqa_di" bpmnElement="Event_01h5zqa">
<dc:Bounds x="882" y="247" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_021bozj_di" bpmnElement="Activity_1dagl6a">
<dc:Bounds x="510" y="225" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_05js9ii_di" bpmnElement="Activity_0ra5uc1">
<dc:Bounds x="670" y="225" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Participant_0nbivcp_di" bpmnElement="Person" isHorizontal="true">
<dc:Bounds x="129" y="520" width="889" height="160" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_11malws_di" bpmnElement="Flow_11malws">
<di:waypoint x="578" y="620" />
<di:waypoint x="702" y="620" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1bnzzx2_di" bpmnElement="Flow_1bnzzx2">
<di:waypoint x="328" y="620" />
<di:waypoint x="370" y="620" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_07sdx2y_di" bpmnElement="Flow_07sdx2y">
<di:waypoint x="470" y="620" />
<di:waypoint x="542" y="620" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_09ldq03_di" bpmnElement="Event_0ym6ptw">
<dc:Bounds x="292" y="602" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0yy6dsf_di" bpmnElement="Event_0yy6dsf">
<dc:Bounds x="702" y="602" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_12u2p44_di" bpmnElement="Event_0e1t8xh">
<dc:Bounds x="542" y="602" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0itanit_di" bpmnElement="Activity_15kdfc4">
<dc:Bounds x="370" y="580" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_11c08m8_di" bpmnElement="love_letter_flow">
<di:waypoint x="310" y="305" />
<di:waypoint x="310" y="602" />
<bpmndi:BPMNLabel>
<dc:Bounds x="225" y="411" width="71" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0zpmqjr_di" bpmnElement="Flow_0zpmqjr">
<di:waypoint x="560" y="602" />
<di:waypoint x="560" y="305" />
<bpmndi:BPMNLabel>
<dc:Bounds x="582" y="410" width="76" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" 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:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" id="Definitions_96f6665" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.0.0-dev">
<bpmn:collaboration id="Collaboration_0oye1os">
<bpmn:participant id="message_initiator" name="Message Initiator" processRef="message_send_process" />
<bpmn:participant id="message_receiver" name="Message Receiver" processRef="message_receiver_process" />
<bpmn:messageFlow id="message_send_flow" name="Message Send Flow" sourceRef="send_message" targetRef="receive_message" />
<bpmn:messageFlow id="message_response_flow" name="Message Response Flow" sourceRef="respond_to_message" targetRef="receive_message_response" />
<bpmn:correlationKey name="message_correlation_key">
<bpmn:correlationPropertyRef>message_correlation_property</bpmn:correlationPropertyRef>
</bpmn:correlationKey>
</bpmn:collaboration>
<bpmn:correlationProperty id="message_correlation_property" name="Message Correlation Property">
<bpmn:correlationPropertyRetrievalExpression messageRef="message_send">
<bpmn:formalExpression>to</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="message_response">
<bpmn:formalExpression>from.name</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:process id="message_send_process" name="Message Send Process" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_176e02g</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_037vpjk" sourceRef="send_message" targetRef="receive_message_response" />
<bpmn:sequenceFlow id="Flow_1qgz6p0" sourceRef="receive_message_response" targetRef="Event_0kndoyu" />
<bpmn:sequenceFlow id="Flow_176e02g" sourceRef="StartEvent_1" targetRef="send_message" />
<bpmn:sendTask id="send_message" name="Send Message" messageRef="message_send">
<bpmn:incoming>Flow_176e02g</bpmn:incoming>
<bpmn:outgoing>Flow_037vpjk</bpmn:outgoing>
</bpmn:sendTask>
<bpmn:intermediateCatchEvent id="receive_message_response" name="Receive Message Response">
<bpmn:incoming>Flow_037vpjk</bpmn:incoming>
<bpmn:outgoing>Flow_1qgz6p0</bpmn:outgoing>
<bpmn:messageEventDefinition id="MessageEventDefinition_1l3n0zr" messageRef="message_response" />
</bpmn:intermediateCatchEvent>
<bpmn:endEvent id="Event_0kndoyu">
<bpmn:incoming>Flow_1qgz6p0</bpmn:incoming>
</bpmn:endEvent>
</bpmn:process>
<bpmn:message id="message_send" name="Message Send">
<bpmn:extensionElements>
<spiffworkflow:messagePayload>{"to": "the_recipient1" }</spiffworkflow:messagePayload>
</bpmn:extensionElements>
</bpmn:message>
<bpmn:message id="message_response" name="Message Response">
<bpmn:extensionElements>
<spiffworkflow:messagePayload>{"from": {"name": "the_sender"}}</spiffworkflow:messagePayload>
</bpmn:extensionElements>
</bpmn:message>
<bpmn:process id="message_receiver_process" name="Message Receiver Process">
<bpmn:startEvent id="receive_message" name="Receive Message">
<bpmn:outgoing>Flow_0505x87</bpmn:outgoing>
<bpmn:messageEventDefinition id="MessageEventDefinition_0h33u2n" messageRef="message_send" />
</bpmn:startEvent>
<bpmn:endEvent id="Event_0q5otqd">
<bpmn:incoming>Flow_1273yit</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_0505x87" sourceRef="receive_message" targetRef="respond_to_message" />
<bpmn:sequenceFlow id="Flow_1273yit" sourceRef="respond_to_message" targetRef="Event_0q5otqd" />
<bpmn:intermediateThrowEvent id="respond_to_message" name="Respond to Message">
<bpmn:incoming>Flow_0505x87</bpmn:incoming>
<bpmn:outgoing>Flow_1273yit</bpmn:outgoing>
<bpmn:messageEventDefinition id="MessageEventDefinition_0kakria" />
</bpmn:intermediateThrowEvent>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_0oye1os">
<bpmndi:BPMNShape id="Participant_0bjh770_di" bpmnElement="message_initiator" isHorizontal="true">
<dc:Bounds x="120" y="52" width="600" height="250" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_176e02g_di" bpmnElement="Flow_176e02g">
<di:waypoint x="215" y="177" />
<di:waypoint x="280" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1qgz6p0_di" bpmnElement="Flow_1qgz6p0">
<di:waypoint x="478" y="177" />
<di:waypoint x="552" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_037vpjk_di" bpmnElement="Flow_037vpjk">
<di:waypoint x="380" y="177" />
<di:waypoint x="442" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="179" y="159" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0vm33bu_di" bpmnElement="send_message">
<dc:Bounds x="280" y="137" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0yt48xb_di" bpmnElement="receive_message_response">
<dc:Bounds x="442" y="159" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="417" y="129" width="88" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0kndoyu_di" bpmnElement="Event_0kndoyu">
<dc:Bounds x="552" y="159" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Participant_0mr0gg1_di" bpmnElement="message_receiver" isHorizontal="true">
<dc:Bounds x="120" y="350" width="600" height="250" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_0505x87_di" bpmnElement="Flow_0505x87">
<di:waypoint x="248" y="480" />
<di:waypoint x="372" y="480" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1273yit_di" bpmnElement="Flow_1273yit">
<di:waypoint x="408" y="480" />
<di:waypoint x="532" y="480" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_052nccg_di" bpmnElement="receive_message">
<dc:Bounds x="212" y="462" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="187" y="505" width="88" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0q5otqd_di" bpmnElement="Event_0q5otqd">
<dc:Bounds x="532" y="462" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1p63v3w_di" bpmnElement="respond_to_message">
<dc:Bounds x="372" y="462" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="362" y="505" width="57" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1ueajoz_di" bpmnElement="message_send_flow">
<di:waypoint x="300" y="217" />
<di:waypoint x="300" y="340" />
<di:waypoint x="230" y="340" />
<di:waypoint x="230" y="462" />
<bpmndi:BPMNLabel>
<dc:Bounds x="303" y="315" width="74" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1n96n67_di" bpmnElement="message_response_flow">
<di:waypoint x="391" y="462" />
<di:waypoint x="400" y="329" />
<di:waypoint x="460" y="329" />
<di:waypoint x="460" y="195" />
<bpmndi:BPMNLabel>
<dc:Bounds x="462" y="315" width="76" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>