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:
Nico Rehwaldt
2015-03-31 15:02:04 +02:00
parent 32741868e4
commit 0a03e59866
19 changed files with 909 additions and 32 deletions

View File

@ -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;
};