1 import inherits from 'inherits';
3 import ImplementationTypeHelper from 'bpmn-js-properties-panel/lib/helper/ImplementationTypeHelper';
4 import ServiceTaskDelegateProps from 'bpmn-js-properties-panel/lib/provider/camunda/parts/ServiceTaskDelegateProps';
5 import workflowImplementationType from './implementation/WorkflowImplementationType';
6 import workflowActivity from './implementation/WorkflowActivity';
8 implementationType as implementationTypeConst,
10 } from './implementation/implementationConstants';
11 import Delegate from './implementation/Delegate';
12 import ResultVariable from './implementation/ResultVariable';
14 const getImplementationType = element => {
15 let implementationType = ImplementationTypeHelper.getImplementationType(
19 if (!implementationType || implementationType === 'expression') {
20 const bo = getBusinessObject(element);
23 typeof bo.get(implementationTypeConst.ACTIVITY) !== 'undefined'
25 return 'workflowActivity';
30 return implementationType;
33 const hideResultVariable = element => {
34 return getImplementationType(element) !== 'expression';
37 const getBusinessObject = element =>
38 ImplementationTypeHelper.getServiceTaskLikeBusinessObject(element);
40 const isDmnCapable = element => ImplementationTypeHelper.isDmnCapable(element);
42 const isExternalCapable = element =>
43 ImplementationTypeHelper.isExternalCapable(element);
45 const isServiceTaskLike = element =>
46 ImplementationTypeHelper.isServiceTaskLike(element);
48 function WorkflowServiceTaskDelegateProps(
55 ServiceTaskDelegateProps.call(this, group, element, bpmnFactory, translate);
57 if (isServiceTaskLike(getBusinessObject(element))) {
58 group.entries = group.entries.filter(
60 entry.id !== serviceTaskEntries.IMPLEMENTATION &&
61 entry.id !== serviceTaskEntries.DELEGATE &&
62 entry.id !== serviceTaskEntries.RESULT_VARIABLE
65 group.entries = group.entries.concat(
66 workflowImplementationType(
70 getBusinessObject: getBusinessObject,
71 getImplementationType: getImplementationType,
72 hasDmnSupport: isDmnCapable(element),
73 hasExternalSupport: isExternalCapable(
74 getBusinessObject(element)
76 hasServiceTaskLikeSupport: true
81 group.entries = group.entries.concat(
87 getBusinessObject: getBusinessObject,
88 getImplementationType: getImplementationType
94 group.entries = group.entries.concat(
99 getBusinessObject: getBusinessObject,
100 getImplementationType: getImplementationType
106 group.entries = group.entries.concat(
111 getBusinessObject: getBusinessObject,
112 getImplementationType: getImplementationType,
113 hideResultVariable: hideResultVariable
121 inherits(WorkflowServiceTaskDelegateProps, ServiceTaskDelegateProps);
123 export default WorkflowServiceTaskDelegateProps;