This article includes an example of a configurable graph config item definition that includes a mapping item connection. In other words, the connection is made through mapping item. The mapping item is pointing into X and Y items. The mapping item is created when the connection is made. This connection type is the same type used in the Coverage Mapping Item view.
Example Data
Example Configuration
<Graph> <Options> <Legend/> </Options> <!--Layout name="orthogonalGroup"/--> <!--Layout name="organic"/--> <!--Layout name="balloon"/--> <Layout name="incrementalHierarchical"> <Setting name="layoutOrientation" value="leftToRight"/> <Setting name="nodeToNodeDistance" value="50"/> </Layout> <Mappings> <MappingItem id="1" leftCaption="Transit to the other selected node" rightCaption="Transit from the other selected node" distinctMappingPerPair = "true"> <PathFromMainToMappingContainer select="."/> <MappingItem itemType="SI0050" partType="SP0051"/> <LeftMapping itemType="SI0048" partType="SP0049"/> <RightMapping itemType="SI0048" partType="SP0048"/> </MappingItem> </Mappings> <NodeStyles> <NodeStyle name="State" fillColor="#d2d2ff" fillColor2="#ffffff" borderThickness="1" borderColor="#000000" legendLabel="State"> <Shape> <Rectangle cornerRadius="20"/> </Shape> </NodeStyle> <NodeStyle name="StateMachine" fillColor="#d2d2ff" fillColor2="#ffffff" borderThickness="1" borderColor="#000000" borderType="dash" legendLabel="State machine"> <Shape> <Rectangle cornerRadius="20"/> </Shape> </NodeStyle> <NodeStyle name="Entry" fillColor="#000000" legendLabel="Entry"> <Shape> <Circle diameter="50"/> </Shape> </NodeStyle> <NodeStyle name="Exit" fillColor="#666666" borderThickness="3" borderColor="#000000" borderType="dash" legendLabel="Exit"> <Shape> <Circle diameter="45"/> </Shape> </NodeStyle> <NodeStyle name="Fork" fillColor="#999999" legendLabel="Fork"> <Shape> <Ellipse/> </Shape> </NodeStyle> <NodeStyle name="Join" fillColor="#BBBBBB" legendLabel="Join"> <Shape> <Ellipse/> </Shape> </NodeStyle> <NodeStyle name="Choice" fillColor="#EEEEEE" legendLabel="Choice"> <Shape> <Parallelogram/> </Shape> </NodeStyle> </NodeStyles> <EdgeStyles> <EdgeStyle name="transition" color="#000000" thickness="2" fromArrowType="none" toArrowType="default" legendLabel="Transition"/> </EdgeStyles> <AddPart owner="." partType="SP0050"/> <ForEachPart type="SP0050"> <DefObj> <ApplyItemTemplates/> </DefObj> </ForEachPart> <ForEachPart type="SP0051"> <DefObj> <ApplyItemTemplates/> </DefObj> </ForEachPart> <Template name="StateInternals"> <ForEachPart type="SP0050"> <DefObj> <ApplyItemTemplates/> </DefObj> </ForEachPart> <ForEachPart type="SP0051"> <DefObj> <ApplyItemTemplates/> </DefObj> </ForEachPart> </Template> <ItemTemplate type="SI0042"> <Node style="Choice" caption="Choice"/> </ItemTemplate> <ItemTemplate type="SI0043"> <Node style="Entry" caption="#{?NewLine + NewLine + NewLine + Name}"/> </ItemTemplate> <ItemTemplate type="SI0044"> <Node style="Exit" caption="#{?NewLine + NewLine + NewLine + Name}"/> </ItemTemplate> <ItemTemplate type="SI0045"> <Node style="Fork" caption="Fork"/> </ItemTemplate> <ItemTemplate type="SI0046"> <Node style="Join" caption="Join"/> </ItemTemplate> <ItemTemplate type="SI0048"> <Node style="State"> <AddPart owner="." partType="SP0050"/> <ApplyTemplate name="StateInternals"/> </Node> </ItemTemplate> <ItemTemplate type="SI0049"> <Node style="StateMachine"> <ApplyTemplate name="StateInternals"/> </Node> </ItemTemplate> <ItemTemplate type="SI0050"> <Choose> <When test="Type.SID = 'SI0050'"> <Variable name="transVar" select="." as="Item"/> <Choose> <When test="(/SP0049.Count > 1) and (/SP0048.Count = 1)"> <Variable name="enterToVar" select="/SP0048" as="Items"/> <ForEach select="/SP0049"> </ForEach> </When> <When test="(/SP0048.Count > 1) and (/SP0049.Count = 1)"> <Variable name="exitFromVar" select="/SP0049" as="Items"/> <ForEach select="/SP0048"> </ForEach> </When> <When test="(/SP0048.Count > 1) and (/SP0049.Count > 1)"> <Variable name="exitFromVar" select="/SP0049" as="Items"/> <Variable name="enterToVar" select="/SP0048" as="Items"/> <ForEach select="$exitFromVar"> <Variable name="singleExitVar" select="." as="Item"/> <ForEach select="$enterToVar"> </ForEach> </ForEach> </When> <When test="(/SP0049.Count = 1) and (/SP0048.Count = 1)"> <Edge style="transition" from="/SP0049" to="/SP0048" caption="Name"/> </When> <!--When test="(/SP0049.Count = 0) and (/SP0048.Count = 1)"> <Node style="Entry" caption="Entry"/> <Edge style="transition" from="." to="/SP0048" caption="Name"/> </When> <When test="(/SP0049.Count = 1) and (/SP0048.Count = 0)"> <Node style="Exit" caption="Exit"/> <Edge style="transition" from="/SP0049" to="." caption="Name"/> </When--> </Choose> </When> </Choose> </ItemTemplate> </Graph>
<MappingItem> has three required attributes for the connect functionality.
id identifies the mapping configuration. It is a string value that must be unique within a graph.
leftCaption is the left-side connect option caption text.
rightCaption is the right-side connect option caption text.
An optional distinctMappingPerPair attribute determines if each pair should have a distinct mapping. A "true" value enforces 1:1 relation and will always create a new mapping item for the selected pairs. A "false" value enforces replacement for the existing left mapping item. The default is "false".
<PathFromMainToMappingContainer> specifies the path from main to mapping container, where the mapping items will be added, using a path query. select specifies a path query using the Path Query methods.
<MappingItem> defines the mapping item properties, which are itemType and partType. The itemType attribute is the SID of the mapping item type. The partType attribute is SID of the part from MappingContainer to MappingItem. If the mapping items added directly under the TopItem, without MappingContainer, then the partType is the SID from TopItem to MappingItem.
<LeftMapping> defines the left item properties, which are itemType and partType. The attribute itemType is the SID of the left item type. The attribute partType is SID of the part from MappingItem type to LeftMapping type. The view supports one or more LeftMapping item types.
<RightMapping> defines the left item properties, which are itemType and partType. The attribute itemType is the SID of the right item type. The attribute partType is SID of the part from MappingItem type to RightMapping type. The view supports one or more RightMapping item types.
Example Result
When selecting two or more nodes in the graph to be connected, the configured connection options will be available for the selected nodes. This enables users to work graphically directly in the view.