Dynamic role setting in human task

Hi,
I would like to use the human task activity in a BPEL process setting the role that has to complete the activity dynamically.
I mean, inside the human task editor, there is a section named "Assignment and Routing policy" where I add a participant to the task. There, I have two options: By name (which I have already used) or by expression.
I would like to assign the role from a variable of my process. This is, I invoke the business rules engine, and the result is a role. Then, I want to assign the human task to that role. It this possible? How do I do this?
Thanks in advance,
Zaloa

We do the same. We invoke a service from BPEL before the human workflow activity. This service returns a department (that is also present in our OID) based on some instance data. We assign this role to the human task in the task definition like this:
<routingSlip xmlns="http://xmlns.oracle.com/bpel/workflow/routingSlip">
<globalConfiguration>
<expirationDuration duration="/task:task/task:payload/ns0:humanTaskInformation/ns0:expirationDate"
type="XPATH"/>
</globalConfiguration>
<participants isAdhocRoutingSupported="false">
<participant name="Department">
<resource isGroup="true" type="XPATH">/task:task/task:payload/ns0:humanTaskInformation/ns0:department</resource>
</participant>
</participants>
<notification includeTaskAttachments="false" actionable="false"
secureNotifications="false"/>
</routingSlip>
This works.
As Eric already indicated, you should see some error detail in the audit trail when the human workflow activity "falls through".
Regards, Ronald

