Friday, March 4, 2011

Oracle SOA Suite 11g Flex Fields

Hello All,
Its been a long time since I wrote a blog entry and the rather elaborate pause was due to lots of travelling around. Now I am back and hopefully will blog on latest Oracle FMW techniques that I find interesting or worth sharing.

In this blog, I am going to demonstrate the concept of Flex Fields in Oracle SOA suite 11g. The latest release is 11.1.1.4. Flex Fields are one of the useful features available for a manual/human task activity where the worklistapp user will be able to search for a task available under his 'Tasks' based on a value from the payload. This sounds really interesting because, if the user has huge list of tasks and wants to attend to few tasks on priority (probably based on the PO amount) - Flex Fields comes handy to help.

While defining a human task activity under the SCA composite, add the parameters under the data tab, which has to be made available as flex fields for the user. Define the parameters as simple types (Complex type parameters are not supported as flex fields). We will assign values to these parameters from the payload request in the BPEL process. Under the assignments tab, create a role and assign the task to be handled by the user (eg., weblogic, jcooper) and complete the definition.

Under the BPEL process drag drop the human task activity into the process flow from the SOA constructs panel and map the human task to the activity we defined earlier in the composite. This human task activity will also ask for parameter value definition that we defined as flex field params - Map the variables from payload appropriately to these flex fields.

Now, lets perform the critical piece of assigning the payload variables (that are required as flex fields) to the systemManagedAttributes. This will help in defining the labels for the flex fields in the BPM worklistapp which can be shown to the user for performing a search. Expand the human task activity and in the first assign node, create a copy operation and assign the payload variables to the /task:task/task:systemManagedAttributes/task:textAttribute1. [Important thing to note is Oracle SOA provides set of system attributes in various datatypes such as text, number, date, url etc.. We should be mapping our payload variables to appropriate datatype attributes]. Save and deploy the composite.

We now have to perform a final mapping in the BPM worklistapp in order to define the labels for the flex fields. Login as weblogic user into the BPM worklistapp and click on administration link. Select 'Public Flex Fields' in the left panel and search for the human task for which the flex fields must be defined (Edit Mappings for task link) . This will bring up the map attributes page where we can create labels for the flex fields. These have to be mapped to the systemManagedAttributes [Remember the assign copy operation where we assigned the payload variables to the systemManagedAttributes]. Once done for all flex fields, save and close.

Try creating an instance of the process and when the tasks come into the BPM worklistapp for the user, the user will be able to search the tasks based on the flex field values. Some more sophistication can be achieved by way of advanced search where the labels will appear as search criteria and different logical conditions can be used to perform the search. (For eg. PO Value - greater than - 50000 will show all tasks whose PO value is > 50000).

