Pages

Tuesday, January 1, 2008

ADF Taskflow based on human task

A new feature with jdeveloper 11g tp3 release is of course the soa suite 11g with human task but there is also a new taskflow component named "taskflow based on a human task". In this blog I will explain a little bit what a human task is in soa suite 11g and what the new taskflow does.
What is a human task? A human task is the workflow component of soa suite in 10.1.3 but in 11g Oracle added a lot of new features to it, like the many approve / reject options. You can have now single, group, management chain and majority people approval. All kind of notifications, a notification can be an email with an action or email with an office document ( Word or Excel). Expiration and escalation policies and Oracle made it more secure with digital signatures.

Oracle also provide a new webapp with management reports. This webapp can be extended with your own page workflow detail task page. This is done with the new taskflow. You can create and design your own jsf page and so approve or reject a task. Jdeveloper creates a taskflow and a datacontrol based on the human task so you have all the data and controls to customize the jsf page. Here a picture of the standard bpm worklist application
If you click on the task you get a message there is nothing to show. You can only claim and approve without seeing the details. The taskflow provides a custom detail page in the bpm worklist application.
Now you know a little bit more, lets create a human task. You can do it by dragging the human task to the middle of the composite view and drop it here. If you want to use this human task in your bpel then open the bpel process and drag the human task to the right place and select the human task which you created in the composite view.
Here are some options of the human task component.

There are two ways to create a custom detail page. The first way is by selecting the human task in the bpel process and then create a taskflow (auto genereate task form).
The second way is to create a fusion web application and in the viewcontroller project create a taskflow based on a human task. We have to go now to the soa project and select the human task file. JDeveloper creates now a taskflow with a datacontrol. Open the taskflow and create the jsf page. Go to the new datacontrol and drag the task from the output to the just created jsf page. You have to do this a lot of times.

See for more details chapter 26.8 and 31 of the soa suite 11g developer guide. Here some pictures of a custom detail page.
First we claim the task and then we can approve it
And we have a custom detail page on the specific human task.