Similar Messages

  • Problem in setting dynamic expiration duration from Human Task

    Hi,
    I have a BPEL process, in which the Human task expiration has to be set dynamically..
    In the , I have set the expiration duration with this :-
    <copy>
    <from expression="xp20:format-dateTime(xp20:current-dateTime(),'PT1M')"/>
    <to variable="initiateTaskInput" part="payload"
    query="/taskservice:initiateTask/task:task/task:systemAttributes/task:expirationDuration"/>
    </copy>
    Do not get confused with 'PT1M' .. I want the duration to be 1 minute... Had I used 'PT1M' as a String and assign to the expirationDuration var, it would have caused an error... It needs to be fromatted as a Date..That's y i took this approach ... I am sure this is working fine as I have checked the payload of the task..
    It has a proper duration..
    <initiateTaskInput><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload"><initiateTask xmlns="http://xmlns.oracle.com/bpel/workflow/taskService">
    <task xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <systemAttributes>
    <expirationDuration>PT1M</expirationDuration>
    Now in the Human task definition(.task file), I have set the expiration duration with "By Expression" option in this way..
    <globalConfiguration>
    <owner>oc4jadmin</owner>
    <expirationDuration duration="/task:task/task:systemAttributes/task:expirationDuration"
    type="XPATH"/>
    </globalConfiguration>
    The problem is the task(at runtime) cannot evaluate the expirationDuration from the XPATH..
    I checked with the WF_TASK table in the orabpel schema ...
    When I use a static duration EXPIRATIONDURATION cloumn gets assigned properly (ie PT1M).. But when i take the XPATH approach, it translates to PT0S.
    Can someone look into this please ?
    Struggling with this for quite sometime...
    saptarishi

    If the Human Task shows status complete, then it's possible that there was an error in the output data association in the process. In EM do you see a fault on the output for the Human Task activity, or if PS4FP the process will go to suspended state if the data association fails.

  • Dynamic participant block in Human task flow

    Hi All,
    I am working on human task flow and got stopped on below use case.
    I have two participant block let say A and B. I want to assign participant A depends on flat inside task flow parameter. If Flag is Yes, then it should assign to A and on approval of A it should complete the task flow. But if Flag is NO, then it should first assign to B, on approval from B, it should again assign to A and after that it should complete the task flow.
    I tried to use dynamic role assignment but there i am not able to define above use case. Dynamic rule is saying you can assign A or B depends on some rule(task flow parameter) but my requirement is little different.
    If Flag is Yes,
    - assign to A -> on approval -> complete the task flow.
    If Flag is No
    - Assign to B -> on approval from B -> assign to A -> on approval from A -> complete the task flow.
    I want to build this logic inside single human task flow.
    Please help.
    -Sunil

    Hi Zaloa,
    Can you pls try this.This should work.
    1. Go to Edit Task Definition page and add a Parameter of type string(default).
    2. Now come to the human task dialog( the one you get on double clicking the human task activity) and add a value to the parametr you just added(string)using the search light .This value should be the variable containing the value of the asssigne which you want to add dynamically.
    3.Now again go to the Edit Task Definition page and select the Assignment policy and select the expression path builder.
    4. You should be able to see the parameter you just added under task:payload. select this . now your assigne is dynamically added.
    Pls let me know if you need further details. Hope this helps.
    Thnks
    Message was edited by:
    soaUser

  • Assign role, group to Human Task when initiated

    Hi all,
    Currently, when user login to BPM and create new task instance, i can get roles and groups of that user by programming. I want to assign roles of user to that task instance dynamically when user click SUBMIT button (Because i want to restrict users belong role are able to do this task, each user belong to a role and group can do it).
    Somebody help?
    Thanks.

    Hi Ming
    1. If you want to intercept any Actions from a Task like Save, Submit, Approve, Reject etc, you can create your own class like MyAppTaskValidationCallback that implements oracle.bpel.services.workflow.task.ITaskValidationCallback and in this overwrite one method named validateTaskOperation(bunch of parameters). See APIs for this.
    In this method, you can get the action performed on the task. Also you can get the complete Payload of the Task including your custom payload and the standard Task Payload stuff like History, Attachments, Comments etc. You can write some simple XML Parser utility methods to get and set attributes in the Payload xsd schema. So in your case, in this method, get Roles, Groups of the logged in user. Check the action performed. If he is not allowed to do that operation, throw the error from this method. Else continue with your logic. To begin with create java class like above, add this code snippet and just explore the data.
    Now, just curious. If your requirement is really to control the actions based on User Role/Groups, did you try to use the out of box functionality and avoid this custom logic. Say for BPM Applications, we have Swimlanes / Roles. Only users belonging to that Role, can work on that Tasks. Try to use out of box stuff as much as possible, unless you really need custom assignment logic.
    Thanks
    Ravi Jegga
    Just giving the code snippet to get an idea. But do refer the online APIs for more information.
    public void validateTaskOperation(ITaskValidationCallback.TaskAction taskAction, IWorkflowContext iWorkflowContext, Task task, Map<String, Object> parameters, Locale locale, List<String> errors) {
    try {
      Element taskPayload = task.getPayloadAsElement();
      String taskTitle;
      String taskOutcome;
      SystemAttributesType taskSystemAttributes = task.getSystemAttributes();         
      taskTitle = task.getTitle();
      System.out.println("MyAppTaskValidationCallback::validateTaskOperation() Begin For TaskTitle: " + taskTitle + " -> TaskAction: " + taskAction + " -> Parameters:\n" + parameters);
      if(taskAction == TaskAction.ACQUIRE) {
          System.out.println("Inside ACQUIRE");
          //parameters.put("AcquiredBy", iWorkflowContext.getUser());
      } else if(taskAction == TaskAction.OUTCOME_UPDATE) {
        System.out.println("Inside OUTCOME_UPDATE");
    } catch (Exception anException) {
      anException.printStackTrace();
    }

  • How to dynamically assign assignee for human task?

    I tried to use xpath expression in task editor. Expression editor suggested me to use task schema and I could not use variables from process.
    I had selected systemMessageAttributes.textAttribute1 and created “Assign” activity to initiate the attribute. This does not work. When task is started assignee is empty and task is automatically completed.
    Does anybody used this feature?

    Hi,
    You can run the soa server in debug mode by adding remote debugging parameters in startWeblogic.sh of soa server and remote debug it to check problems.
    e.g.
    +#For Debug Port+
    +if [ "${SERVER_NAME}" = "soa_server1" ] ; then+
    +JAVA_OPTIONS="${JAVA_OPTIONS} -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=9023,server=y,suspend=n"+
    +export JAVA_OPTIONS+
    +fi+

  • Security in human task views

    Can anybody explain or give a pointer to documentation on how to implement security (authorization with roles) in BPM human task views?
    What do we need to configure to achieve this?
    // npettersson
    Edited by: npettersson on 2011-jul-29 05:07

    Securing Your WebCenter Portal Application - 11g Release 1 (11.1.1.5.0)
    Ciao

  • How to Java methods after submition of human task

    I want to implement java callbacks after completion of human task.
    My Requirement is : I want to save the process object in my separate table once user has submitted the human task.
    Can any 1 give me the example on that.
    Edited by: 964010 on Jan 9, 2013 2:21 AM

    Hi
    See below post for one approach. Anytime a Task is Submitted (means completed by clicking any Action buttons like Submit, Approve, Reject etc etc), the outcome in the method mentioned below is like OUTCOME_UPDATE. First add some print statements here, then later add your custom code.
    Re: Assign role, group to Human Task when initiated
    Thanks
    Ravi Jegga

  • In human task, dynamically assign group doesn't work

    Oracle SOA 11.1.1.4
    My bpel process invokes a human task.
    On the human task Assignment tab, I assigned 3 users (by name), 1 group (by expression).
    The group is configured in LDAP
    When I tested the bpel process, I entered the group and other data required.
    From the worklist app, I see the task listed. It is assigned to the 3 users, but not the dynamically passed-in group.
    From the Audit trail, I saw all data I entered (include the group). Everything seems correct, but I still can’t make the dynamically-pass-group work.
    If I assign the group by name in human task, it works fine.
    The problem is: dynamically assign group doesn't work.
    Please kindly advice.

    Yes, it is possible assign a group as participant of some human task, passing the group name as parameter.
    I have tested just now.
    It works pretty well in SOA 11.1.1.4 (BPEL or BPM).
    Make sure add a data parameter in your human task definition and pass a valid group name to it.
    At the Assignment tab, in the participants' list, add a group, data type by expression, and set the value to the right xpath expression to the corresponding parameter.
    For example: /task:task/task:payload/task:group
    If it is not working look the SOA log files, probably you'll find some information about the error there. Maybe there is some problem with your jazn.com configuration.
    You can also test if there is something wrong related to the group name, trying to transfer some task to the same group by the worklist.

  • Setting a dynamic expiration date in User Task in BPEL 10.1.3.1

    I have a user task / human workflow activity within a BPEL 10.1.3.1 project. I need to be able to set the expiration date of the task dynamically that gets assigned within this worklist.
    I have been able to use the Human Task Wizard screen (<usertask>.task) to hard code the expiration time. Using the Fixed Duration option of days, hours or minutes. I have tried to use the 'By Expression' to do this but have been unable to get it to work. I have tried to select the /task:task/task:systemAttributes/task:expirationDuration or the /task:task/task:systemAttributes/task:expirationDate element within the task workflow xsd but are unsure how to get it to read the date. I have tried to assign a time component to expirationDate and a time period P0DT0H20M to the expirationDuration element.
    Has anyone had experience of this or know whether it can be done? Any help would be appreciated
    Thanks

    I agree with David.
    The lexical representation for duration is the ISO 8601extended format PnYn MnDTnH nMnS, where nY represents the number of years, nM the number of months, nD the number of days, 'T' is the date/time separator, nH the number of hours, nM the number of minutes and nS the number of seconds. The number of seconds can include decimal digits to arbitrary precision.
    The values of the Year, Month, Day, Hour and Minutes components are not restricted but allow an arbitrary unsigned integer, i.e., an integer that conforms to the pattern [0-9]+.. Similarly, the value of the Seconds component allows an arbitrary unsigned decimal. Following ISO 8601, at least one digit must follow the decimal point if it appears. That is, the value of the Seconds component must conform to the pattern [0-9]+(\.[0-9]+)?.
    An optional preceding minus sign ('-') is allowed, to indicate a negative duration. If the sign is omitted a positive duration is indicated.
    For example, to indicate a duration of 1 year, 2 months, 3 days, 10 hours, and 30 minutes, one would write: P1Y2M3DT10H30M. One could also indicate a duration of minus 120 days as: -P120D.
    Reduced precision and truncated representations of this format are allowed provided they conform to the following:
    * If the number of years, months, days, hours, minutes, or seconds in any expression equals zero, the number and its corresponding designator may be omitted. However, at least one number and its designator must be present.
    * The seconds part may have a decimal fraction.
    * The designator 'T' must be absent if and only if all of the time items are absent. The designator 'P' must always be present.
    For example, P1347Y, P1347M and P1Y2MT2H are all allowed; P0Y1347M and P0Y1347M0D are allowed. P-1347M is not allowed although -P1347M is allowed. P1Y2MT is not allowed.
    HTH,
    Bas

  • Dynamic list of user(s) in Human task activity.

    Hello Friends,
    Warm Greetings!!!
    Here is my query:-
    Can we have dynamic list of user(s) in human task for the same role. Request will flow to executive but based on some parameter it needs to go to different executives and this would be checked at run time.
    Please provide some clue or pointers for the same.
    PK

    ===========
    Assign tasks dynamically
    You can assign users, groups, and application roles dynamically using XPath expressions. These expressions enable you to dynamically determine the task participants at runtime. For example, you may have a business requirement to create a dynamic list of task approvers specified in a payload variable. The XPath expression can resolve to zero or more XML nodes. Each node value can be either of the following:
    Ref- http://docs.oracle.com/cd/E14571_01/integration.1111/e10224/bp_introhwf.htm
    ==============
    Either You can put a Xpath expression on Owner (open Human task from composite and see the General tab ) or you can have rule based assignment for users .
    Also in Xpath - Identity related functions can be found under - Identity Service Functions (from Functions drop down)
    Regards
    Rupesh Somani

  • Error in Dynamic Human Task Assignment

    Hi,
    I am trying to assign task dynamically using Xpath but i keep getting error when i deploy & run the BPEL process.
    I tried using orcl:create-nodeset-from-delimited-string(') but it returns the error
    "Error while processing xpath expression, the reason is message can't be null.
    Please verify the xpath query."
    I tried using Qname as 'task:assignee' as well as '/task:task/task:systemAttributes/task:assigneeUsers/task:id' but it returns the same error!
    I would really appreciate if someone can tell me how can I assign user dynamically!

    The trick is that the user id to which you will assign the task should be present somewhere within your payload. When editing the task file, the dynamic user xpath expression you enter should be pointing to this element which contains the user id. That's all indeed.
    By the way, "message can't be null" error may occur if you are not setting the payload instance correctly. You specify the message or element types for the payload while editing the task file, however you should specify real object instances for the payload elements in the dialog box which opens when you double click the human task activity in the BPEL diagram.
    Hope this helps..
    Serkan

  • Routing  a human task while invalid dynamic assignment

    hi,
    we hav a confusion while using route process in human task.
    In our case when an invalid user is dynamically assigned to BPEL ,an Alert is generated for the jcooper user .As we have set "overrride default exception management" for jcooper user in adavance setting of .task file.
    When jcooper user route the task to any other user say jstein,the state of the task of jcooper is completed and also the BPEL process is completed.But in the worklist of jstein no task is shown .
    What we think is,BPEL process should not be get completed when jcooper user route the task but it should get complete when jstein act on the task.
    Regards,
    Ritesh/Nitin

    Hi
    Try to make the <messageAttribute name="ASSIGNMENT" attributeType="SIMPLE_TYPE"
    type="xsd:string" updatable="false"/>
    to
    <messageAttribute name="ASSIGNMENT" attributeType="SIMPLE_TYPE"
    type="xsd:string" updatable="true"/>

  • How to set dynamic expiration date in User Task

    Hi
    I need to set the expiration date of a User Task to a specific date, not a duration. Is it possible to do this?

    I have also got a smiliar problem. Does anyone have any further information to how this can be achieved?
    I have been able to use the Human Task Wizard screen (<usertask>.task) to hard code the expiration time. Using the Fixed Duration option of days, hours or minutes. I have tried to use the 'By Expression' to do this but have been unable to get it to work. I have tried to select the /task:task/task:systemAttributes/task:expirationDuration or the /task:task/task:systemAttributes/task:expirationDate element within the task workflow xsd but are unsure how to get it to read the date. I have tried to assign a time component to expirationDate and a time period P0DT0H20M to the expirationDuration element.

  • Dynamic Sequential List of Approvers in the Human Task

    Hi all - I have this asynchronous BPEL process and want to dynamically assign a Sequential List of Approvers that are the result of an Invoke of a Database Adapter.
    1. Added the OutputCollection of the Invoke as a parameter to the Human Task (element type).
    2. Under Assignment and Routing Policy, chose Sequential List of Approvers, and By Expression, chose the value from the OutputCollection from the payload.
    3. After deployment, the instance falls through to completion without errors, but without assigning a task to any approvers. I can see in the Invoke where it pulled the names I want to be assigned.
    Any help or direction would be greatly appreciated.
    Using JDeveloper 10.1.3.3

    I tried to recreate the problem like listed above, but after I add the Outputcollection of the Invoke as a parameter, there is no schema info (not even task:task) when editing the Assignment and Routing Policy section. At any rate, there weren't errors to speak of - the instance completed with "The state of this instance is Completed".
    In the meantime, I've used a while loop to loop through a sequence of approvers that are result of a query. I'll have to keep track of approvers and include them in each new payload I think.

  • Correlation set based on Human task - receive activity

    Hello everybody,
    is it possible to define a correlation set based on a receive activity of an human task?
    Thanks, Chris

    Are you trying to set "Create with parameters" as default task flow activity ? in that case open the the task flow diagram , right click "Create with parameters" data control -> Mark Activity -> Default Activity.

Maybe you are looking for