Draw Choreography Task on the modeler


#1

Hi, I saw that in “bpmn.json” there is a superclass “Choreography”.

To create the element for modeler I have this in BpmnRendere.js file

'bpmn:Choreography': function(parentGfx, element) {
	var task = renderer('bpmn:Choreography')(parentGfx, element);
	var pathData = pathMap.getScaledPath('TASK_TYPE_CHOREOGRAPHY', {
		abspos: {
		  x: 17,
		  y: 15
		}
	});

	/* manual path /**/ drawPath(parentGfx, pathData, {
		strokeWidth: 2, // 0.25
		fill: '#A7A9AC',
		stroke: getStrokeColor(element)
	});

	var pathData2 = pathMap.getScaledPath('TASK_TYPE_CHOREOGRAPHY_2', {
		abspos: {
		  x: 17,
		  y: 15
		}
	});

	/* manual path /**/ drawPath(parentGfx, pathData2, {
		strokeWidth: 2, // 0.25
		fill: getFillColor(element),
		stroke: getStrokeColor(element)
	});

	var pathData3 = pathMap.getScaledPath('TASK_TYPE_CHOREOGRAPHY_3', {
		abspos: {
		  x: 17,
		  y: 15
		}
	});

	/* manual path /**/ drawPath(parentGfx, pathData3, {
		strokeWidth: 2, // 0.25
		fill: getFillColor(element),
		stroke: getStrokeColor(element)
	});
	
	return task;
},

In PaletteProvider.js I have this

'create.choreography': createAction(
  'bpmn:Choreography', 'choreography', 'bpmn-icon-choreography'
),

In this way the modeler give this error:

EventBus.js:369 RangeError: Maximum call stack size exceeded
at bpmn:Choreography (BpmnRenderer.js:851)
at bpmn:Choreography (BpmnRenderer.js:852)
at bpmn:Choreography (BpmnRenderer.js:852)
at bpmn:Choreography (BpmnRenderer.js:852)
at bpmn:Choreography (BpmnRenderer.js:852)
at bpmn:Choreography (BpmnRenderer.js:852)
at bpmn:Choreography (BpmnRenderer.js:852)
at bpmn:Choreography (BpmnRenderer.js:852)
at bpmn:Choreography (BpmnRenderer.js:852)
at bpmn:Choreography (BpmnRenderer.js:852)

I didn’t change anything in “bpmn.js” file. So, how can I solve this issue? There is a way to render ChoreographyTask as defined in “bpmn.json”?


#2

This sets you up for a nice infinite loop (which you’re seeing in the logs).

Try to debug what you’re doing using some developer tools aka F12 in your browser.


#3

Thanks, this is the result
image

Now I can write the choreography task name, but it isn’t showed on the modeler even if it appear in the properties panel.

There is the possibility to write in the model the name of the two participants and the name of the choreography task?


#4

The correography task looks gorgeous :slight_smile:.

There is the possibility to write in the model the name of the two participants and the name of the choreography task?

For adding labels (that’s effectively what you want to do) refer to the BpmnRenderer which does the same.