59 comments:

  1. Dear Edwin!!!
    Hi Again, after understanding the JMS adapter, I have taken up human task as next topic to understand and use. Strangely I have observed that I am not able to create a group hierarchy in Oracle SOA Suite 11g, i.e., clerk, reporting to head clerk, who reports to manager.

    I need to create this hierarchy to draft escalation rules, i.e., in case the clerk does not work on a task for some time, it automatically escalates to his supervisor.

    This is also required in case i want to create a workflow pattern using Managemetn Chain. Do you have any pointers to this?

    ReplyDelete
  2. Hi,

    Can you tell me what you already did and what do you use OID or AD

    thanks

    ReplyDelete
  3. Dear Edwin!!!

    Being the very first of my attempt to explore workflow, I am using the Default Authentication and Authorization to create users. I am not using any Identity Management Servers or Database.

    In Oracle 10g, as I remember we used to have a user-properties.xml file, where we could specify the manager of a user. Whenever the user himself won't claim task within specified period, it would auto escalate to his manager.

    I see that in JDeveloper 11g, I still can specify the expiration policy, but, as I am not able to provide the hierarchy for the user. The task on expiration faults out, saying that -

    Workflow Service Engine callback to SOA mesh failed.
    Callback operation onTaskCompleted from default/Insurance!1.0*d943437a-dc0a-461b-b978-33edc9bb0f79/PolicyApproval to PolicyAwardingProcess/PolicyApproval.TaskService_1 failed with error: null.
    Check the underlying exception. Ensure that the SOA composite is configured correctly.

    at oracle.bpel.services.workflow.fabric.WorkflowServiceEngine.doCallback(WorkflowServiceEngine.java:1233)
    at oracle.bpel.services.workflow.task.impl.WorkflowCallback.postToFabric(WorkflowCallback.java:341)
    at oracle.bpel.services.workflow.task.impl.WorkflowCallback.onTaskComplete(WorkflowCallback.java:107)


    I think that it is because on expiration, when it tries to locate the manager of the user, it finds that user has no manager and hence blacks out.

    Please provide any pointers you know of.

    Thanks,

    Swap

    ReplyDelete
  4. Hi Swap,

    Did you read this http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10226/hwf_config.htm#BABGICCB

    here they use all kind of ldap repositories where the user ( for example inetOrgPerson ) has a manager attribute.

    and I saw in the workflow properties you can change the default class how the manager lookup is done. Maybe you can make your own class which retrieves the manager from a local file.

    let me know if you make some progress.

    ReplyDelete
  5. Dear Edwin!!!

    Thanks for your quick response, I did happen to read through the Admin Guide, and what I found here was how to configure LDAP or other directory services. I think, in default authentication, they only have provision to create flat user structure and not hierarchical structure. Probably, it is a mandate that for hierarchical structure we should use a directory service.

    Thanks for the pointer either ways.You have always been of immense help.

    Thanks again,

    Swap.

    ReplyDelete
  6. Hi Edwin;

    I need to ask about:-
    In SOA 11.1.1.2
    ===> for WorklistApp does SQL Authentication provider supported?

    ===> for WorklistAPp How we can use a hierarchy mapping for the escalation feature in the BPM Worklist with a Read-only SQL Authentication provider?

    Thanks in advance for your help
    Khaled

    ReplyDelete
  7. Hi Khaled

    Every authenticator in wls should work,

    you can check the bpm groups with this

    private String server = "localhost";
    private String wsurl = "http://" + server + ":8001";
    private String secdomain = "jazn.com";

    private BPMIdentityService bpmClient;

    private Logger logger = Logger.getLogger(WorkflowClient.class.getName());


    Map properties =
    new HashMap();

    properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.SOAP_END_POINT_ROOT,wsurl);
    bpmClient = WorkflowServiceClientFactory.getSOAPIdentityServiceClient(secdomain,properties,logger);
    List groups = bpmClient.searchGroups("name", "*");

    for (BPMGroup group : groups) {
    System.out.println("groups: " + group.getDisplayName());
    }

    in Workflow Task Service Properties
    ( em website ) you can change the default method MANAGERS_MANAGER oracle.bpel.services.workflow.assignment.dynamic.patterns.TaskEscalationManagersManager

    or decompile this , to see how this works

    http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/workflow.htm

    thanks

    ReplyDelete
  8. private String server =
    "localhost";
    private String wsurl =
    "http://" + server + ":8001";
    private String secdomain =
    "jazn.com";

    private BPMIdentityService
    bpmClient;

    private Logger logger =
    Logger.getLogger(
    WorkflowClient.class.getName());


    Map<IWorkflowServiceClientConstants
    .CONNECTION_PROPERTY, java.lang.String>
    properties =
    new HashMap<IWorkflowServiceClientConstants
    .CONNECTION_PROPERTY, java.lang.String>();

    properties.put(
    IWorkflowServiceClientConstants
    .CONNECTION_PROPERTY.SOAP_END_POINT_ROOT
    ,wsurl);
    bpmClient = WorkflowServiceClientFactory.
    getSOAPIdentityServiceClient
    (secdomain,properties,logger);
    List<BPMGroup> groups =
    bpmClient.searchGroups("name", "*");

    for (BPMGroup group : groups) {
    System.out.println("groups: "
    + group.getDisplayName());
    }

    ReplyDelete
  9. Hi,

    I solved the manager / hierarchy thing without an LDAP server.

    just check this out.

    http://biemond.blogspot.com/2010/02/soa-11g-identity-service-and-human-task.html

    let me know what you think

    thanks Edwin

    ReplyDelete
  10. Hi, I want to display a view in the the jspx page. The key for this view is passed through the task payload. Thus, I have to access the task payload before I display the page.

    I am using a setCurrentRowWithKeyValue before the view activity, within its bindings I am using an iterator to access to the payload. Though, when I try to see the view in the worklist application, it returns an error related to the task flow finalizer.

    ReplyDelete
  11. Hi,

    can you make a small testcase , a soa project with a simple humantask and a viewcontroller project for thuis human task what you did and I will take a look.

    send it to biemond at gmail dot com

    thanks Edwin

    ReplyDelete
  12. Hi Biemond,

    Regarding hierarchy in the SOA Suite do you know any document for how we can use the hierarchy (manager,reportee) from LDAP such as Active directory?

    Thanks and regards.

    ReplyDelete
  13. Hi,

    I think AD has a manager attribute in LDAP and you can take a look at this http://biemond.blogspot.com/2010/02/soa-11g-identity-service-and-human-task.html

    thanks

    ReplyDelete
  14. Hi Edwin,

    Do you know how can I update "Human task based ADF Taskflow form" when I added 2 more elements to the input payload schema of Human task ?
    Is there anyway i can update the taskform with out re-generating taskflow.

    Thanks
    --sreeny

    ReplyDelete
  15. Hi,

    Do you know how can I update "Human task based ADF Taskflow form" when I added 2 more elements to the input payload schema of Human task ?

    yes you can but you need to be a pro in ADF development.

    Is there anyway i can update the taskform with out re-generating taskflow.

    Don't know if you have subverion but maybe you can generate it again and do some merging.

    thanks

    ReplyDelete
  16. Hi ,

    I want to ask if we have an outcome on the task definition with space (ex. task needs re-approval) ,how can we deal with this in the ADF page .

    ReplyDelete
  17. Hi,

    Do you get an error in ADF with this space in the outcome.

    thanks

    ReplyDelete
  18. yes,
    we got an bibding error

    ReplyDelete
  19. Hi,

    And when you replace space with %20 else make a support call.

    thanks

    ReplyDelete
  20. Hi Edwin,
    Could you please send the information on how to process the output parameters. I am creating payload variables(editable) in humantask and I am not able to see those variables any where. So could you please tell how to access the payload variables in Oracle SOA suite 11g.

    ReplyDelete
  21. Hi,

    Output parameters can be tricky and I remember that it not so easy and usefull. I need to check my examples.

    thanks

    ReplyDelete
  22. Hi,

    For output parameters you need to works from the adf-config.xml and call a bounded TF with pages not with fragments. ( not as a region in a jsf paged )

    When you leave this TF then you return to the jsf page and pass the value to a managed bean or pageFlowScope.

    thanks

    ReplyDelete
  23. Hi Edwin ,

    I am a new bee in the world of SOA , i have a Human task that has jobIDs as input and based on the requirement the Production controller ( Human) need to assign them to different Processes running in different systems by copying the required files to those systems.

    For this is need to communicate to a database ( which has the required data) and decide to which system the job should be allocated .

    Further i need to get the SystemID so that i can copy the files to that system using a FTPAdapter
    which is a different BPEL process.

    Could you please point me to any document which can illustrate " using components in ADF " and how to return a value from a human Task

    Thanks in advance.

    Lakshmi

    ReplyDelete
  24. Hi,

    you have two options which requires you to be a good java or ADF developer.

    the first is make you humantask clients and retrieves the task + payload in java and do your thing.
    like this http://biemond.blogspot.com/2010/02/soa-11g-human-task-client.html

    or you need to generate an ADF TaskFlow based on the humantask , the datacontrol contains your payload and you can make your own adf bc datacontrol which uses this payload as input. Add the data of this new datacontrol also on the page.

    all this requires some skills else it will be frustating.

    thanks

    ReplyDelete
  25. Hi Edwin ,

    Thank you for a quick reply , as per your advice i tried with the ADF TaskFlow based on the humantask , and was able to get the approve request .

    Is it possible for me to get the "Selected Node /server " by the Approver so that i can invoke a seperate BPEL to copy the file to designated folder on the selected Node/Server .

    As of now i am manually updating the Comments field to include the Selected Node , and copying the files to the system based on the comment field .

    1.is it possible to get the Selected Node value as a return value of the human task .
    2. is it possible to update the comment field with the selected value dynamically .

    Thanks in advance
    Vamsi

    ReplyDelete
  26. Hi,

    Yes everything is possible, but you need to know what you are doing and You can retrieve all the TaskDetails.

    maybe the payload is too complex.

    thanks

    ReplyDelete
  27. Dear Edwin,

    Is it possible to login bpm worklist directly from our portal without login into the BPM worklist again to approve/reject the particular task.

    Actually it increase the human invean

    Thanks
    Animesh

    ReplyDelete
  28. Hi,

    Oracle has Single Sign On products which can be used if your portal software supports this, The BPM server will not be the problem.

    thanks

    ReplyDelete
  29. Dear Edwin,

    Dear All,

    I need help with task esclation in SOA11g,

    I am working on SOA 11.1.1.3.0 and weblogic 10.3,

    i have a requirement where in i want a task (that expires after a certain period) to be escalated to the user's manager and at the same time make it available in the user list of task's.

    i am able to escalate the task to the user's manager after it expires but it get's removed from the user's list of task.

    is their a way in which i can do both,i mean escalate the task to the manager as well as make it avaialble for the user rather than removing the task from his list.

    ReplyDelete
  30. Hi,

    maybe you can set the owner to the user, I think the owner can also change it.

    or you can do something with the java escalation class.

    thanks

    ReplyDelete
  31. Hi Edwin, after devloping the task form and if .task file gets changed how to incorporate the new changes in task form again? do we need to create the task form again ?

    ReplyDelete
  32. Hi,

    Yep you are right , you need to do it again. The alternative is that you make your own ADF human task application, on my blog there are example, how to do this

    Thanks

    ReplyDelete
  33. HI Edwin i have created human task form from human task flow and i have added custom code that is invoked on click of APPROVE button now everything works fine but on click of approve window pop up window doesn't get closed what is the outcome that i need to send to call back the client.

    ReplyDelete
    Replies
    1. I also have the same issue. Please let me know how did you resolve the issue.

      Thanks.

      Delete
  34. Hi Edwin,

    Great to see your response for queries. Need your help understanding little bit more. I have a requirement where I have a human task soa application in 11g. Once tasks got initiated I want to access those tasks (to approve/reject etc) in my ADF webapplication with my custom jsf screens(task details page). I do not want to use BPM worklist application as I need my own css, logo etc.

    So my question is do I need to create adf application and place the controls to display task details, write backing bean etc manually or can I use 'adf task flow from human task' option or any other best approach should I follow.

    Your inputs will be highly appreciated.

    Thanks,
    Sri

    ReplyDelete
  35. Hi

    You can make your own adf or java app and talk against the human task ejb or ws.

    in this blogpost I added an adf example in the comments

    http://biemond.blogspot.com/2010/02/soa-11g-human-task-client.html

    also saw something where you only add the bpm task TF in your own app. I think Pino Rom did this and the boys of redwood made a pure java implementation.

    good luck

    ReplyDelete
  36. Thanks for your inputs Edwin. Sure I will check that.

    ReplyDelete
  37. Hi Edwin,

    Need your help to understand my below query.

    One of the Human Task soa samples I have observed that .task file
    contains assignment code

    Example:



    ids:getManager(/task:task/task:payload/ns0:SampleRequestProcessRequest/ns0:UserName)


    So I believe it is assigning the task to the Manager which is getting from LDAP.

    So my query is I want to get this done without using LDAP. What are the options I have, I mean DB etc. Do I need to have my own db table with users heirarchy or any thing else?

    Please suggest.

    Thanks,
    Sri

    ReplyDelete
  38. Hi,

    you need to update the internal users and set the manager like I did in this post http://biemond.blogspot.com/2010/02/soa-11g-identity-service-and-human-task.html

    or use a ldap client and connect to the ldap of wls and set the manager.

    I think you can also override the manager behaviour in humantask, you need to create a java class and configure this in the soa human task properties

    and in this class you can do a call to a database.

    Good luck

    ReplyDelete
  39. echHi,

    I need to populate a jspx with database row values based on payload id value. Once the form is updated, the values from the form variables must be loaded back to payload variables. Is this possible,if so can you please suggest a way to go about it?

    Thanks,

    ReplyDelete
  40. Hi,

    it is possible but you need to know adf and you can't re-generate the adf task flow again, then your changes are lost.

    thanks

    ReplyDelete
  41. While invoking a BPM service programmatically,

    bpmClient = WorkflowServiceClientFactory.getSOAPIdentityServiceClient(secdomain,properties,logger);

    call fails with below error -

    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jrf/PortabilityLayerException
    at oracle.bpel.services.workflow.client.WorkflowServiceClientFactory.getSOAPIdentityServiceClient(WorkflowServiceClientFactory.java:475)
    at opapprovalcomposite.findApprover.getUsers(findApprover.java:203)
    at opapprovalcomposite.findApprover.getUsersinGroup(findApprover.java:218)
    at opapprovalcomposite.findApprover.main(findApprover.java:245)
    Caused by: java.lang.ClassNotFoundException: oracle.jrf.PortabilityLayerException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 4 more

    1. somebody suggested to deploy jrf-api.jar to soa console, so tried that but same error.
    2. Even tried setting-up wf_client_config.xml file but doesn't change the error

    ReplyDelete
    Replies
    1. Hi,

      can you check the logger ( should be java.util.logging.Logger )
      private static Logger logger = Logger.getLogger(xxxx.class.getName());
      and the identity service url ( must be soa server:8001 )

      Map properties =
      new HashMap();

      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.SOAP_END_POINT_ROOT,wsurl);
      bpmClient = WorkflowServiceClientFactory.getSOAPIdentityServiceClient(identityDomain, properties, logger2);

      for more info
      http://biemond.blogspot.com/2011/10/working-with-human-worklist-api-and.html

      thanks

      Delete
  42. Hi Edwin,

    Does the project which contains the 'Taskflow based on HumanTask' have to sit within the same parent application that contains the SOA Project?

    Regards,
    PP

    ReplyDelete
    Replies
    1. Hi,

      Yes you are right because when you deploy the SOA composite , it detects the adf web app and deploy it with it. You can try to do it manually but then you know what to do.

      Delete
  43. As a follow on to the comment above, how does the deployed human task relate to this UI and use it as it's default page. Do I need to configure something further or will the HT automatically pick up my deployed ADF form as it's default?

    Thanks,
    PP

    ReplyDelete
    Replies
    1. Hi,

      Yes indeed , in the composite there is a reference to the adf web app and when you open the task in the work list app, it loads this webapp in the bottom part of the screen.

      Delete
  44. Hi,

    There is HWF - Task details page in a UI project that is used to show task details in BPM worklist. Currently, few new attributes have been added to the Task- Payload used in the SOA composite. The Data Control used in for Task details page is not getting refreshed with new attributes. So not able to add these new payload attributes to the task details page.

    I tried re-generating steps of task-flow so that it would refresh the DC. But it doesn't work in my case.

    Any help appreciated.

    thanks,
    Praveen S K




    ReplyDelete
    Replies
    1. Hi,

      and when you create a new project, do you see those fields and then merge the changes in the old one.

      good luck.

      Delete
  45. Hi Edwin, I have a problem not exactly about your post but related and maybe you can help me.
    It is about the BPM workspace configuration: every time I try to open an activity (global creation or one from the task list) the pop up is trying to open the adf workflow on the url http://myservername:0/workflow... then the browser shows a connection refused error page.
    When I change the port "0" to one from my soa servers the activity page is rendered and fully functional.

    It is a clustered installation with two SOA servers listening on ports 8001 and 8002. If I deploy the same process to my local server (one wl server for Admin, osb, soa and bam) the app works fine.

    So I think the problem is about some configuration from where the workplace is resolving the server port for workflows, but I don't have any idea how to change this behavior.

    I hope you can help me, thanks.

    ReplyDelete
    Replies
    1. Hi,

      did you put a apache server in front of the cluster and set the callback and server address to the apache server.
      like described here http://docs.oracle.com/cd/E14571_01/integration.1111/e10226/soainfra_config.htm

      thanks

      Delete
    2. Thank you very much,

      I found that the frontend configuration for the cluster was not well configured.
      The frontend host name was empty and the workspace was taking the value from the http header that is ok, but the default value for plain and ssl ports is 0, pretty ugly because instead to ignore 0s and take the value from the header, the app is redirecting the request to port 0.

      I configured the right values to these settings and the workspace is working now.

      I'll take a closer look to your suggestion to see if it could suit better to solve the problem

      Thanks again

      Delete
  46. Hi Edwin,
    I have one human tasks in BPEL process in which i am using different stages and with using advance routing rules i am routing my task payload to one stage to another.My payload has Task Status and Branch,after approving the human task from first stage I want to send modified value of the Task Status to the next stage without using worklist API or manual updation but only using the advance routing rules,if it is possible please enlight me with your valuable solutions and advices...
    regards
    ajral

    ReplyDelete
    Replies
    1. Hi,

      a humantask can't be re-used ( after an outcome the task is finished) but you can do a re-initiate task and re-use the information of the first task. you can do this by selecting this operation in the humantask invoke.
      I hope this helps.

      thanks

      Delete
    2. Hi Edwin,

      Not sure if this is off topic here, I have integrated OIM with SOA and in the approval task trying to escalate it to a Role that is created in the OIM if the request is not acted upon for a specified amount of time, I see that I need to implement " IDynamicTaskEscalationFunction" class, but I can only return a single escalation user and not a Role (or Group) -is this viable? If Yes, can you please guide me on this. Also, I need to invoke a custom webservice to update few resources if the approval task is escalated, unable to find a plugin place for the invoking custom webservice in Approval Task, please guide me on the same.

      Thanks

      Delete
  47. Hi Edwin,

    Is it possible to have a task assigned to a group without the "Claim" flow ? My requirement here is, the first person in the group who sees the task gets the task auto-claimed and can directly take an action on the task. I want to avoid the Task "Claim" step.

    Thanks,
    Anu

    ReplyDelete
  48. Hello Edwin, I've followed quite a few of your blogs over time and they've provided clear insight into issues I've encountered in the soa/ofm world. I have a specific issue here I'm hoping you might provide a little help with. I need to attach a file (contents as string) to an email notification sent by a human task kicked off by a bpel process. I've achieved the sending of the email and receiving the outcome however the attachment part eludes me, any help/insight would be greatly appreciated

    ReplyDelete
  49. Hi Edwin, We have a requirement of using JSF as front end with Oracle BPM 11g. Can you please share your thoughts and help me out.How to access JSF page from BPM human task?

    ReplyDelete
  50. Hi Edwin,

    I have created a Human task actionable notification and enabled task from embedding in to it.In the email being send the Actions link appears at the top of the email and then the Task From content appears.

    I want to move the Actions link below the task form content in the email. Is there a way to achieve this?
    Thanks in advance.

    ReplyDelete