This extension point is used to customize and extend the BPMN2 Modeler UI as well as the BPMN2 model itself. The following aspects of the editor can be customized; note that some extension points may affect more than one of these aspects:
org.foo.runtime
. Also, the "Foo Target Runtime" defines the target namespace "http://org.foo" for BPMN2 extensions.
After configuring your Workspace Project to use the "Foo Target Runtime" (see the discussion about setting Project Preferences in the User's Guide), it is possible to customize the editor behavior using the following configuration file placed in the Project's ".bpmn2config" folder:
<?xml version="1.0" encoding="UTF-8"?> <runtime id="org.foo.runtime"> <modelExtension id="org.foo.runtime.my.endpoint.extension" uri="http://org.foo/extensions" name="My Webservice EndPoint Extension" type="EndPoint"> <property name="serviceAddress" type="ServiceAddress"> <value> <property name="port" type="EString" /> <property name="binding" type="BindingType:EEnum" value="SOAP HTTP" /> </value> </property> </modelExtension> </runtime>This will decorate the BPMN2
EndPoint
model element with an extension element named "serviceAddress"; that element will have two attributes named "port" and "binding". The resulting EndPoint definition XML might look like this in a bpmn2 file:
<bpmn2:endPoint id="EndPoint_1"> <bpmn2:extensionElements> <extensions:serviceAddress extensions:port="RequestPortType" extensions:binding="HTTP"/> </bpmn2:extensionElements> </bpmn2:endPoint>There are a couple of issues to consider, however, when using configuration files to extend model elemnts:
<!ELEMENT extension (runtime | model | propertyTab* | customTask* | modelExtension* | modelEnablement* | propertyExtension* | featureContainer* | style* | toolPalette* | dataType* | typeLanguage* | expressionLanguage* | serviceImplementation)+>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT runtime EMPTY>
<!ATTLIST runtime
name CDATA #REQUIRED
versions CDATA #IMPLIED
id CDATA #REQUIRED
description CDATA #IMPLIED
class CDATA #REQUIRED>
This element defines a namespace for a specific execution engine, referred to as a "Target Runtime" in this documentation.
org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension
interface for the Target Runtime. This class provides hooks for plug-in lifecycle events, bpmn2 file content type definition, and Runtime-specific target namespace, data type and expression language URIs.<!ELEMENT model EMPTY>
<!ATTLIST model
runtimeId CDATA #IMPLIED
uri CDATA #REQUIRED
resourceFactory CDATA #IMPLIED>
This element specifies an extension model URI that will be used by the Target Runtime plug-in. The model extension may refer to an actual Java implementation, generated the traditional way from an EMF ecore file, or it may just define a namespace URI which will be used to create dynamic classes and features from modelExtension and customClass definitions.
org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl
. The Resource Factory provides Target Runtime-specific hooks for model serialization, proxy resolution, object customization, etc.<!ELEMENT propertyTab EMPTY>
<!ATTLIST propertyTab
id CDATA #REQUIRED
runtimeId CDATA #IMPLIED
label CDATA #IMPLIED
category CDATA #IMPLIED
afterTab CDATA #IMPLIED
indented (true | false)
image CDATA #IMPLIED
replaceTab CDATA #IMPLIED
class CDATA #REQUIRED
features CDATA #IMPLIED
type CDATA #IMPLIED
popup (true | false) >
Defines contributions to the Tabbed Property Sheet Page for a selected BPMN2 element.
org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection
or one of the subclasses from the BPMN2 Modeler.
This may also be set to the string "default" to indicate that the DefaultDetailComposite
implementation will be used. The list of BPMN2 element attributes that will be rendered is then specified with the features attribute.
type="org.eclipse.bpmn2.di.BPMNDiagram org.eclipse.bpmn2.Process"
will activate the property tab whenever the editor canvas is selected, or when a Process element is selected.<!ELEMENT modelExtension (property)+>
<!ATTLIST modelExtension
id CDATA #REQUIRED
runtimeId CDATA #IMPLIED
name CDATA #IMPLIED
description CDATA #IMPLIED
type CDATA #REQUIRED
decorator CDATA #IMPLIED
uri CDATA #IMPLIED>
Defines extension attributes and elements to the BPMN2 model. Any BPMN2 class that derives from "BaseElement" may be extended. The extension features and classes are defined by property elements contained in this modelExtension.
org.eclipse.bpmn2.modeler.core.runtime.IObjectDecorator
interface.
This class can be used to filter extension objects or perform additional intiailzation of the extended model object.<!ELEMENT customTask (property)*>
<!ATTLIST customTask
id CDATA #REQUIRED
runtimeId CDATA #IMPLIED
name CDATA #REQUIRED
description CDATA #IMPLIED
type CDATA #REQUIRED
featureContainer CDATA #REQUIRED
category CDATA #IMPLIED
propertyTabs CDATA #IMPLIED
icon CDATA #IMPLIED
uri CDATA #IMPLIED>
Defines extension attributes and elements for BPMN2 objects. The difference between this and the modelExtension extension element is that that customTask extensions will appear in the Tool Palette.
org.eclipse.bpmn2.modeler.core.features.ICustomElementFeatureContainer
interface.<!ATTLIST property
name CDATA #REQUIRED
value CDATA #IMPLIED
label CDATA #IMPLIED
description CDATA #IMPLIED
ref CDATA #IMPLIED
type CDATA #IMPLIED>
Describes an extension to a BPMN2 model feature. If the feature already exists in an EMF model, then this property element can be used to initialize the feature's value when a new instance of the object is created. If the feature does not exist, it is created using dynamic EMF and extends the existing type, but in a different namespace.
<property name="ioSpecification"> <value> <property name="dataInputs"> <value> <property name="name" value="TaskName" type="EString"/> </value> </property> <property name="dataInputs"> <value> <property name="name" value="Priority" type="EInt"/> </value> </property> <property name="inputSets"> <value> <property name="dataInputRefs" ref="ioSpecification/dataInputs#0"/> <property name="dataInputRefs" ref="ioSpecification/dataInputs#1"/> </value> </property> </value> </property>This is interpreted as follows:
<!ATTLIST value
id CDATA #IMPLIED>
If a property represents a complex element instead of a simple attribute, then a value may be used to define and populate the contents of the property. For example:
<property name="device" type="Device" label="Device Definition"> <value> <property name="type" type="DeviceType:EEnum" value="Phone Tablet Computer Banana" label="Device Type"/> <property name="deviceID" type="DeviceIdentifier" label="Device Details"> <value> <property name="carrier" type="EString" value="" label="Carrier or Service Provider"/> <property name="identifier" type="EInt" value="0" label="Device Identifier"/> </value> </property> </value> </property>This is interpreted as follows:
<!ELEMENT modelEnablement (enable* | disable*)>
<!ATTLIST modelEnablement
id CDATA #REQUIRED
runtimeId CDATA #IMPLIED
profile CDATA #REQUIRED
ref CDATA #IMPLIED
description CDATA #IMPLIED>
This element is used to select which model classes and features are visible in the editor Tool Palette and Property Sheets. This allows the editor to be tailored to a subset of BPMN2 language elements supported by a particular BPMN2 execution engine.
ref="org.eclipse.bpmn2.modeler.runtime.none:default.full"
<!ELEMENT enable EMPTY>
<!ATTLIST enable
object CDATA #REQUIRED
feature CDATA #IMPLIED>
Enables visibility of a specific BPMN2 model class and feature.
<!ELEMENT disable EMPTY>
<!ATTLIST disable
object CDATA #REQUIRED
feature CDATA #IMPLIED>
Disables visibility of a specific BPMN2 model class and feature.
<!ELEMENT propertyExtension EMPTY>
<!ATTLIST propertyExtension
id CDATA #REQUIRED
runtimeId CDATA #IMPLIED
class CDATA #REQUIRED
type CDATA #REQUIRED>
Defines a provider class for model object and feature properties. The provider class allows extension plug-ins to define specialized behaviors and properties for BPMN2 model objects. Property Extensions are typically used to define custom labels for objects and features, convert values to and from different types, manage related objects, etc.
org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter
.org.eclipse.bpmn2.SequenceFlow
. Note that this may also refer to an extension model class if the Target Runtime defines a Java implementation for an extension model.<!ELEMENT featureContainer EMPTY>
<!ATTLIST featureContainer
runtimeId CDATA #IMPLIED
class CDATA #REQUIRED
type CDATA #REQUIRED>
Defines custom behavior for graphical components managed by the editor. FeatureContainers are the providers of lifecycle behavior for all graphical components, including creation of a component, adding a component to a diagram, updating the visual presentation of a component, resizing and moving the component, etc.
org.eclipse.bpmn2.modeler.core.features.IFeatureContainer
interface.org.eclipse.bpmn2.SequenceFlow
<!ELEMENT style EMPTY>
<!ATTLIST style
object CDATA #REQUIRED
shapeForeground CDATA #IMPLIED
shapeBackground CDATA #IMPLIED
labelFont CDATA #IMPLIED
labelForeground CDATA #IMPLIED
labelBackground CDATA #IMPLIED
runtimeId CDATA #IMPLIED
labelPosition CDATA #IMPLIED
routingStyle CDATA #IMPLIED
useDefaultSize (true | false)
defaultHeight CDATA #IMPLIED
defaultWidth CDATA #IMPLIED>
Defines the visual properties of a BPMN2 element, including colors and text fonts.
fontFamilyName,pointSize,italic,bold
where:
<!ELEMENT toolPalette (category*)>
<!ATTLIST toolPalette
id CDATA #REQUIRED
runtimeId CDATA #IMPLIED
profile CDATA #REQUIRED>
Defines a custom Tool Palette for the BPMN2 editor. Tool Palettes are associated with a diagram type and a tool profile name combination. An extension plug-in may define any number of tool profiles and hence, Tool Palettes.
<!ATTLIST category
id CDATA #REQUIRED
name CDATA #IMPLIED
description CDATA #IMPLIED
icon CDATA #IMPLIED
before CDATA #IMPLIED
after CDATA #IMPLIED
fromPalette CDATA #IMPLIED>
Defines a "category" or Tool Palette Drawer. A toolPalette may have any number of category elements.
<!ATTLIST tool
id CDATA #IMPLIED
name CDATA #REQUIRED
description CDATA #IMPLIED
icon CDATA #IMPLIED
object CDATA #IMPLIED
fromPalette CDATA #IMPLIED>
Defines a Tool Palette "tool" which may be used to construct arbitrarily complex sequences of BPMN2 elements. A tool definition may define just a simple object:
<tool name="Create a Task" object="Task[$name='My Simple Task']"/>or it may contain compound object definitions:
<tool name="Two Tasks" description="Two Tasks connected by a SequenceFlow"> <object type="Task" id="task1"/> <object type="Task" id="task2"/> <object type="SequenceFlow[source='task1',target='task2']"/> </tool>See the object extension element for more information.
<!ELEMENT object EMPTY>
<!ATTLIST object
type CDATA #REQUIRED
id CDATA #IMPLIED
optional (true | false) >
Used to create compound objects and templates.
type = TypeList
TypeDefList = TypeDef | TypeDefList ',' TypeDef | PushDef | PushDef PopDef
PushDef = TypeDefList '+' TypeDefList
PopDef = TypeDefList '-' TypeDefList
TypeDef = TYPE | TYPE '[' ParamDefList ']'
ParamDefList = ParamDef | ParamDefList ',' ParamDef
ParamDef = Param '=' Value
Param = '$' FEATURE | VAR
TYPE = any BPMN2 element type, for example "Task", "StartEvent", "SequenceFlow", etc.
FEATURE = the name of a simple data type feature in the BPMN2 element specified by TYPE, for example "name", "implementation", etc.
VAR = a predefined variable used in the construction of the object. This may be one of the following:
x = x-coordinate where the graphical object will be placed, relative to the mouse cursor position
y = y-coordinate where the graphical object will be placed, relative to the mouse cursor position
width = the width of the graphical object
height = the height o the graphical object
source = the ID of another object definition that will be used as the source of a connection
target = the ID of another object definition that will be used as the target of a connection
<object type="Task"/>To assign an initial value to the Task name:
<object type="Task[$name='This is a new Task']"/>To set the initial size and location of the Task (relative to the mouse cursor):
<object type="Task[x=100,y=100,width=200,height=150]"/>Multiple objects can be created by separating them with a comma:
<object type="Task,IntermediateCatchEvent[x=200],Task[x=400]"/>Note that this requires the specification of some location offset to prevent all objects being created at the same location.
<object type="SubProcess+Task"/>will create a SubProcess that contains a single Task. This also works for adding EventDefinitions to Event objects, for example:
<object type="IntermediateCatchEvent+MessageEventDefinition"/>Multiple objects can be constructed in the same container by separating them with a comma:
<object type="SubProcess+Task,IntermediateCatchEvent[x=200],Task[x=400]"/>The Push operator '+' can be used to create additional objects inside the SubProcess. The Pop or '-' operator can be used to restore the target container of subsequent objects (in this case the diagram) like so:
<object type="SubProcess+Task,IntermediateCatchEvent[x=200],Task[x=400]-ExclusiveGateway[x=600]"/>This is interpreted as follows: create a SubProcess in the Diagram, then within that SubProcess create a Task, an IntermediateCatchEvent and another Task, then pop back to the Diagram and create an ExclusiveGateway. The Push/Pop operators can be nested as deeply as required. Creating connections between objects can be done in two ways, the first method uses the previous two objects as source and target:
<tool name="SubProcess Split" description="SubProcess containing two Tasks, and connected to an ExclusiveGateway"> <object type="SubProcess+Task,Task,SequenceFlow-ExclusiveGateway[x=300],SequenceFlow"/> </tool>The second method references previous object definitions by their IDs:
<tool name="Two Tasks" description="Two Tasks connected by a SequenceFlow"> <object type="Task" id="task1"/> <object type="Task" id="task2"/> <object type="SequenceFlow[source='task1',target='task2']"/> </tool>
<!ELEMENT dataType EMPTY>
<!ATTLIST dataType
name CDATA #REQUIRED
class CDATA #REQUIRED>
Defines a Data Type Conversion delegate. This is used to convert a Target Runtime-specific data type to and from String representations.
org.eclipse.bpmn2.modeler.core.DefaultConversionDelegate
.<!ELEMENT typeLanguage (type*)>
<!ATTLIST typeLanguage
runtimeId CDATA #IMPLIED
name CDATA #IMPLIED
uri CDATA #IMPLIED
prefix CDATA #IMPLIED>
This extension element identifies a data type system supported by the Target Runtime. A Target Runtime may define any number of these type systems. The definition element that appears first is used as the default. The Default Target Runtime provides support for XSD Schema and Java types only.
<!ELEMENT expressionLanguage EMPTY>
<!ATTLIST expressionLanguage
runtimeId CDATA #IMPLIED
name CDATA #IMPLIED
uri CDATA #IMPLIED>
This extension element identifies an expression language supported by the Target Runtime. A Target Runtime may define any number of these expression languages. The definition element that appears first is used as the default. The Default Target Runtime provides support for XPath and Java only.
<!ELEMENT serviceImplementation EMPTY>
<!ATTLIST serviceImplementation
runtimeId CDATA #IMPLIED
name CDATA #IMPLIED
uri CDATA #IMPLIED>
This extension element identifies a Service Task implementation supported by the Target Runtime. A Target Runtime may define any number of these implementations. The definition element that appears first is used as the default. The Default Target Runtime provides support for ##WebService and ##Unspecified only.
<!ELEMENT type EMPTY>
<!ATTLIST type
name CDATA #IMPLIED
qname CDATA #IMPLIED>
Specification of a data type supported by the type system.
<extension point="org.eclipse.bpmn2.modeler.runtime"> <!-- the runtime definition --> <runtime name="Sample Business Process Engine" versions="1.0" id="org.eclipse.bpmn2.modeler.examples.dynamic" class="org.eclipse.bpmn2.modeler.examples.dynamic.SampleRuntimeExtension" description="BPMN2 Modeler customizations for a sample runtime engine"> </runtime> <!-- In this example, there is no extension model per-se. This model definition only provides a default namespace URI for extension attributes and elements that are defined in the <modelExtension> and <customTask> elements below. We could have provided a namespace URI in each of those elements, but it's more convenient to do so here. --> <model runtimeId="org.eclipse.bpmn2.modeler.examples.dynamic" uri="http://org.eclipse.bpmn2.modeler.examples.dynamic"> </model> <!-- This <customTask> item extends the BPMN2 TextAnnotation element by adding "name", "evaluate" and "cost" attributes. In addition, the "text" attribute which is a feature of TextAnnotation, will be initialized to "Risk Task" whenever a new instance of this item is created. This item will appear as a tool entry in a tool palette drawer named "Risk & Mitigation". --> <customTask description="This task represents a risk that can occur in the connected Elements." featureContainer="org.eclipse.bpmn2.modeler.examples.dynamic.SampleCustomTaskFeatureContainer" id="org.eclipse.bpmn2.modeler.examples.dynamic.risk" name="Risk Task" category="Risk & Mitigation" icon="risk.png" runtimeId="org.eclipse.bpmn2.modeler.examples.dynamic" type="TextAnnotation"> <property name="name" value="Risk Task" type="EString" /> <property name="text" value="Risk Task" type="EString" /> <property name="evaluate" value="true" type="EBoolean" /> <property name="cost" value="0" type="EInt" /> </customTask> <!-- This <modelExtension> extends BPMN2 Activity elements and all subclasses (Task, UserTask, etc.) Besides the boolean "isDevice", the extension adds a new type called "Device" which contains a "type" attribute (an enum) and a "DeviceIdentifier" type which itself contains two attributes, a String and an Integer. Note that a specialized <propertyTab> is needed to display/edit these extensions (see below). --> <modelExtension id="org.eclipse.bpmn2.modeler.examples.dynamic.activity" uri="http://org.eclipse.bpmn2/default" name="Activity Extension" type="Activity"> <property name="isDevice" type="EBoolean" value="true" label="Is Device" /> <property name="device" type="Device" label="Device Definition"> <value> <property name="type" type="DeviceType:EEnum" value="Phone Tablet Computer Banana" label="Device Type" /> <property name="deviceID" type="DeviceIdentifier" label="Device Details"> <value> <property name="carrier" type="EString" value="" label="Carrier or Service Provider" /> <property name="identifier" type="EInt" value="0" label="Device Identifier" /> </value> </property> </value> </property> </modelExtension> <!-- This <propertyTab> will add a new tab to the Property Sheet called "Activity Extensions". The tab will be visible for all BPMN2 Activity objects and their subclasses (type="org.eclipse.bpmn2.Activity") In this case, the Default property sheet page (class="default") is sufficient to display the attributes and elements, although we could have supplied our own Java class to handle these extensions. --> <propertyTab id="org.eclipse.bpmn2.modeler.examples.dynamic.activity.tab" afterTab="org.eclipse.bpmn2.modeler.description.tab" class="default" features="isDevice device carrier identifier" type="org.eclipse.bpmn2.Activity" label="Activity Extensions"> </propertyTab> </extension>