What is a Business Entity Relation?
BE relations are connections between two differently mapped BE’s.
In this tutorial, you will learn how to configure relations and how to use them in a simple example, so let us get started.
First, you have to create two SharePoint lists with these exact columns, to get a better understanding of relations between BE’s.
Now you have to map each list to a Business entity and then create a relation between those. Create a new BE, by dragging & dropping a Business entity element to the canvas. Rename it (double-click) to “Invoice Items” and right-click and select Field definitions. Navigate to Mappings and click Add.
Type in your credentials and click on Load Lists
. Select “Invoice Items”, then click Next
Now connect your fields to your SharePoint columns, by double-clicking it. Hit Finish and OK.
Create a second BE the exact same way you created the first one. Name it “Invoice”. Connect your fields with the columns of the “Invoice” BE. Hit Finish and OK.
To define a relationship between those two business entities, you have to right-click the canvas Define relations and Add relation. Choose the same entities and keys as shown in the picture. Hit OK twice.
If the relation is not displayed correctly, check for this notification and hit Auto-layout.
Now your model should pretty much look like this.
Save your model and we are ready to get started with our workflow. This is how your workflow should look like in the end.
Navigate to Processes and create a New Model. Click on Edit Workflow Variables and then select Add field. Add the following workflow variable.
Hit OK and then click Define Business Entity. Double-click your BE. Double-click Invoice and tick the Invoice Items checkbox. Hit OK.
Now drag & drop the following elements onto the canvas and connect them. Start, Loop, Assign Value, End.
Configure the Start Element
Right-click the Start element and click on Edit event. Choose External event click on Invoice and hit OK.
Configure the Loop Element
Right-click the Loop element and click Config. Now set it from Parallel to Sequentially. Click Invoice Items and hit OK.
Now hold the <ALT>-key and left-click the Loop element to go into the loop. Delete the Task element and drop a Calculator activity onto the canvas. Do not forget to connect the lines. Rename it to “Calculate sum” so you can get a better feeling of what each element does. Right-click the Calculator activity and click Select business entity fields.
Add the following fields and mark sum as output. (Red arrow) Hit OK.
Right-click the Calculator activity again and click Edit Workflow Bindings. Click on Add text field and then click on the little cube right next to the new text field. Double-click sum, type “+”, double-click Price (€)
Connect your calculation with Input via drag & drop. Also, connect sum with Output. Hit OK.
Click on the (yellow marked) arrow to get out of the loop.
Configure theAssign Value activity
Right-click the Assign Value activity and click Select business entity fields. Double-click the fields and mark I/O as shown in the picture. Hit OK.
Right-click the Assign Value activity again click on Edit Workflow Bindings. Click on the little cube and double-click sum. Select Invoice.Price (€) as Output. Hit OK.
Test the Configuration and Workflow
Navigate to the Publish tab, deploy (Deploy process) your model and press Start Process(F8).
Now decide which Invoice price should be calculated and press Start.
If we take a look at our SharePoint list Invoice we can see that 6.5 was added to the Price (€) column. But is that correct? Let’s take a look at our Invoice Items-list. The articles Y and Z have 102 as their Order ID. Y-price = 2 and Z-price = 4.5. So the total price for this invoice is 6.5.
This shows us that we have configured every element correctly.
Previous | Next