diff --git a/app/app.js b/app/app.js index db5e688..2bdc7af 100644 --- a/app/app.js +++ b/app/app.js @@ -3,7 +3,7 @@ import { BpmnPropertiesPanelModule, BpmnPropertiesProviderModule, } from 'bpmn-js-properties-panel'; -import diagramXML from '../test/spec/bpmn/empty_diagram.bpmn'; +import diagramXML from '../test/spec/bpmn/user_form.bpmn'; import spiffworkflow from './spiffworkflow'; import setupFileOperations from './fileOperations'; diff --git a/app/spiffworkflow/extensions/propertiesPanel/ExtensionsPropertiesProvider.js b/app/spiffworkflow/extensions/propertiesPanel/ExtensionsPropertiesProvider.js index b79ba19..c07312c 100644 --- a/app/spiffworkflow/extensions/propertiesPanel/ExtensionsPropertiesProvider.js +++ b/app/spiffworkflow/extensions/propertiesPanel/ExtensionsPropertiesProvider.js @@ -8,6 +8,9 @@ import { import {OPTION_TYPE, SpiffExtensionSelect} from './SpiffExtensionSelect'; import {SpiffExtensionLaunchButton} from './SpiffExtensionLaunchButton'; import {SpiffExtensionTextArea} from './SpiffExtensionTextArea'; +import {SpiffExtensionTextInput} from './SpiffExtensionTextInput'; +import {hasEventDefinition} from 'bpmn-js/lib/util/DiUtil'; +import { PropertyDescription } from 'bpmn-js-properties-panel/'; const LOW_PRIORITY = 500; @@ -32,6 +35,7 @@ export default function ExtensionsPropertiesProvider( if (is(element, 'bpmn:UserTask')) { groups.push(createUserGroup(element, translate, moddle, commandStack)); } + if (is(element, 'bpmn:BusinessRuleTask')) { groups.push( createBusinessRuleGroup(element, translate, moddle, commandStack) @@ -53,6 +57,15 @@ export default function ExtensionsPropertiesProvider( createUserInstructionsGroup(element, translate, moddle, commandStack) ); } + if ( + is(element, 'bpmn:BoundaryEvent') && + hasEventDefinition(element, 'bpmn:SignalEventDefinition') && + isAny(element.businessObject.attachedToRef, ['bpmn:ManualTask', 'bpmn:UserTask']) + ) { + groups.push( + createSignalButtonGroup(element, translate, moddle, commandStack) + ); + } if (is(element, 'bpmn:ServiceTask')) { groups.push( createServiceGroup(element, translate, moddle, commandStack) @@ -260,6 +273,41 @@ function createUserInstructionsGroup ( }; } +/** + * Create a group on the main panel with a text box for specifying a + * a Button Label that is associated with a signal event.) + * @param element + * @param translate + * @param moddle + * @returns entries + */ +function createSignalButtonGroup ( + element, + translate, + moddle, + commandStack +) { + let description = +

If attached to a user/manual task, setting this value will display a button which a user can click to immediately fire this signal event. +

+ return { + id: 'signal_button', + label: translate('Button'), + entries: [ + { + element, + moddle, + commandStack, + component: SpiffExtensionTextInput, + name: 'spiffworkflow:signalButtonLabel', + label: 'Button Label', + description: description + }, + ], + }; +} + + /** * Create a group on the main panel with a text box (for choosing the dmn to connect) * @param element diff --git a/app/spiffworkflow/moddle/spiffworkflow.json b/app/spiffworkflow/moddle/spiffworkflow.json index 764c31c..5987f87 100644 --- a/app/spiffworkflow/moddle/spiffworkflow.json +++ b/app/spiffworkflow/moddle/spiffworkflow.json @@ -70,6 +70,17 @@ } ] }, + { + "name": "signalButtonLabel", + "superClass": [ "Element" ], + "properties": [ + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, { "name": "properties", "superClass": [