Friday Mar 01, 2013

Custom TaskList Portlet in Oracle BPM 11g

Introduction:

Oracle BPM 11g suite provides the BPM Workspace for end users to view and act upon tasks that are assigned to them. The various User Interfaces available for end users are:

  • The BPM Workspace Application
  • TaskList Portlet in WebCenter Spaces

Customers may need a task list portal as a part of their enterprise application with the tasks displayed in a format that is most appropriate to the business. A Custom Worklist Portlet can be built and consumed from other applications. This article describes solution that uses the Human Task Java APIs to query the BPM engine, Oracle ADF to build the custom portlet and Webcenter spaces to consume the portlet.

The benefit of this approach is that the business can continue to use the enterprise portal to complete the tasks assigned to them in a way that is most suited to the business.

The following sections describe how to build a custom Task List portlet that that can be consumed from Webcenter spaces.

1. Developing an ADF Project to display tasks, details, actions

2. BPM Authentication and Identity Propagation

3. Portletizing the ADF Application

4. Consuming the WSRP in Web Center

1. Developing an ADF Project to display tasks, details, actions

  Create an ADF Application in Jdeveloper with a Java Class in the View Controller project   to query the tasks from the BPM Engine.

a. Connect to the BPM Engine

  BPM Provides the Work List APIs to query and Act upon tasks. The Task services can be  accessed through SOAP connections.

Map properties = new HashMap<CONNECTION_PROPERTY, String>();

properties.put(CONNECTION_PROPERTY.SOAP_END_POINT_ROOT, wsurl);

// SOA server URL, http://[Server Name]:Port"

properties.put(CONNECTION_PROPERTY.SECURITY_POLICY_URI,

"oracle/wss10_saml_token_client_policy");

properties.put(CONNECTION_PROPERTY.MANAGEMENT_POLICY_URI,

"oracle/log_policy");

wfSvcClient =

WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.SOAP_CLIENT,

properties,

null);

b. Initialize the task attributes to be queried

List queryColumns = new ArrayList();

queryColumns.add("TASKID");

queryColumns.add("TASKNUMBER");

queryColumns.add("TITLE");

queryColumns.add("OUTCOME");

queryColumns.add("STATE");

queryColumns.add("UPDATEDDATE");

queryColumns.add("UPDATEDBY");

queryColumns.add("CATEGORY");

queryColumns.add("HASSUBTASK");

c. Execute the query

querySvc.queryTasks(ctx, queryColumns, optionalInfo, ITaskQueryService.AssignmentFilter.MY_AND_GROUP,null, null,null, 0);

      d. Retrieve the task result set

for (int i = 0; i < tasks.size(); i++) {

Task task = (Task)tasks.get(i);

int taskNumber = task.getSystemAttributes().getTaskNumber();

String title = task.getTitle();

String taskId = task.getSystemAttributes().getTaskId();

String outcome = task.getSystemAttributes().getOutcome();

String state = task.getSystemAttributes().getState();

}

Right Click on the Java Class and create an ADF Data control. Drag and drop the data control on the JSPX to create the task list table.

2. BPM Authentication and Identity Propagation

Identity propagation provides a mechanism to propagate the user token (in this scenario we use the SAML token) when the user logs in to the BPM web service. This method does not required usernames and passwords to be sent as clear text in the code. The SAML token is created when the user logs in for the first time. The SAML token is passed to the BPM webservice to query tasks related to that user.

The following properties can be set for identity propagation:

properties.put(CONNECTION_PROPERTY.SECURITY_POLICY_URI, "oracle/wss10_saml_token_client_policy");

properties.put(CONNECTION_PROPERTY.SOAP_IDENTITY_PROPAGATION , "saml");

3. Portletizing the ADF Application

Portletizing the ADF application creates an Oracle JSF Portlet bridge that exposes the application as a JSR 286 portlet that can be consumed by other applications.

a. Right click on the jspx in the Application Navigator and click Create Portlet entry.

    b. Deploy the Portlet to the WC_Portlet Server

    c. Attaching a policy to the Portlet prodcucer end point

Login to the Enterprise Manager Console, expand Application Deployments. Right click on   the deployed application and select Web services. Select WSRP_V2_Markup_Service from the list of Web Services.

Click Attach/Detach in the policies tab

Select oracle/wss10_saml_token_service_policy and click Attach

Click OK to save the changes

4. Consuming the WSRP in Web Center

a. Registering the Portlet

Login to the Web Center Spaces Server EM Console

Expand Service WebCenter Spaces, right click webcenter and select Settings->Service Configuration


Select Portlet producers -> Add

Enter the following details, test and click OK

b. Consuming the portlet

Add the Portlet in the Webcenter spaces page

About

This blog was created to share bite sized bits of information picked up in the field by Oracle's team of solution consultants and engineers.Bon appetite! Locations of visitors to this page

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today