diff --git a/bpmn-js-spiffworkflow/app/spiffworkflow/InputOutput/IoInterceptor.js b/bpmn-js-spiffworkflow/app/spiffworkflow/InputOutput/IoInterceptor.js index 05c9ea94..b7977db8 100644 --- a/bpmn-js-spiffworkflow/app/spiffworkflow/InputOutput/IoInterceptor.js +++ b/bpmn-js-spiffworkflow/app/spiffworkflow/InputOutput/IoInterceptor.js @@ -38,6 +38,7 @@ export default class IoInterceptor extends CommandInterceptor { di.bpmnElement = dataIO; di.id = dataIO.id + 'DI'; bpmnUpdater.updateBounds(context.shape); + if (type == 'bpmn:DataInput') { collectionAdd(ioSpecification.get('dataInputs'), dataIO); } else { @@ -60,6 +61,10 @@ export default class IoInterceptor extends CommandInterceptor { if (context.shape.di.$parent) { collectionRemove(context.shape.di.$parent.planeElement, context.shape.di); } + console.log("inputs/outputs", ioSpec.dataInputs, ioSpec.dataOutputs) + if (ioSpec.dataInputs.length === 0 && ioSpec.dataOutputs.length === 0) { + process.ioSpecification = null; + } } }); @@ -88,13 +93,15 @@ function assureIOSpecificationExists(process, bpmnFactory) { let ioSpecification = process.get('ioSpecification'); if (!ioSpecification) { + let inputSet = bpmnFactory.create('bpmn:InputSet'); + let outputSet = bpmnFactory.create('bpmn:OutputSet'); // Create the BPMN ioSpecification = bpmnFactory.create('bpmn:InputOutputSpecification', { dataInputs: [], - inputSets: [], + inputSets: [inputSet], dataOutputs: [], - outputSets: [] + outputSets: [outputSet], }); ioSpecification.$parent = process; process.ioSpecification = ioSpecification; @@ -102,5 +109,7 @@ function assureIOSpecificationExists(process, bpmnFactory) { return ioSpecification; } + + IoInterceptor.$inject = [ 'eventBus', 'bpmnFactory', 'bpmnUpdater' ]; diff --git a/bpmn-js-spiffworkflow/app/spiffworkflow/messages/propertiesPanel/MessageCorrelationPropertiesArray.js b/bpmn-js-spiffworkflow/app/spiffworkflow/messages/propertiesPanel/MessageCorrelationPropertiesArray.js index bd62c693..68a79379 100644 --- a/bpmn-js-spiffworkflow/app/spiffworkflow/messages/propertiesPanel/MessageCorrelationPropertiesArray.js +++ b/bpmn-js-spiffworkflow/app/spiffworkflow/messages/propertiesPanel/MessageCorrelationPropertiesArray.js @@ -82,7 +82,7 @@ export function MessageCorrelationPropertiesArray(props) { 'bpmn:CorrelationPropertyRetrievalExpression' ); const messageRefElement = getMessageRefElement(element); - const newFormalExpression = moddle.create('bpmn:FormalExpression'); + const newFormalExpression = moddle.create('bpmn:messagePath'); newFormalExpression.body = ''; newRetrievalExpressionElement.messageRef = messageRefElement; diff --git a/bpmn-js-spiffworkflow/test/spec/bpmn/basic_message.bpmn b/bpmn-js-spiffworkflow/test/spec/bpmn/basic_message.bpmn index 08c6145c..3f141643 100644 --- a/bpmn-js-spiffworkflow/test/spec/bpmn/basic_message.bpmn +++ b/bpmn-js-spiffworkflow/test/spec/bpmn/basic_message.bpmn @@ -14,10 +14,10 @@ - to + to - from.name + from.name @@ -68,7 +68,7 @@ - new + new diff --git a/bpmn-js-spiffworkflow/test/spec/bpmn/collaboration.bpmn b/bpmn-js-spiffworkflow/test/spec/bpmn/collaboration.bpmn index fbc941a5..a193fd3a 100644 --- a/bpmn-js-spiffworkflow/test/spec/bpmn/collaboration.bpmn +++ b/bpmn-js-spiffworkflow/test/spec/bpmn/collaboration.bpmn @@ -26,26 +26,26 @@ - lover.instrument + lover.instrument - from.instrument + from.instrument - lover.name + lover.name - from.name + from.name - heartbreaker + heartbreaker - to.name + to.name diff --git a/bpmn-js-spiffworkflow/test/spec/bpmn/simple_collab.bpmn b/bpmn-js-spiffworkflow/test/spec/bpmn/simple_collab.bpmn index c4fb1463..aae67e99 100644 --- a/bpmn-js-spiffworkflow/test/spec/bpmn/simple_collab.bpmn +++ b/bpmn-js-spiffworkflow/test/spec/bpmn/simple_collab.bpmn @@ -46,46 +46,46 @@ - invoice.invoice_id + invoice.invoice_id - payment.invoice_id + payment.invoice_id - invoice.total + invoice.total - payment.invoice_amount + payment.invoice_amount - invoice.date + invoice.date - payment.invoice_date + payment.invoice_date - payment.date + payment.date - payment.total + payment.total - payment.id + payment.id