fixed getting a send task without a message selected w/ burnettk cullerton

This commit is contained in:
jasquat 2022-08-16 14:30:45 -04:00
parent 9471a6b7bd
commit c6af750012
2 changed files with 25 additions and 18 deletions

View File

@ -11,16 +11,21 @@ export function MessagePayload(props) {
const debounce = useService('debounceInput'); const debounce = useService('debounceInput');
const getMessagePayloadObject = () => { const getMessagePayloadObject = () => {
const businessObject = shapeElement.businessObject; const { businessObject } = shapeElement;
const taskMessage = businessObject.messageRef const taskMessage = businessObject.messageRef;
const messages = findMessageModdleElements(businessObject) const messages = findMessageModdleElements(businessObject);
for (let message of messages) { if (taskMessage) {
if (message.id === taskMessage.id) { for (const message of messages) {
return message.extensionElements if (message.id === taskMessage.id) {
.get('values') const { extensionElements } = message;
.filter(function getInstanceOfType(e) { if (extensionElements) {
return e.$instanceOf('spiffworkflow:messagePayload'); return message.extensionElements
})[0]; .get('values')
.filter(function getInstanceOfType(e) {
return e.$instanceOf('spiffworkflow:messagePayload');
})[0];
}
}
} }
} }
return null; return null;
@ -38,14 +43,16 @@ export function MessagePayload(props) {
const { businessObject } = shapeElement; const { businessObject } = shapeElement;
let MessagePayloadObject = getMessagePayloadObject(); let MessagePayloadObject = getMessagePayloadObject();
if (!MessagePayloadObject) { if (!MessagePayloadObject) {
MessagePayloadObject = businessObject.$model.create('spiffworkflow:messagePayload'); MessagePayloadObject = businessObject.$model.create(
'spiffworkflow:messagePayload'
);
// if (type !== SCRIPT_TYPE.bpmn) { // if (type !== SCRIPT_TYPE.bpmn) {
if (!businessObject.extensionElements) { if (!businessObject.extensionElements) {
businessObject.extensionElements = businessObject.$model.create( businessObject.extensionElements = businessObject.$model.create(
'bpmn:ExtensionElements' 'bpmn:ExtensionElements'
); );
} }
businessObject.extensionElements.get('values').push(MessagePayloadObject); businessObject.extensionElements.get('values').push(MessagePayloadObject);
// } // }
} }
MessagePayloadObject.payload = value; MessagePayloadObject.payload = value;

View File

@ -48,7 +48,7 @@
</bpmn:correlationPropertyRetrievalExpression> </bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty> </bpmn:correlationProperty>
<bpmn:correlationProperty id="singer" name="Singer&#39;s Name"> <bpmn:correlationProperty id="singer_name" name="Singer&#39;s Name">
<bpmn:correlationPropertyRetrievalExpression messageRef="love_letter_response"> <bpmn:correlationPropertyRetrievalExpression messageRef="love_letter_response">
<bpmn:formalExpression>to.name</bpmn:formalExpression> <bpmn:formalExpression>to.name</bpmn:formalExpression>
</bpmn:correlationPropertyRetrievalExpression> </bpmn:correlationPropertyRetrievalExpression>