Powered By Blogger

Sunday, June 17, 2012

Oracle 11g Human Workflow Mapped Attributes


Oracle BPM Worklist included a feature known as flex fields. Starting with Release 11g R1 (11.1.1.4), flex fields are now known as mapped attributes.

These attributes are used to display application /use-case specific data in workflow task list page.Indeed these attributes are stored as dehydration store data bases columns.

Steps to create mapped attributes.
1.       Declare and Populate data to task payload parameter attributes
2.       Specify a label for the mapped attribute.
3.       Map the payload attribute containing the data to the label.

1.Declare and Populate data to task payload attribute

  • Open Human task meta data (.task) file
  • Go to Data area
  • Add a parameter which is of standard simple XML type
  • Assign  required value to it in the process flow. 
  • After completing remaining task meta data configuration, deploy to server 

Below screen-1 shows a simple XML string task parameter-'mapAttr' being added to task


  Above assigned value is going to be displayed in task list  with the label we will provide now

2.Specifying a label for the mapped attribute 

  •        Login to Work list application
  •        Click on Administration
Note: The user who login and performs mapping attributes must have one of below application roles


BPMWorkflowCustomize: Grant this role to business users who must perform mapped attributes (formally flex field) mapping to public mapped attributes. This role is also granted the workflow.mapping.publicFlexField permission.
BPMWorkflowAdmin: Grant this role to users who must perform any workflow administrative action. This includes actions such as searching and acting on any task in the system, creating and modifying user and group rules, performing application customization, and so on. This role is granted the BPMWorkflowCustomize role
  •        Click on either Public Flex Fields or Protected Flex  Fields  Mapping  and select  Browse all mappings radio button


      Public flex field - Attributes mapped to specific task at run time. These mappings can be changed at any time, and must be re-created when a task component is redeployed.
       Protected flex field - mappings between a task component and protected flex field attributes defined at design time from Jdev. They cannot be changed at run time, and are deployed along with the task component
  •        Click Add icon to create labels for required mapped attributes
 Below screen-2 shows a label- 'SPANumber' of type TextAttribute being created
Note: A given mapped attribute may have multiple labels associated with it. This attribute label is what is displayed to users when displaying lists of attributes for a specific task in Oracle BPM Worklist. You can use each label associated with same mapped attribute in different tasks for different purposes from different SOA applications.

3.Map the payload parameter attribute containing the data to the label

3.1 For Public flex field label:

  In this step we create mapping between task payload parameter defined in step-1 and the attribute labels created in step-2

  For example, the payload field customerIdentifier can be mapped to the attribute label SPANumber. Different task types can share the same attribute label. This allows payload attributes from different task types that have the same semantic meaning to be mapped to the same attribute label
  • .       Go to Administration page
  • .       Select Edit mappings by task type radio button. Please note that this option is enabled only for Public Flex Fields. If it is Protected Flex Fields then we should do it from Jdeveloper.
  • .       Select required human task then click ok
  • .       Now  we need to map map payload attributes created in step-1 to label created in step-2

In below screen-3 I have mapped a payload parameter 'mapAttr'  to a label 'SPANumber'
 
3.2 For  Protected Flex Fields label:

  •     Open  human task meta data(.task ) file
  •     Add Mapped attributes. This will connect to SOA server and fetch all defined protected flex attributes(defined in step-2) which are not mapped to this task.
  •     Provide value to chosen attribute. After completing above steps then your Mapped attributes contain your mapping and goes as part of deployment.
 Check screen-1, we have added two mapped attributes for protected flex fields and populated with values.

 Now create  work queue from BPM worklist to display all required custom fields

Restrictions:

1. Only payload fields that are top-level and simple XML types can be mapped. Complex attributes or simple types nested inside a complex attribute cannot be promoted. So  It is important to define the payload for a task in the Human Task Editor, keeping in mind which attributes from the payload may must promoted to a mapped attribute
2. A mapped attribute (and thus a label) can be used only once per task type.
3. Data type conversion is not supported for the number or date data types. For example, you may not map a payload attribute of type string to a label of type number.

Another alternative way is
Couple of mapped attributes are included in the WorkflowTask.xsd file and are available out of box for your use without restrictions.
They are available under task/ customAttributes
1.Map data to be displayed in task lit to CustmAttributes.

below screen shows static value-'Attr1' is mapped to CustomAttributeString1

2.Go to Edit User Preferences from Worklist Views pane
3.Select the required custom attribute from Available columns and move it to Selected columns
4.Click Ok
Now task list page will display custom attributes with mapped data