Data Object in WPF Diagram (SfDiagram)

5 May 20212 minutes to read

A data object represents information flowing through the process, such as data placed into the process, data resulting from the process, data that needs to be collected, or data that must be stored. To define a DataObject, the Type property of the BpmnNodeViewModel should be set to DataObject and the DataObjectType property defines whether the data is an input or output.
You can indicate the collection of data object by setting the IsCollectiveData property to true.

<!--Initialize the SfDiagram-->
<syncfusion:SfDiagram x:Name="diagram">
    <!--Initialize the Node-->
    <syncfusion:SfDiagram.Nodes>
        <!--Initialize the Node Collection-->
        <syncfusion:NodeCollection>
            <!--Initialize the BpmnNodeViewModel-->
            <syncfusion:BpmnNodeViewModel UnitHeight="70" UnitWidth="100" OffsetX="100" OffsetY="100" Type="DataObject" DataObjectType="None"  IsCollectiveData="True"> 
            </syncfusion:BpmnNodeViewModel>
        </syncfusion:NodeCollection>
    </syncfusion:SfDiagram.Nodes>
</syncfusion:SfDiagram>
//Initialize the diagram.
SfDiagram diagram = new SfDiagram();

//Initialize the BpmnNodeViewModel.
BpmnNodeViewModel node = new BpmnNodeViewModel()
{
  OffsetX = 100,
  OffsetY = 100,
  UnitHeight = 70,
  UnitWidth = 100,
  Type = BpmnShapeType.DataObject,
  DataObjectType = DataObjectType.None,
  IsCollectiveData = true,
};

// Add the node into the Node's collection.
(Diagram.Nodes as NodeCollection).Add(node);

Create DataObject

The following table contains various representation of the BPMN data object.

DataObjectType Symbol IsCollectiveData Description
None Collection Data BPMN Shape Collection Data BPMN Shape None of the business process with the signified information collected within a DataObject
Data Input Data Input BPMN Shape Collection Data BPMN Shape Represents the data requirements that the tasks in the business process depend on with the signified information collected within a DataObject
Data Output Data Output BPMN Shape Collection Data BPMN Shape Demonstrates information produced as the result of a business process with the signified information collected within a DataObject