mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-26 04:32:44 +08:00
feat(modeling): add participant modeling behavior
This commit adds the ability to model participants from the palette. * Empty diagrams can be used as a start for participant _AND_ process diagram * Process diagrams can be converted to collaboration diagrams by dropping a participant onto them Closes #128
This commit is contained in:
@ -49,6 +49,11 @@ ElementFactory.prototype.create = function(elementType, attrs) {
|
||||
}
|
||||
|
||||
if (!businessObject.di) {
|
||||
if (elementType === 'root') {
|
||||
businessObject.di = this._bpmnFactory.createDiPlane(businessObject, [], {
|
||||
id: businessObject.id + '_di'
|
||||
});
|
||||
} else
|
||||
if (elementType === 'connection') {
|
||||
businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {
|
||||
id: businessObject.id + '_di'
|
||||
@ -111,5 +116,21 @@ ElementFactory.prototype._getDefaultSize = function(semantic) {
|
||||
return { width: 36, height: 36 };
|
||||
}
|
||||
|
||||
if (semantic.$instanceOf('bpmn:Participant')) {
|
||||
return { width: 600, height: 300 };
|
||||
}
|
||||
|
||||
return { width: 100, height: 80 };
|
||||
};
|
||||
|
||||
|
||||
ElementFactory.prototype.createParticipantShape = function(collapsed) {
|
||||
|
||||
var participantShape = this.createShape({ type: 'bpmn:Participant' });
|
||||
|
||||
if (!collapsed) {
|
||||
participantShape.businessObject.processRef = this._bpmnFactory.create('bpmn:Process');
|
||||
}
|
||||
|
||||
return participantShape;
|
||||
};
|
Reference in New Issue
Block a user