Squashed 'bpmn-js-spiffworkflow/' changes from fc46b6fe5..0a9db509a

0a9db509a 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.
313969da1 Add instructions to sub-processes
5f2cb3d50 allow instructions on Call Activities

git-subtree-dir: bpmn-js-spiffworkflow
git-subtree-split: 0a9db509a0e85aa7adecc8301d8fbca9db75ac7c
This commit is contained in:
burnettk 2023-05-29 17:31:39 -04:00
parent fae42d32ba
commit a1c7cecf59
3 changed files with 62 additions and 1 deletions

View File

@ -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';

View File

@ -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)
@ -45,12 +49,23 @@ export default function ExtensionsPropertiesProvider(
'bpmn:EndEvent', 'bpmn:EndEvent',
'bpmn:ScriptTask', 'bpmn:ScriptTask',
'bpmn:IntermediateCatchEvent', 'bpmn:IntermediateCatchEvent',
'bpmn:CallActivity',
'bpmn:SubProcess',
]) ])
) { ) {
groups.push( groups.push(
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)
@ -258,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

View File

@ -70,6 +70,17 @@
} }
] ]
}, },
{
"name": "signalButtonLabel",
"superClass": [ "Element" ],
"properties": [
{
"name": "value",
"isBody": true,
"type": "String"
}
]
},
{ {
"name": "properties", "name": "properties",
"superClass": [ "superClass": [