$(
go.Node,
'Spot',
{
locationObjectName: 'SHAPE',
locationSpot: go.Spot.Center,
toolTip: tooltipTemplate,
contextMenu,
itemTemplate: boundaryEventItemTemplate(),
resizable: true,
resizeObjectName: 'PANEL',
resizeAdornmentTemplate: nodeResizeAdornmentTemplate,
selectionAdorned: true,
selectionAdornmentTemplate: resizableSelectionAdornmentTemplate(),
selectionChanged: onSelectionChanged,
},
// new go.Binding('itemArray', 'boundaryEventArray'),
new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding('deletable', 'isEditable'),
// move a selected part into the Foreground layer, so it isn't obscured by any non-selected parts
new go.Binding('layerName', 'isSelected', s => (s ? 'Foreground' : '')).ofObject(),
$(
go.Panel,
'Auto',
{
name: 'PANEL',
minSize: new go.Size(ActivityNodeWidth, ActivityNodeHeight),
desiredSize: new go.Size(ActivityNodeWidth, ActivityNodeHeight),
},
new go.Binding('desiredSize', 'size', go.Size.parse).makeTwoWay(go.Size.stringify),
$(
go.Panel,
'Spot',
$(
go.Shape,
'RoundedRectangle', // the outside rounded rectangle
{
name: 'SHAPE',
fill: ActivityNodeFill,
stroke: ActivityNodeStroke,
parameter1: 10,
portId: '',
fromLinkable: true,
toLinkable: true,
cursor: 'pointer',
fromSpot: go.Spot.RightSide,
toSpot: go.Spot.LeftSide,
fromMaxLinks: 1,
mouseEnter(e, obj) {
const type = getNodeType(obj.part.data);
if (type === 'serviceTask' || type === 'userTask') {
obj.cursor = obj.part.findLinksOutOf().count === 1 ? 'default' : 'pointer';
}
},
},
new go.Binding('fill', 'color'),
new go.Binding(
'strokeWidth', 'isCall', s => (s ? ActivityNodeStrokeWidthIsCall : ActivityNodeStrokeWidth),
),
),
$(
go.Shape,
'BpmnTaskScript', // will be None, Script, Manual, Service, etc via converter
{
alignment: new go.Spot(0, 0, 5, 5),
alignmentFocus: go.Spot.TopLeft,
width: 14,
height: 14,
stroke: ActivityNodeStroke,
},
new go.Binding('fill', 'taskType', nodeActivityTaskTypeColorConverter),
new go.Binding('figure', 'taskType', nodeActivityTaskTypeConverter),
), // end Task Icon
makeMarkerPanel(false, 1), // sub-process, loop, parallel, sequential, ad doc and compensation markers
), // end main body rectangles spot panel
$(
go.TextBlock, // the center text
{
alignment: go.Spot.Center,
textAlign: 'center',
margin: 5,
editable: true,
font: customFont,
},
new go.Binding('text').makeTwoWay(),
),
), // end Auto Panel
);