20 comments:

  1. Hi Sathyam,
    I'm trying to map a Flex Field to a column in the task list for a BPM process using SOA Suite 11.1.1.3.
    I already mapped the payload attribute to a label using the Public Flex Fields section of the Administration menu at the BPM Workspace but I don't know how to choose these fields in order to show them as a column.
    Do you have any advice?? thx

    ReplyDelete
  2. Hi Alfredozn,

    You can achieve this by customizing the worklist application UI for that user. In your BPM worklist application, you will find the "My Views" link where there is a provision to customize the columns (which will show the configured flex fields as well) that should appear on the "My Tasks" view. Let me know if this helped

    ReplyDelete
  3. Hi Sathya,
    we are trying to map data to /taskservice:initiateTask/task:task/task:systemMessageAttributes/task:textAttribute1 in BPEL process. we have built a custom worklist able to load other attributes except flexdata.
    we are using the below api call
    task.getSystemMessageAttributes().getTextAttribute1();
    for the above statement we are getting null value, but could see in wftask table that the TextAttribute1 has the value which is assigned in BPEL process.
    Please help us on this.


    Thanks in Advance.

    Regards,
    Chaitanya

    ReplyDelete
  4. Chaitanya,

    Try using the following method getFlexfieldAttributeValue(java.lang.String attributeLabel) where you will have to pass the flex field attribute label as parameter.

    ReplyDelete
  5. Hi,
    I was able to display the flex field by doig the following

    1)Defined a simple type parameter Say 'Name' in Human Task Data Section

    2) Assigned the value to the simple type field from the payload in the BPEL process.We assiged the payload field 'Builder Name' here

    3) In the worklist logged in as weblogic and i publlic flex filed created a Lable "Client Name" for textattribute1

    4)Now in the worklist app again mapped the 'Name' field to the Label "Client Name"

    5) In any view that we create we can display "Client Name" as the column.

    Now, as you could see that we did not perform the step as u mentioned like
    "... assign the payload variables to the /task:task/task:systemManagedAttributes/task:textAttribute1 "

    and it is working for us...question is when we will need this particular step to perform ..I mean for what functionality . Appreciate y'r comments

    ReplyDelete
  6. Hi Satyam,

    Wats the main difference between Public and Protected flex fields , also can you explain how can we create and map protected flex fields.

    ReplyDelete
    Replies
    1. Arun,

      Public flex fields (now flex fields are called mapped attributes) are dynamic - which means they can be mapped to - dynamically at run-time. Where as protected flex fields have to be mapped only during design-time (in JDeveloper). This means that the public flex fields give you more control as it allows mapping to a different attribute at runtime. You can refer to the "BPM modelling and Implementation guide" for more details;

      The official documentation definition goes like this;

      public - Attributes mapped to specific task components at run time. These mappings can be changed at any time, and must be re-created when a task component is redeployed.

      protected - AMX-specific mappings between a task component and protected flexfield attributes defined at design time. They cannot be changed at run time, and are deployed along with the task component.

      Delete
  7. Hi Satya,

    Thanks Satya for ur quick reply , I have created Protected flex fields from BPM workspace as an administrator , now when i am trying to map this from JDevloper its not populating any attribute in the drop down.Can you tell me why I am not getting any attribute from the drop down to map this

    ReplyDelete
    Replies
    1. What you create through BPM workspace is the attribute label. As mentioned earlier, protected flex fields can be mapped only through JDeveloper. Attributes (pre-defined) can be assigned values from JDeveloper and labels will not show up. I would strongly recommend you to refer to the BPM modelling and implementation guide (Using Approval Management chapter) which has detailed information on this topic.

      Delete
    2. Hi Sathya,

      Thanks for the above information , I have gone through the guide and I have followed the correct step and mapped all label to the task paylod, also In BPM Workspace I have created customized view and added these protected filed as additional columns , however I am not seeing any values under this , when a request is logged in BPM , all the values under this custom columns are appearing as blank.

      Delete
    3. Hi Arun,

      Honestly speaking it is very tough to troubleshoot without looking at the implementation. I don't particularly see an issue with the way you implement and ideally the approach should work. Send me the BPM project if possible and I would try to see if things are fine. Also let me know the BPM version you are on.

      Delete
  8. Hi Sathya,

    The changes worked now, I missed the assignment operation from input payload to SystemMessageAttribute.protectTextAttribute[i] in the bpel flow.Thanks for that.

    Now I could see the values in the customized view under my newly created Labels. I logged in as an Administrator and created a Custom View which is made it has public view.Then I logged in as approver and was able to see the new view created as Admin in the Shared view section , and I can also see new task posted in these views however when I select those task it says Details not available for these tasks.If I select the same task from default Inbox I can see the task details.

    Can you please help me on this.

    ReplyDelete
  9. Hi Sathya

    I have a business requirement .
    To create customized queue using payload.
    I am able map flexfield with my HT payload . Now we have requirement to factory ship these queue with our product is there any way to do so

    ReplyDelete
    Replies
    1. Hi Suyashpavnoji,

      Yes. You need to use the "User Metadata Migration Utility" (refer the BPM user guide) which migrates all the metadata information created on one environment to other envs. You can also refer to the "Moving Human Workflow Data from a Test to a Production Environment" section in the SOA/BPM administrator's guide.

      All the best.

      Delete
  10. Sathya,

    I have a question for you. In our bpm workspace installs, the public flex fields and private flex fields options on the left navigation panel don't show. Do you think there is some configuration that would enable those links in the workspace administration tab.

    ReplyDelete
  11. Hi Sathya,

    I am trying to add a column item amount for same invoice number how to do this...??

    thanks &regards
    Wasia Kulsum.

    ReplyDelete
    Replies
    1. Not sure why this would be any different. You can create as many flex fields as required. In this case, you would just assign the item amount to a numeric flex field mapping.

      Delete
  12. Hi Sathya,

    I need to supply the flexfields value at runtime, and this value must be changed at any time as needed.

    Is it possible?

    Thank you in Advance.

    Gabriel.

    ReplyDelete
    Replies
    1. Gabriel, Flex fields by definition are fields from the payload that can be used to filter/sort tasks. I am not sure what you mean by supplying value at runtime. Their value is always dynamic. Picked up at runtime based on payload.

      Delete
  13. Hi Sathya,

    I am not able to edit my viiew because My Edit Inbox setting is empty. There are no fields in the available column list.
    Please let me know the solution.
    I have also redeoloyed the composite which was causing the issue as per the Oracle document Doc ID 1935932.1

    Thanks,
    Yogita

    ReplyDelete