UNPKG

vmes-flowable

Version:

ceshibao

54 lines (36 loc) 1.44 kB
'use strict'; var is = require('jeeplus-bpmn/lib/util/ModelUtil').is; var assign = require('lodash/assign'); var entryFactory = require('../../../../factory/EntryFactory'), cmdHelper = require('../../../../helper/CmdHelper'); module.exports = function(element, bpmnFactory, options, translate) { var getBusinessObject = options.getBusinessObject, hideResultVariable = options.hideResultVariable, id = options.id || 'resultVariable'; var resultVariableEntry = entryFactory.textField({ id: id, label: translate('Result Variable'), modelProperty: 'resultVariable', get: function(element, node) { var bo = getBusinessObject(element); return { resultVariable: bo.get('flowable:resultVariable') }; }, set: function(element, values, node) { var bo = getBusinessObject(element); var resultVariable = values.resultVariable || undefined; var props = { 'flowable:resultVariable': resultVariable }; if (is(bo, 'flowable:DmnCapable') && !resultVariable) { props = assign({ 'flowable:mapDecisionResult': 'resultList' }, props); } return cmdHelper.updateBusinessObject(element, bo, props); }, hidden: function(element, node) { if (typeof hideResultVariable === 'function') { return hideResultVariable.apply(resultVariableEntry, arguments); } } }); return [ resultVariableEntry ]; };