add an additional spiffworkflow extension for Signal events which, when attached to a user or manual task, will allow you to set a button lable which will be displayed beside a submit button and allow the end user to immediately fire that signal event.
This commit is contained in:
parent
313969da10
commit
0a9db509a0
|
@ -3,7 +3,7 @@ import {
|
||||||
BpmnPropertiesPanelModule,
|
BpmnPropertiesPanelModule,
|
||||||
BpmnPropertiesProviderModule,
|
BpmnPropertiesProviderModule,
|
||||||
} from 'bpmn-js-properties-panel';
|
} 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 spiffworkflow from './spiffworkflow';
|
||||||
import setupFileOperations from './fileOperations';
|
import setupFileOperations from './fileOperations';
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,9 @@ import {
|
||||||
import {OPTION_TYPE, SpiffExtensionSelect} from './SpiffExtensionSelect';
|
import {OPTION_TYPE, SpiffExtensionSelect} from './SpiffExtensionSelect';
|
||||||
import {SpiffExtensionLaunchButton} from './SpiffExtensionLaunchButton';
|
import {SpiffExtensionLaunchButton} from './SpiffExtensionLaunchButton';
|
||||||
import {SpiffExtensionTextArea} from './SpiffExtensionTextArea';
|
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;
|
const LOW_PRIORITY = 500;
|
||||||
|
|
||||||
|
@ -32,6 +35,7 @@ export default function ExtensionsPropertiesProvider(
|
||||||
if (is(element, 'bpmn:UserTask')) {
|
if (is(element, 'bpmn:UserTask')) {
|
||||||
groups.push(createUserGroup(element, translate, moddle, commandStack));
|
groups.push(createUserGroup(element, translate, moddle, commandStack));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is(element, 'bpmn:BusinessRuleTask')) {
|
if (is(element, 'bpmn:BusinessRuleTask')) {
|
||||||
groups.push(
|
groups.push(
|
||||||
createBusinessRuleGroup(element, translate, moddle, commandStack)
|
createBusinessRuleGroup(element, translate, moddle, commandStack)
|
||||||
|
@ -53,6 +57,15 @@ export default function ExtensionsPropertiesProvider(
|
||||||
createUserInstructionsGroup(element, translate, moddle, commandStack)
|
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')) {
|
if (is(element, 'bpmn:ServiceTask')) {
|
||||||
groups.push(
|
groups.push(
|
||||||
createServiceGroup(element, translate, moddle, commandStack)
|
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 =
|
||||||
|
<p style={{maxWidth : "330px"}}> 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.
|
||||||
|
</p>
|
||||||
|
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)
|
* Create a group on the main panel with a text box (for choosing the dmn to connect)
|
||||||
* @param element
|
* @param element
|
||||||
|
|
|
@ -70,6 +70,17 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "signalButtonLabel",
|
||||||
|
"superClass": [ "Element" ],
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"isBody": true,
|
||||||
|
"type": "String"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "properties",
|
"name": "properties",
|
||||||
"superClass": [
|
"superClass": [
|
||||||
|
|
Loading…
Reference in New Issue