diff options
2 files changed, 24 insertions, 14 deletions
diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/composition/custom-properties-provider/provider/camunda/parts/implementation/InputOutputHelper.js b/workflow-designer-ui/src/main/frontend/src/features/version/composition/custom-properties-provider/provider/camunda/parts/implementation/InputOutputHelper.js index e3a79d4c..cb4745e3 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/version/composition/custom-properties-provider/provider/camunda/parts/implementation/InputOutputHelper.js +++ b/workflow-designer-ui/src/main/frontend/src/features/version/composition/custom-properties-provider/provider/camunda/parts/implementation/InputOutputHelper.js @@ -161,4 +161,16 @@ InputOutputHelper.isCreateDeleteSupported = function(element) { ); }; +InputOutputHelper.isWorkflowTargetSupported = function(element, selected) { + const bo = getBusinessObject(element); + return ( + is(bo, 'bpmn:ServiceTask') && is(selected, 'camunda:OutputParameter') + ); +}; + +InputOutputHelper.isWorkflowSourceSupported = function(element, selected) { + const bo = getBusinessObject(element); + return is(bo, 'bpmn:ServiceTask') && is(selected, 'camunda:InputParameter'); +}; + export default InputOutputHelper; diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/composition/custom-properties-provider/provider/camunda/parts/implementation/InputOutputParameter.js b/workflow-designer-ui/src/main/frontend/src/features/version/composition/custom-properties-provider/provider/camunda/parts/implementation/InputOutputParameter.js index faa20fb0..58b3d67e 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/version/composition/custom-properties-provider/provider/camunda/parts/implementation/InputOutputParameter.js +++ b/workflow-designer-ui/src/main/frontend/src/features/version/composition/custom-properties-provider/provider/camunda/parts/implementation/InputOutputParameter.js @@ -452,23 +452,22 @@ export default function(element, bpmnFactory, options, translate, config) { }, set: function(element, values, node) { - var properties = { + const properties = { workflowSource: undefined }; properties.workflowSource = values.workflowSource; - var param = getSelected(element, node); + const param = getSelected(element, node); values.workflowSource = values.workflowSource || undefined; return cmdHelper.updateBusinessObject(element, param, values); }, hidden: function(element, node) { - var bo = getSelected(element, node); - return !( - bo && - bo.$type && - bo.$type === 'camunda:InputParameter' + const selected = getSelected(element, node); + return !inputOutputHelper.isWorkflowSourceSupported( + element, + selected ); } }) @@ -490,23 +489,22 @@ export default function(element, bpmnFactory, options, translate, config) { }, set: function(element, values, node) { - var properties = { + const properties = { workflowTarget: undefined }; properties.workflowTarget = values.workflowTarget; - var param = getSelected(element, node); + const param = getSelected(element, node); values.workflowTarget = values.workflowTarget || undefined; return cmdHelper.updateBusinessObject(element, param, values); }, hidden: function(element, node) { - var bo = getSelected(element, node); - return !( - bo && - bo.$type && - bo.$type === 'camunda:OutputParameter' + const selected = getSelected(element, node); + return !inputOutputHelper.isWorkflowTargetSupported( + element, + selected ); } }) |