In this blog I am going the describe how to write a custom escalation task for SOA human Task.
Normally SOA human task does have predefined escalation process to Manager, Director and CEO. Where escalation task will be automatically assigned to the one of the specified Role.
In case of OIM workflow, only Manager role is defined. Some time we have requirements to escalate workflow task to any other user or role and the same is not supported by the composite. So we have to write our own custom escalation task.
Below are the steps to create a new escalation task.
1. In JDeveloper, create a new Generic Project CustomEscalator.
2. Create a java class named CustomEscalator under the below package
oracle.bpel.services.workflow.assignment.dynamic
Note: use the above package only.
3. Add the below library to the project classpath
BPEL Runtime
BPEL Services
BPM Workflow
4. Open the CustomEscalator class and implements IDynamicTaskEscalationPattern.
5. Override the method getTaskEscalationUser(Task task) with your own logic and return the escalation manager's user login.
6. Once the code is complete, compile and create a jar file (simple jar file).
7. transfer the jar file to [SOA_HOME]/soa/modules/oracle.soa.ext_11.1.1 directory.
8. set CLASSPATH=$CLASSPATH:[MW_HOME]/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar
9. set PATH=$PATH:[MW_HOME]/modules/org.apache.ant_1.7.1/bin
10. set ANT_HOME=[MW_HOME]/modules/org.apache.ant_1.7.1
11. run "ant -buildfile build.xml" *
12. Open the EM console.
13. Right click on soa-infra and select SOA Administration -> Workflow Properties
14. Click on and Add a new function.
15. Provide the below parameters:
Function Name: CustomEscalator
Classpath: oracle.bpel.services.workflow.assignment.dynamic.CustomEscalator
16. Click Ok and Apply.
17. In the SOA composite, open the HumanTask .task file.
18. Go to the Deadlines.
19. Clear the Highest Approver Title field.
20. Update "CustomEscalator" to the Custom Escalation Java Class.
21. Provide the duration of the escalation as required. (for testing i used 1 min).
22. Save and Deploy the composite.
23. Restart the SOA managed servers.
24. Test the functionality.
-------------------------------------------------------------------------------------------------------------
*While ANT building if you face the below error message, then perform the activity as mentioned:
Error:
oracle.soa.ext_11.1.1\build.xml:41: Problem: failed to create task or type if
Solution:
Modify the build.xml as below
locate this line:
<if>
<equals arg1="${Extension-Name}" arg2="oracle.soa.workflow.wc" />
and replace it with:
<!--
<if>
<equals arg1="${Extension-Name}" arg2="oracle.soa.workflow.wc" />
Locate this line:
<else>
<jar destfile="${library.path}"
update="yes" >
and modify it to
<else>
-->
<jar destfile="${library.path}"
update="yes" >
Locate this line:
</else>
</if>
and modify it to:
<!--
</else>
</if>
-->
Normally SOA human task does have predefined escalation process to Manager, Director and CEO. Where escalation task will be automatically assigned to the one of the specified Role.
In case of OIM workflow, only Manager role is defined. Some time we have requirements to escalate workflow task to any other user or role and the same is not supported by the composite. So we have to write our own custom escalation task.
Below are the steps to create a new escalation task.
1. In JDeveloper, create a new Generic Project CustomEscalator.
2. Create a java class named CustomEscalator under the below package
oracle.bpel.services.workflow.assignment.dynamic
Note: use the above package only.
3. Add the below library to the project classpath
BPEL Runtime
BPEL Services
BPM Workflow
4. Open the CustomEscalator class and implements IDynamicTaskEscalationPattern.
5. Override the method getTaskEscalationUser(Task task) with your own logic and return the escalation manager's user login.
6. Once the code is complete, compile and create a jar file (simple jar file).
7. transfer the jar file to [SOA_HOME]/soa/modules/oracle.soa.ext_11.1.1 directory.
8. set CLASSPATH=$CLASSPATH:[MW_HOME]/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar
9. set PATH=$PATH:[MW_HOME]/modules/org.apache.ant_1.7.1/bin
10. set ANT_HOME=[MW_HOME]/modules/org.apache.ant_1.7.1
11. run "ant -buildfile build.xml" *
12. Open the EM console.
13. Right click on soa-infra and select SOA Administration -> Workflow Properties
14. Click on and Add a new function.
15. Provide the below parameters:
Function Name: CustomEscalator
Classpath: oracle.bpel.services.workflow.assignment.dynamic.CustomEscalator
16. Click Ok and Apply.
17. In the SOA composite, open the HumanTask .task file.
18. Go to the Deadlines.
19. Clear the Highest Approver Title field.
20. Update "CustomEscalator" to the Custom Escalation Java Class.
21. Provide the duration of the escalation as required. (for testing i used 1 min).
22. Save and Deploy the composite.
23. Restart the SOA managed servers.
24. Test the functionality.
-------------------------------------------------------------------------------------------------------------
*While ANT building if you face the below error message, then perform the activity as mentioned:
Error:
oracle.soa.ext_11.1.1\build.xml:41: Problem: failed to create task or type if
Solution:
Modify the build.xml as below
locate this line:
<if>
<equals arg1="${Extension-Name}" arg2="oracle.soa.workflow.wc" />
and replace it with:
<!--
<if>
<equals arg1="${Extension-Name}" arg2="oracle.soa.workflow.wc" />
Locate this line:
<else>
<jar destfile="${library.path}"
update="yes" >
and modify it to
<else>
-->
<jar destfile="${library.path}"
update="yes" >
Locate this line:
</else>
</if>
and modify it to:
<!--
</else>
</if>
-->