From the BPM perspective in Talend Studio, you can design a workflow graphically. This workflow is defined as a sequence of connected steps that will require human or automatic intervention. Each step in the workflow is enabled after the completion of the previous step.
When a given workflow is triggered, all tasks included in it will need to be fulfilled. Any required human intervention will be listed in Talend MDM Web User Interface. A workflow may require a business user or data steward to have constant interaction with master data.
To design a workflow graphically in the BPM perspective, do the following:
In the upper right corner of the Talend Studio main window, click the button to display the [Open Perspective] dialog box.
Select BPMperspective and then click OK to close the dialog box and proceed to the next step.
The BPM perspective is displayed.
On the menu bar, click Diagram and then select New from the contextual list.
A default workflow diagram appears in the graphical perspective.
Click in the workflow to select the workflow pool and then in the General view, click Pool and set a name and a description for the new process.
Draw the steps and transitions in the workflow and assign them either human or automatic intervention.
If needed, you can always click to show or hide the help information.
Add conditions to transitions to manage multiple output choices from a step, that is to say, add the data that will be used by the condition you define for each transition.
Save the workflow.
The workflow is now ready to be deployed or exported from the BPM perspective onto the MDM perspective where it can be included as a step in a process. For more information, see Exporting and importing workflow processes and Deploying a workflow process to MDM server .
You can simplify the process of creating a workflow if you use the workflow wizard. For further information, see Designing a workflow using the workflow wizard.
A workflow example:
Consider an example where one or several business users can change the price of a product and this change needs to be validated by other authorized business users. In order to accomplish this process, you may want to design a Runnable Process and a workflow in Talend Studio. The Runnable Process, directly accessible through Talend MDM Web User Interface, will launch a workflow that will enable one data steward to change the price and another data steward to validate this change.
The workflow below graphically illustrates this example.
Each step name is also used to label the task performed in this step and displayed in the workflow tasks list in Talend MDM Web User Interface. For more information, see Talend MDM Web User Interface User Guide.
In a workflow, it is quite possible that you need to define some variables to be used for the task operations or the conditions you defined for transitions.
You can define as many variables as required for the entire workflow globally or specifically for each task.
To define variables for a specific task, do the following:
Select the specific task for which you want to define variables. In this example, it is Price Request.
In the Data view, click the Local variables tab.
Click the Add... button.
In the [New variable] dialog box that opens, define a name for the new variable, and then select a proper data type for the new variable.
The name of the variable must be a valid Java identifier.
If needed, in the Default value field, define a default value for the new variable.
Click Finish to close the dialog box.
The newly added variable is displayed in the Data description area.
Repeat the procedure above to define a Boolean variable approve with a default value false for the Price Approval task.
In a workflow, it is quite possible that you need to define some operations for a specific task.
To define an operation for a specific task, do the following:
Select a specific task for which you want to define operations. In this example, it is Price Request.
In the Execution view, click the Operations tab.
Click the Add button.
From the Select target field, select an appropriate variable. mdm_context in this example.
Click the Takes value of link to open the [Select operator] dialog box.
Select an operator type from the list.
In this example, select Use a Java method, and then select setValue() from the list of methods.
Click OK to close the dialog box.
For the second field, click the Edit button to open the [Edit expression] dialog box and then edit the condition according to your needs.
In this example, select Script as the expression type, and define a name Set New Price for the expression.
Once you have finished editing the expression, click OK to close the dialog box.
Repeat the procedure above to add operations for other tasks.
You must also set the link conditions in your workflow.
Click the link between Price Approval and Submit New Price to open the General view in the lower part of the BPM perspective.
In the Name field, enter a name for the selected link, Approve in this example.
Use expression or use decision table to set the condition.
In this example, select Use expression, and then click the Edit button to open the [Edit expression] dialog box.
Once the condition is defined, click OK to close the dialog box.
Repeat the procedure above to set other link conditions.
After you finished designing a workflow, in order to be able to trigger such a workflow from the MDM perspective, you must define the following in the BPM perspective:
MDM connectors. For more information, see How to define Talend connectors in the BPM perspective.
Workflow actors. For more information, see How to manage workflow actors in the BPM perspective (task assignment).
Any workflow includes a set of tasks (steps) that follow a certain order to complete the workflow. Usually, these tasks require either automatic or human intervention with master data. A Talend connector must be attached to one or more of the defined tasks in order to establish connectivity between the workflow and master data. Then the steps for adding Talend connectors to tasks that require automatic intervention are the same as for those that require human intervention.
Talend MDM connectors that you can use to retrieve master records from the MDM server include: TalendMDMProcedureSearch, TalendMDMViewSearch and TalendMDMXPathSearch. Talend MDM connectors that you can use to update master records include: TalendMDMContextConnector, TalendMDMConnector and sometimes JobLauncher.
The table below lists possible operations through the available Talend connectors:
launches a Talend Job through a workflow.
creates or updates a record in Talend MDM.
updates master data records in a specific business entity.
launches a stored procedure that does a search on an entity and then retrieves the search results.
searches through an MDM View and retrieves the results.
runs an xpath query and retrieves the results.
The section below gives an example about how to attach to a task the TalendMDMContextConnector that will establish the connection between the workflow and the master data record that needs to be updated.
Prerequisite(s): You have already connected to the MDM server from Talend Studio. At least one workflow exists.
To attach a Talend connector to a task that requires automatic intervention, do the following:
In the BPM perspective, open the workflow and then click the task to which you want to add connectors. The Submit New Price task is selected in this example.
In the Execution view in the lower part of the perspective, click the Connectors out tab to open the corresponding view.