ruoyi-vue-nocode/ruoyi-ui/ruoyi-bpmnjs/resources/properties-panel/helper/ParticipantHelper.js
2022-08-11 16:10:41 +08:00

36 lines
895 B
JavaScript

'use strict';
var is = require('bpmn-js/lib/util/ModelUtil').is,
getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject,
cmdHelper = require('./CmdHelper');
var ParticipantHelper = {};
module.exports = ParticipantHelper;
ParticipantHelper.modifyProcessBusinessObject = function(element, property, values) {
if (!is(element, 'bpmn:Participant')) {
return {};
}
var bo = getBusinessObject(element).get('processRef'),
properties = {};
properties[property] = values[property];
return cmdHelper.updateBusinessObject(element, bo, properties);
};
ParticipantHelper.getProcessBusinessObject = function(element, propertyName) {
if (!is(element, 'bpmn:Participant')) {
return {};
}
var bo = getBusinessObject(element).get('processRef'),
properties = {};
properties[propertyName] = bo.get(propertyName);
return properties;
};