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(
71 getBusinessObject: getBusinessObject,
72 getImplementationType: getImplementationType
78 group.entries = group.entries.concat(
83 getBusinessObject: getBusinessObject,
84 getImplementationType: getImplementationType
90 group.entries = group.entries.concat(
95 getBusinessObject: getBusinessObject,
96 getImplementationType: getImplementationType,
97 hideResultVariable: hideResultVariable
102 group.entries = group.entries.concat(
103 workflowImplementationType(
107 getBusinessObject: getBusinessObject,
108 getImplementationType: getImplementationType,
109 hasDmnSupport: isDmnCapable(element),
110 hasExternalSupport: isExternalCapable(
111 getBusinessObject(element)
113 hasServiceTaskLikeSupport: true
121 inherits(WorkflowServiceTaskDelegateProps, ServiceTaskDelegateProps);
123 export default WorkflowServiceTaskDelegateProps;