Using data-driven workflows, you will learn how to design and deploy a data-driven workflow. Specifically, you will start a workflow and add steps such as user tasks.
This tutorial guides data stewards through xDM to create efficient, collaborative data-driven workflows.
What you'll learn
Creating your first workflow
Deploying your first workflow
Enjoy this tutorial!
This tutorial builds off of the CustomerB2C tutorial and adds a workflow to support the creation of new product. Introducing workflows into the data lifecycle can improve interactions between IT and business users, making both more efficient.
By the end of this tutorial, you should also have a clear idea of how to create, deploy, and use data-driven workflows in Semarchy xDM.
Before you start
Before following this tutorial, you must set up Semarchy xDM and follow the Customer B2C demo application tutorial.
The estimated duration of this unit is about 1 hour.
As you have already run the Customer B2C tutorial, you should already have your xDM instance running as well as the appropriate data model.
You should also have already created the DataSteward role that you will use in your first workflow. In this section, you will create another role and a user.
Designing data-driven workflows is a task normally done by an IT team member. As a result, you are going to use the semadmin user who has full administrative privileges to do everything in the xDM platform, including creating and deploying workflows.
Add a Roles and a Users
In this section, you will connect to xDM, add the BusinessUser role, and create a user having this role.
Open your web browser and connect to the URL where xDM is installed.
Log in using the semadmin user credentials.
Open the Configuration application from the Semarchy Welcome Page. This is where users and roles are configured for Semarchy Data Applications.
You have already created the Data Steward role and user as part of the Customer B2C Tutorial. You need to have a Business User role and user to complete this tutorial.
Click Add Role in the bottom right corner to create another role.
Set the Name to BusinessUser, leave all other fields unmodified, and then click CREATE.
You will now create the user for the BusinessUser role you have just created. Select Users in the Configuration navigation drawer.
Click the Add User button.
Enter the following values and then click CREATE:
Assigned Roles: BusinessUser
Select Enable Internal Authentication
Password: businessuser123 or any password of your choice
Import an image library
We will now import images to enhance the user experience through icons etc.
Select Image Libraries in the Configuration navigation drawer.
In the upper right corner, select Import Image Library
Click Add and navigate to the assets.zip file that you downloaded previously. Alternatively, you can drag and drop the file directly into the Import box.
The images are now available in xDM.
In the next section, you will explore the layout and functionality of the Workflow Builder.
Now that you have created the necessary roles and users, you can begin exploring the Workflow Builder, through which designers can create rich data-driven workflows that allow rich data driven workflows.
Navigate to the Workflow Builder
The Workflow Builder is found on the Semarchy Welcome Page.
In the user menu, select All applications.
Click on the Workflow Builder application
The Workflow Builder shows the existing Model Editions. Choose the CustomerB2CDemo 0.0 model to continue.
Create a Workflow Definition
Create a new workflow by clicking on the Create Item button in the bottom right corner of the visual editor.
Name the workflow definition ProductAuthoring and click CREATE
The upper right corner of the panel contains controls related to the appearance and display of the workflow visual editor user interface. Click on the Open Side Panel button. This will open the side panel, where details regarding the workflow and steps being manipulated will appear.
In the side panel, select the entity that you will modify through the workflow. Click the gray Create button in the Entities section of the side panel.
Then select the Product entity from the dropdown menu, and click CREATE.
Save your work by clicking on the Save button.
The building blocks for workflows are steps, linked by transitions to move the workflow from one step to the next. Workflows are initiated through a start event, which defines the overall parameters and metadata of the workflow. Workflows also support automations, such as Submit to publish record data into the hub.
Add Start and End Events
Now we will add start and end events. Click on the Create Step button.
Then choose Start Event from the Type dropdown menu, and name your start event StartWorkflow. Click CREATE.
A start event will appear in the workflow visual editor, and in the side panel. You can click and drag this element around the visual editor. Place it on the left-hand side of the visual editor.
Click on the Create Step button again, and choose the End Event type. Name your end event EndWorkflow. Click CREATE.
The start event and end event are now placed on your workflow diagram. It is normal that there will be an error triangle next to the start event, as we have yet to set its parameters.
Click Save to save your work.
Add a First User Task
Now that you have begun building your workflow, you need to add the tasks that users will carry out. The first task that we will create will allow Business Users to create new products.
Click on Create Step. Select User Task from the Type dropdown menu, and name the step CreateProduct. Click CREATE.
The Create Product user task appears in the workflow visual editor. Click on the step and its parameters appear in the side panel. Click on the Select an Image button near the Icon parameter.
Search for NewProduct. Click the box near the NewProduct.svg icon to select this image, then click SELECT.
The icon in the Create_Product step will be updated to this icon.
Return to the side panel for the Create_Product user task. In the Application property, choose CustomerB2C from the dropdown menu
Scroll down to the Entity property. Choose Product from the dropdown menu.
Then choose Product > AuthorProducts from the Stepper dropdown menu.
Scroll back up along the side panel, and choose BusinessUser from the Assignee Required Role dropdown menu.
Add a Second User Task
Now we will add a second user task to the workflow, where the Data Steward will be able to validate or reject the creation of the new product by the Business User.
Click on the Create Step button in the workflow visual editor. Select User Task from the Type dropdown menu, and name your step ValidateProduct. Click CREATE.
Type ReviewTask in the Icon parameter, then click Select an image.
The ReviewTask.svg icon is automatically searched in the image library. Click on the image icon, then click Select.
In the side panel, choose CustomerB2C from the dropdown menu of the Application parameter, DataSteward from the Assignee Required Role parameter, Product from the Entity parameter, and Product > AuthorProducts from the Stepper parameter.
Add a Submit Automation
In order for any records that are created or changed to become golden records, they need to go through the Certification Process. This is achieved in workflows by adding a Submit Automation.
Click on the Create Step button in the workflow visual editor. Select Automation from the Type dropdown menu, and name the step SubmitChanges. Then click CREATE.
On the diagram, select the Submit Changes automation to modify its properties in the side panel.
Select INTEGRATE_ALL from the Integration Job property.
In the Submit User field, type ‘semadmin'. Make sure to include the single quotes. This simple SemQL expression sets the user that will be recorded in the metadata associated with this record.
In the next step, you will add transitions to link your workflow steps.
Transitions define how records move from one step to another in data-driven workflows. Here, we will show you how to create simple transitions from one step to another.
Transition from Start to First User Task
Now that all the steps to carry out our workflow are in place, we need to set the transitions between them.
Transitions from start events can only be 1:1, which means that a single start event can only go to a single step.
Select the StartWorkflow start event on the diagram. In the Transition parameter, select CreateProduct.
An arrow will appear between the start event and this user task in the workflow visual editor.
Transition Between the User Tasks
Transitions from user tasks are more flexible. To add a first transition from the CreateProduct user task to the ValidateProduct user task:
Select the CreateProduct user task, then click on the plus sign in the Transitions parameter to create a new transition.
Name the transition SubmitForReview, and click CREATE.
The transition appears in the side panel for the CreateProduct user task, where we can further configure it.
Expand the Transitions and SubmitForReview parameters in the CreateProduct sidebar. In the Target Step dropdown menu, choose ValidateProduct.
The SubmitForReview transition now appears between the CreateProduct and ValidateProduct user tasks.
Create Transitions to Return or Submit the Record
We will now create a transition from the ValidateProduct user task to return the record to the business user for any modifications.
Click on the ValidateProduct user task to open its side panel. In the Transitions property, click the Create button (i.e., the plus sign icon), and name this transition Return.
Expand the Transition Parameters of the Return transition, and click the box next to Mandatory Comment. This enhances your workflow by making a comment mandatory when the product is returned to the Business User for modifications.
The arrow representing this transition may overlap with the Submit transition. You can click and drag the arrows to move them around. Double clicking on an arrow creates a bend point that can be further manipulated. You can also click and drag on the labels to move them within the visual editor.
We can now create the second transition from the ValidateProduct task to approve the changes made in the record. Click on the Create button (plus sign icon) in the Transitions parameter of the ValidateProduct user task. Name the transition Approve. Set the Target Step to SubmitChanges.
Create the Transition to the End Step
You can now add the transition from the Submit Automation to the end event. Click on Submit Automation to open its side panel. In the Transition parameter, choose EndWorkflow as the Target Step.
Your workflow should look like this:
Save your work.
You can now click on the Validate button to ensure that there are no issues with your workflow. Validation checks for any errors in SemQL expressions, or any problems with the parameters in your workflow.
You have now created your first workflow!
In order for users to access workflows, triggers need to be added to the applications in which the workflow resides. In this section, you will add an application action to launch your workflow from the navigation drawer. This is done through the Application Builder.
Workflows can also be triggered using entity actions in action sets.
In the user menu, click on All applications.
Open the Application Builder and choose the CustomerB2CDemo.
Navigate to Applications > CustomerB2C > Folders and Actions.
In the CustomerB2C tab, choose Folders and Actions, and then the folder TopActions. Click Add Action.
Set the name of the action to NewProduct, and select Start Workflow from the Action Type dropdown menu. Click Next.
Click on the Edit button in the Workflow field, and choose FirstWorkflow. Likewise, click the Edit button in the Start Event field, and choose StartWorkflow. Click Next.
Check the Custom Label box, set the label to Create New Product, and set the Icon to images://assets/NewProduct.svg, then click Finish.
Save your work.
Return to the Welcome Page
Open the Customer B2C application
Refresh the application.
The NewProduct workflow has now been added to the application, and will be available for Business Users to initiate the creation of a new product!
Now that your workflow has been created and added to the application, you can begin to use it. Just as a reminder, the workflow helps the Business User create a new product. When the product is created, the Data Steward can either approve the product and submit it to the data hub, or send it back to the Business User for correction.
Log out as semadmin, and login as BusinessUser
Open the Customer B2C application
The Create New Product workflow appears in the navigation drawer.
Click on Create New Product. A pop-up appears to enter information about the workflow you are launching. You can change the Description, the Priority, or even add an Attachment to the workflow. For the purpose of this tutorial, we will leave the default values here. Add Creating the DadBike to the Comment box. Click OK to continue.
The stepper for creating a new product opens.
Enter DB6077WD in the ID field.
Enter DadBike in the Product Name field.
Enter The DadBike is a road bike designed for both speed and comfort. Perfect for commuting or long rides with the family. in the Description field.
Leave the Origin field blank.
Set the Sales Unit to 1.
Set the Price field to 850.
Click SUBMIT FOR REVIEW.
Enter DadBike created in the Comment field of the submit pop-up and click OK.
Pop-up windows indicate that the workflow is continuing, and a toaster appears to inform you that the workflow has moved to the next step. There is no interaction needed from the user in these windows or the toaster, and they may pop up and disappear very quickly.
Log out of the businessuser account and login as the datasteward. Re-open the Customer B2C application
The datasteward now has a task in their My Tasks to continue working on the recently created product.
Click on My Tasks. The task will appear in the To Do list. Select the Create Product task, and choose Start from the action menu.
The Create Product Stepper appears, and the datasteward can review the information entered by the businessuser. Click RETURN to send the record back to the businessuser for further information.
Enter Please provide the product origin in the Comment field. Click OK
Pop-up windows will indicate that the workflow is continuing, and a toaster will appear to inform you that the workflow has moved to the next step. Again there is no interaction needed from the user in these windows or the toaster, and they may appear and disappear very quickly.
Log out of the datasteward user, and log in again as the businessuser. Open the Customer B2C application.
The task reappears in the businessuser's My Tasks view. Select the Create Product instance, and select Start from the action menu
Add Holland to the Origin field and click SUBMIT FOR REVIEW.
Enter Origin of the product added in the Comment field and click OK.
Log out again, and log back in as the datasteward user. Open the Customer B2C application
The task reappears in the datasteward's My Tasks. Select the task and click Start from the User Actions menu as above.
Review the information to be sure it is as it should be, and click Approve.
Enter Product approved in the Comment field, and click OK.
Pop-up windows indicate that the workflow is continuing, and a toaster appears to inform you that the workflow has moved to the next step. Again, there is no interaction needed from the user in these windows or the toaster, and they may pop up and disappear very quickly.
Click on Products in the navigation drawer on the left of the screen.
DadBike now appears in the product list.
You have successfully completed this tutorial. In this unit, you were introduced to the Workflow Builder, and learned how to create a simple workflow.
What We Have Covered
Workflow Builder: You saw where and how workflows are created.
Workflow Steps: You used the drag-and-drop interface to add elements to and configure your workflow.
Adding the Workflow to an Application: Once your workflow was complete, you learned how to add it to your application so that it is available to users.
Running a Workflow: You then saw your workflow in action, used by different users and driven by the data being manipulated.