Determining Workflow-Related Data Models

Objective

After completing this lesson, you will be able to determine how essential workflow data models in the Workflow Module enable the creation and management of user collaboration channels 

Workflow: Data Models

With the previous lesson, we introduced ways that the workflow module better establishes collaboration channels for SAP Commerce Cloud users.

From a technical perspective, we now need to understand the building blocks of workflows before we can create and manage them. Let's review the below diagram that shows the workflow and its associated data models within the data structure.

Data Structure – Workflow

This image displays Workflow and its related data models, specifically showing its connection with Cronjob, WorkflowItemAttachment, and WorkflowTemplate.

Consider the following key points from the earlier diagram:

  1. A Workflow is created from a WorkflowTemplate.
  2. The WorkflowTemplate is a subtype of Job and defines the structure of the workflow. It determines how nodes and transitions are connected within the workflow.
  3. The Workflow, as a subtype of CronJob, includes a list of WorkflowItemAttachment. These attachments provide a shared context utilized across the corresponding workflow.

Next, let’s see more details about the WorkflowTemplate.

Data Structure – WorkflowTemplate

This image illustrates the data structures of Workflow and WorkflowAction, derived from WorkflowTemplate and WorkflowActionTemplate.

From the earlier diagram about the WorkflowTemplate, consider these points:

  1. The WorkflowTemplate is associated with:

    1a. A list of Principals (users or user groups) identified as visibleForPrincipals. These Principals manage the WorkflowTemplate and can start/stop workflows based on the corresponding WorkflowActionTemplate.

    1b. A list of WorkflowActionTemplates, known as actions, indicate specific tasks to be performed.

  2. WorkflowActionTemplates are principal components of a WorkflowTemplate. They help define a workflow's structure. Each WorkflowActionTemplate is allocated:

    2a. A principal: Referred to as principalAssigned. This principal is responsbile for executing the action specified by the WorkflowActionTemplate.

    2b. A list of WorkflowDecisionTemplate: Referred to as decisionTemplates. These serve as outbound links from one WorkflowActionTemplate to another.

Finally, let's examine WorkflowAction next, which outlines the specific tasks that need to be executed in workflows.

Data Structure – WorkflowAction in Workflow

This image illustrates the data structures of Workflow and WorkflowAction, derived from WorkflowTemplate and WorkflowActionTemplate.

Each WorkflowAction instance represents a specific task within a Workflow.

  1. The Workflow is generated from a WorkflowTemplate.
  2. Following this, WorkflowAction instances are also generated, according to the related WorkflowActionTemplate.

    2a. Meanwhile, the Principal defined in the WorkflowActionTemplate is then assigned to the WorkflowAction as principalAssigned.

    2b. All WorkflowDecisionTemplate instances in the WorkflowActionTemplate are used to create corresponding WorkflowDecision instances. They're then assigned to the WorkflowAction as decisions.

Now that we've discussed the main data models in the Workflow Module and their relationships, next lessons will focus on how to create and manage WorkflowTemplates and Workflows.

Log in to track your progress & complete quizzes