A Creating Custom ADF Applications with Oracle Business Process Management Workspace Task Flows

Different features available in Oracle Business Process Management Workspace (Process Workspace) are exposed as standalone reusable components, called task flows. Get an overview of features in each task flow.

You can embed task flows in any Oracle Application Development Framework (ADF) application. These standalone task flows provide many parameters that enable you to build customized applications. All the task flows are bundled in an ADF library that you can include in the application in which you are embedding.

Later, in Samples: Customizing ADF Applications with Process Workspace Task Flows, a sample task flow using TaskListTaskFlow shows detailed steps for embedding the task flow in the application as well as customizing, deploying, and running it.

Note:

The appendix assumes that you are familiar with both Oracle Application Development Framework and security.

A.1 User-Related Task Flows

A.1.1 Task List Task Flow

The task flow takes in the parameters to control how the embedded region displays. This section discusses the following parameters:

A.1.1.1 federatedMode

If you set this parameter to true, then the task list is shown in the federated mode. For the task flow to run in federated mode, you must pass the list of federated servers to the task flow. For instructions about how to pass a list of federated servers to the task flow, see federatedServers.

A.1.1.2 federatedServers

To pass the federated servers list to the task flow, do one of the following:

  • Provide the client configuration file, wf_client_config.xml, in the class path. The class path is either APP-INF\classes\wf_client_config.xml at the ear level or the WEB-INF\classes of the web application. The client configuration file contains all federated server details.

    For a sample wf_client_config.xml file, see Sample: Wf_client_config.xml File.

  • Construct a JAXB object that contains the federated servers list. This JAXB object can be passed to the task flow through the federatedServers parameter. The object should be returned by a backing bean method.

    For a sample bean with the method returning the WorkflowServicesClientConfigurationType object, see Sample: Bean Returning WorkflowServicesClientConfigurationType Object.

If you provide both the client configuration file wf_client_config.xml and the JAXB object to the task flow, the JAXB object takes precedence.

A.1.1.3 showServerColumn

If the task flow is run in federated mode, the server column in the task list is not shown by default. To show the server column in the task list, this parameter must be passed as "true".

A.1.1.4 wfCtxID

This is a workflow context token string. It is used to create workflow context inside the task flow.

Note:

If the application is SSO-enabled or is secured using ADF security, this parameter is not required. Otherwise, this parameter is required.

To get the workflow context identifier:

Run the following:

IWorkflowContext wfCtx =  wfSvcClient.getTaskQueryService().authenticate(username,
password,
realm,
null);
wfCtxID = wfCtx.getToken();

A.1.2 Certificates Task Flow

A digital certificate contains the digital signature of the certificate authority so that anyone can verify that the certificate is real. A digital certificate establishes the participant's credentials. It is issued by a certification authority. It contains your name, a serial number, expiration dates, a copy of the certificate holder's public key (used for encrypting messages and digital signatures), and the digital signature of the certificate-issuing authority so that a recipient can verify that the certificate is real.

As Figure A-1 shows, when you want to sign a decision, you can upload your digital certificate. When signing a task outcome by using your certificate, you must upload not only the one certificate issued to you by the certification authority but the entire chain of certificates. Upload the chain as a .P7B (PKCS7 format) file.

Figure A-1 Uploading a Certificate

Description of Figure A-1 follows
Description of "Figure A-1 Uploading a Certificate"

To create an application and embed the Certificates task flow in the application, follow all the steps of Samples: Customizing ADF Applications with Process Workspace Task Flows except Step 9. This is because certificates have no parameters.

A.1.3 Reports Task Flow

For information about the Reports task flow, see Using Reports to Manage Workflows in Process Workspace.

To create an application and embed the Reports task flow in the application, follow all the steps of Samples: Customizing ADF Applications with Process Workspace Task Flows except Step 9. This is because Reports have no parameters.

A.1.4 Application Preferences Task Flow

For information about the Application Preferences task flow, see Setting the Display of the Work Items Panel in Process Workspace.

To create an application and embed the Application Preferences task flow in it, follow all the steps of Samples: Customizing ADF Applications with Process Workspace Task Flows except Step 9. This is because application preferences have no parameters.

A.1.5 Flex Fields Task Flow

For information about the Flex Fields task flow, see Managing Mapped Attributes (Flex Fields) in Process Workspace.

To create an application and embed the Flex Fields task flow in it, follow all the steps of Samples: Customizing ADF Applications with Process Workspace Task Flows except Step 9. This is because flex fields have no parameters.

A.1.6 Rules Task Flow

For information about the Rules task flow, see How to Create User Rules in Process Workspace.

The showOtherUsersRules parameter takes a Boolean value. When it is passed as True, other users rules are displayed; when it is passed as False, other user rules are not shown. In addition, this user must have the required permission to view other user rules.

To create an application and embed the Rules task flow in it, follow all the steps of Samples: Customizing ADF Applications with Process Workspace Task Flows except Step 9. This is because rules fields have no parameters.

A.2 Process Task Flows

A.2.1 Process Application Task Flow

The applications available in Process Workspace depend on the process design and the roles assigned to the user currently logged in. The list of applications available also depends on the BPM processes that are deployed and running. The applications panel is empty if no processes are running, or if the user is not able to execute an application in any of the processes currently running. Figure A-2 shows the location of the Applications panel in Process Workspace.

Table A-1 Process Applications Task Flow

Field Description

Task Flow definition file:

processApplicationsTaskflow.xml

Description:

Renders the list of applications available to the user, that is, the list of tasks that, when executed, creates instances in the different deployed processes.

Arguments:

None.

A.2.2 Process Instances Task Flow

Table A-2 Process Instances Task Flow

Field Description

Task Flow definition file:

processInstancesTaskflow.xmll

Description:

Renders the list of instances corresponding to a certain view (by default, Inbox view) in a table format. The columns that this table show are defined by the presentation associated to the selected view, which can be edited from here. It also provides search capabilities.

Arguments:

viewId: specifies the view that is rendered initially. By default, Inbox is assumed.

A.2.3 Process Instance Details Task Flow

Table A-3 Process Instances Task Flow

Field Description

Task Flow definition file:

processInstanceDetailTaskflow.xmll

Description:

Renders the instance details, including open activities, audit trail (both tabular and graphical), comments and attachments.

Arguments:

instanceId: Task Flow renders the details associated to this instance ID.

A.3 Process Analytics Task Flows

A.3.1 Dashboard Widget Task Flow

Table A-4 Dashboard Widget Task Flow

Field Description

Task Flow definition file:

widgetTaskflow.xml

Description:

Renders a widget, that is, a graph displaying information stored in Cubes. This widget could be one of the out of the box ones (like Workload per Participant, Performance per Process, and so on) or a custom one.

Arguments:

widgetId: The ID of the widget that is rendered.

showSelector: A Boolean value (true/false) stating whether the task flow renders a drop-down listing all available widgets, so that the user can select and change from one widget to other.

Figure A-3 Process Performance Dashboard

Description of Figure A-3 follows
Description of "Figure A-3 Process Performance Dashboard"

A.3.2 Application Roles Task Flow

Application Roles task flow displays the list of application roles defined in the system for application context OracleBPMProcessRolesApp. The user can search for application roles, select a role and add members (users, groups or other roles) to it or even define business calendar-organization unit mappings for the role.

Figure A-4 shows the Roles Detail Panel.

A.3.3 Organization Units Task Flow

This task flow enables users to create new organization units or edit existing ones.

For information about the Organization Units task flow, see Managing Your Organization in Process Workspace .

Figure A-5 shows an Organization Units details panel.

Figure A-5 Organization Units Details Panel

Description of Figure A-5 follows
Description of "Figure A-5 Organization Units Details Panel"

A.3.4 Parametric Roles Task Flow

For information about the Parametric Roles task flow, see Managing Parametric Roles in Process Workspace.

A.3.5 Business Calendar and Holiday Lists Task Flow

For information about the Business Calendar and Holiday List task flow, see Managing Calendars in Process Workspace and Managing Holiday Rules in Process Workspace.

A.3.6 Extended User Properties Task Flow

For information about the Extended User Properties task flow, see Managing Extended User Properties in Process Workspace.

A.4 .JAR files for the Task Flows

Table A-5 JAR Files for Task Flows

JAR File Location

adflibTaskListTaskFlow.jar

$FMW_HOME/Oracle_WC1/soa/modules/oracle.bpm.spaces_11.1.1

oracle.bpm.workspace-adflib.jar

This .jar file is packaged only with a Process Spaces installation. It includes the following libraries that you must specify in your custom ADF application:

  • adf.oracle.domain

  • oracle.bpm.runtime

  • oracle.bpm.client

  • oracle.soa.workflow.wc

  • oracle.bpm.webapp.common

  • oracle.bpm.workspace

  • oracle.bpm.projectlib

adflibWorkspaceTaskFlows.jar

$FMW_HOME/AS11gR1SOA/soa/modules/oracle.soa.worklist_11.1.1

A.5 Samples: Customizing ADF Applications with Process Workspace Task Flows

A.5.1 Sample 1: Creating an Application with an Embedded Tasklist Task Flow

The sample explains how to create an application and embed the TaskList task flow in it.

Use these same steps to create a new sample.

To embed the Tasklist task flow in your application:

  1. Create a new Fusion Web Application in Oracle JDeveloper and name it TaskListTaskFlowSample.

    Figure A-6 Creating New Oracle Fusion Middleware Application

    Description of Figure A-6 follows
    Description of "Figure A-6 Creating New Oracle Fusion Middleware Application"
  2. Include the "BPM Worklist Components", “BPM Services” and “WSRP Container” libraries.

    1. Right click on the project and select Project properties.

    2. On the Project Properties window, select Libraries and Classpath and click the Add Library button.

    3. Add BPM Worklist Components, BPM Services, and WSRP Containerlibraries.

    Figure A-7 Adding BPM Worklist Component Library

    Description of Figure A-7 follows
    Description of "Figure A-7 Adding BPM Worklist Component Library"
  3. If you are running your application on non-SOA server, you must perform two additional steps that are documented in the Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite.

    1. Install the oracle.soa.workflow shared library. If your server already has oracle.soa.workflow.wc installed, then you need not install oracle.soa.workflow.

      For information about installing the oracle.soa.workflow shared library, see Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite.

    2. Configure foreign JNDI on the non-SOA server.

      For information about configuring a foreign JNDI on the non-soa server, see Oracle Fusion Middleware Programming JNDI for Oracle WebLogic Server.

  4. Create a JSPX file testSample.jspx.

    Figure A-8 Creating a a JSPX File

    Description of Figure A-8 follows
    Description of "Figure A-8 Creating a a JSPX File"
  5. Choose adflibTaskListTaskFlow.jar from the component palette.

    It contains the list of all the Task Flows.

    Figure A-9 Choosing adflibTaskListTaskFlow.jar

    Description of Figure A-9 follows
    Description of "Figure A-9 Choosing adflibTaskListTaskFlow.jar"
  6. Drag and drop one of the Task Flow onto the JSPX page as a region.

    Figure A-10 shows, by way of example, the TaskListTaskFlow being dropped onto the JSPX page as a region.

    Figure A-10 Oracle JDeveloper with TaskList Task Flow on the JSPX Test Page

    Description of Figure A-10 follows
    Description of "Figure A-10 Oracle JDeveloper with TaskList Task Flow on the JSPX Test Page"

    When you drag a task flow onto a JSPX page, a popup shows a list of the available parameters.

    The Edit Task Flow Binding dialog box appears.

  7. In the Edit Task Flow Binding dialog box, pass the task flow parameters.

    Figure A-11 Passing Task Flow Parameters

    Description of Figure A-11 follows
    Description of "Figure A-11 Passing Task Flow Parameters"

    Create the following entry in testSamplePagedef.xml.

    <taskFlow id="taskListtaskflowdefinition1"
    taskFlowId="/WEB-INF/taskList-task-flow-definition.xml#taskList-task-flow-definition"
    xmlns="http://xmlns.oracle.com/adf/controller/binding">
      <parameters>
    
        <parameter id="federatedMode" value="true" xmlns="http://xmlns.oracle.com/adfm/uimodel"/>
    
        <parameter id="showServerColumn" value="true" xmlns="http://xmlns.oracle.com/adfm/uimodel"/>
    
      </parameters>
    </taskFlow>
    

    Note:

    Set the federatedMode value according to your needs. See how to use task flow in federatedMode.

  8. Open and edit the WAR deployment profile. To do this:

    1. Right-click ViewController.

    2. Select Deployment.

    3. Select WAR File.

    4. Click Edit.

    5. Check adflibTaskListTaskFlow.jar, adflibWorklistComponents.jar and wsrp-container.jar.

      Figure A-12 shows an edited WAR deployment profile.

    Figure A-12 Editing the WAR Deployment Profile

    Description of Figure A-12 follows
    Description of "Figure A-12 Editing the WAR Deployment Profile"
  9. Secure the application using ADF Security by navigating to Secure then Configure ADF Security… from the application-level menu.

    Figure A-13 Navigating to Secure the Application

    Description of Figure A-13 follows
    Description of "Figure A-13 Navigating to Secure the Application"

    The Enable ADF Security dialog box appears.

  10. Select ADF Authentication.

    Figure A-14 Selecting ADF Authentication

    Description of Figure A-14 follows
    Description of "Figure A-14 Selecting ADF Authentication"

    Click Next. The Select Authentication Type dialog box appears.

    Note:

    If you choose ADF Authentication and Authorization, do the following:

    1. In the Application Resources - Descriptors - META-INFO folder, open jazn-data.xml.

    2. Select Resource Grants.

    3. Select Task Flow type.

    4. Select Show task flows imported from ADF libraries.

      The taskflows are listed in the Resources listing.

    5. Select the appropriate taskflow that you have consumed in the application—for example, taskList-task-flow-definition (For the task drill functionality to work, taskList-task-flow-definition also requires permission for /taskDetail-task-flow-definition).

    6. Add Granted to selected role for the "view" permission.

  11. Add a reference to the oracle.soa.worklist.webapp and oracle.soa.workflow shared libraries to your application:

    1. Locate the weblogic.xml file in the WebContent / WEB-INF folder. "

      Note:

      If there is no weblogic.xml file, create it. To create, select New, From Gallery, General, Deployment Descriptors, Weblogic Deployment Descriptor and in the resulting screen, select the weblogic.xml .

    2. Add the following entries to the weblogic.xml.
      <library-ref>
          <library-name>oracle.soa.worklist.webapp</library-name>
      </library-ref>
      <library-ref>
         <library-name>oracle.soa.workflow</library-name>
      </library-ref>
  12. Select HTTP Basic Authentication.

    Figure A-15 Selecting HTTP Basic Authentication

    Description of Figure A-15 follows
    Description of "Figure A-15 Selecting HTTP Basic Authentication"

    For information about enabling ADF security in a Fusion web application see Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

  13. Click Finish.

    Note:

    If you are using the task flow in federated mode, do the following:

    • Pass the list of federated servers to the task flow. For more information, see federatedServers.

    • Enable global trust between the federated servers. This is done so that the already federated user token is passed to all the federated servers. Do the following:

      1. Login to the Oracle WebLogic Server console.

      2. Under Domain Structures, select the domain name base_domain. The domain name may be different if a non-soa server is used. You can rename the domain name during configuration.

      3. Select the Security tab.

      4. Click the Advanced link (near the bottom Save button.)

      5. Give some password in the "Credential:" field. (The same password needs to be given for all the federated servers).

      6. Click Save.

      7. Restart the server.

  14. Create an EAR deployment profile, build the EAR, and deploy it.

    To deploy the EAR:

    1. From the application-level menu, navigate to Deploy then TaskListTaskFlowSample_Appl....

      Figure A-16 Deploying the Application

      Description of Figure A-16 follows
      Description of "Figure A-16 Deploying the Application"

      The Deployment Action dialog box appears.

    2. Select Deploy to Application Server.

      Figure A-17 Deploying to Application Server

      Description of Figure A-17 follows
      Description of "Figure A-17 Deploying to Application Server"

      Click Next. The Select Server dialog box appears.

  15. Select the server. Clear the check box Deploy to all Server instances in the domain. Click Next.

    The Server Instances dialog box appears.

  16. Select the server instance and click Finish.

  17. Access the following link, specifying the proper values for server and port. http://server:port/TaskListTaskFlowSample-ViewController-context-root/faces/testSample.jspx.

    A login pop-up window appears. Log in as any user. The task list appears for the logged-in user.

    If the task flow is used in federated mode, then the list of servers appear in the Show list. Selecting any combination of servers from the list refreshes the task list to show all the tasks belonging to the selected servers. If you passed the parameter showServerColumn as true, then the server column appears in the task list and indicates the server to which the task belongs.

    Figure A-18 Process Workspace Task List

    Description of Figure A-18 follows
    Description of "Figure A-18 Process Workspace Task List"

    Click any of the tasks title links to see the task details in a new browser window.

If your application is authorized for taskList-task-flow-definition.xml (the tasklist dropped into the page in the above procedure), the relevant security permissions must be granted for the task detail navigate functionality to work.

Connect to the Common domain using wlst.sh and run the following WLST command to grant the task flow view permission for "/WEB-INF/taskDetail-task-flow-definition.xml#taskDetail-task-flow-definition" to the authenticated-role:

grantPermission(appStripe="YOUR_APP_STRIPE_NAME",
principalClass="oracle.security.jps.internal.core.principals.JpsAuthenticatedRoleImpl",
principalName="authenticated-role",
 permClass="oracle.adf.controller.security.TaskFlowPermission", 
permTarget="/WEB-INF/taskDetail-task-flow-definition.xml#taskDetail-task-flow-definition", 
permActions="view")

A.5.2 Sample 2: Creating an ADF Page with Task Flows

This sample shows how to create an ADF page and add three task flows to the page.

The page is divided into two parts. If the user selects TaskFlow from left side, the corresponding task flow appears on the right side.

To create the ADF page with task flows:

  1. Follow Steps 1 to 4 of Sample 1: Creating an Application with an Embedded Tasklist Task Flow.

  2. Configure the JSPX page as follows:

    1. In Component Palette, select ADF Faces.

    2. Drag and drop the Panel Stretch Layout on to the JSPX page.

    3. Delete Top, Start, Bottom, and End from the JSPX page.

      The JSPX page looks like Figure A-19.

    Figure A-19 Configuring the JSPX Page

    Description of Figure A-19 follows
    Description of "Figure A-19 Configuring the JSPX Page"
  3. Drag and drop the Panel Splitter from the Component Palette into the JSPX page.

    The JSPX page now appears as shown in Figure A-20.

    Figure A-20 Split Panel in the JSPX Page

    Description of Figure A-20 follows
    Description of "Figure A-20 Split Panel in the JSPX Page"
  4. In the navigator, right-click View Controller and create a new Java Class. Name it SampleController.java.

    Add private transient UIComponent rightPanel = null; with getters and setters.

    Figure A-21 Creating SampleController.java

    Description of Figure A-21 follows
    Description of "Figure A-21 Creating SampleController.java"
  5. In the navigator, select the Faces-config.xml file. Specify the Managed Bean, naming it as sampleControllerBean.

    Figure A-22 Specifying the Managed Bean

    Description of Figure A-22 follows
    Description of "Figure A-22 Specifying the Managed Bean"
  6. Drag and drop the Panel Stretch Layout on to the Second Facet.

    Delete Top, Start, Bottom, and End from it. Specify a binding for PanelStrechLayout from the Property Inspector as #{sampleControllerBean.rightPanel}.

  7. Drag and drop a link from the Component Palette into the JSPX page.

    In the Property Inspector specify the text as Rules. In SampleController Java file, add the following code:

    private String selectedLink = "RULES"; with getter and setters
    public void displayRules(ActionEvent event){
      setSelectedLink("RULES");
      if(getRightPanel()!= null){
        RequestContext.getCurrentInstance().addPartialTarget(getRightPanel());
      }
    }
    

    Add the Action Listener property for the rules as follows:

    #{sampleControllerBean.displayRules}
    
  8. Drag and drop a link from the Component Palette into the JSPX page.

    In the Property Inspector, specify the text as Certificates. In the SampleController Java file, add following code:

    public void displayCertificates(ActionEvent event){
      setSelectedLink("CERTIFICATES");
      if(getRightPanel() != null){
        RequestContext.getCurrentInstance().addPartialTarget(getRightPanel());
      }
    }
    

    Add the Action Listener property for the certificates as follows:

    #{sampleControllerBean.displayCertificates}

  9. Drag and drop a link from the Component Palette into the JSPX page.

    In the Property Inspector, specify the text as Reports. In the SampleController Java file, add following code:

    public void displayReports(ActionEvent event){
      setSelectedLink("REPORTS");
      if(getRightPanel() != null){
        RequestContext.getCurrentInstance().addPartialTarget(getRightPanel());
      }
    }
    

    Add the Action Listener property for the reports as follows:

    #{sampleControllerBean. displayReports}
    
  10. Drag and drop a switcher from the Component Palette into the center facet of the second facet.

    In the Property Inspector, specify the facet name as #{sessionScope.sampleControllerBean.selectedLink}" and the default faces as RULES.

    Figure A-23 Adding and Specifying a Switcher

    Description of Figure A-23 follows
    Description of "Figure A-23 Adding and Specifying a Switcher"
  11. Inside af:switcher define a facet and name it f:facet name="RULES".

    Inside this facet, drag and drop Rules-Task-Flow-Definition from the Component Palette (inside adflibTaskListTaskFlow.jar).

  12. Inside af:switcher define another facet and name it f:facet name="CERTIFICATES".

    Inside this facet, drag and drop Certificates-Task-Flow-Definition from the Component Palette (inside adflibTaskListTaskFlow.jar)

  13. Inside af:switcher define another facet and name it f:facet name="REPORTS".

    Inside this facet drag and drop Reports-Task-Flow-Definition from the Component Palette (inside adflibTaskListTaskFlow.jar)

  14. Save your work.

  15. Follow Steps 4 to 17 of Sample 1: Creating an Application with an Embedded Tasklist Task Flow.

A.6 Sample: Wf_client_config.xml File

This section provides a sample of the client configuration file, Wf_client_config.xml.

If you don't want to include the server in the federated servers list, put excludeFromFederatedList="true" in the <server> element.

The client type needs to be specified explicitly on the <server> element in the XML.

  • If you are using a remote client, enter clientType="REMOTE".

  • If you are using a SOAP client, enter clientType="SOAP".

In Example A-1, REMOTE client type is used.

Example A-1 Wf_client_config.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<workflowServicesClientConfiguration
xmlns="http://xmlns.oracle.com/bpel/services/client">
<server name="default" default="true" excludeFromFederatedList="true" clientType="REMOTE">
  <localClient>
    <participateInClientTransaction>false</participateInClientTransaction>
  </localClient>
  <remoteClient>
    <serverURL>t3://sta00048.ex.example.com:7001</serverURL>
    <initialContextFactory>weblogic.jndi.WLInitialContextFactory</initialContextFactory>
    <participateInClientTransaction>false</participateInClientTransaction>
  </remoteClient>
  <soapClient>
    <rootEndPointURL>http://sta00048.ex.example.com:7001</rootEndPointURL>
      <identityPropagation mode="dynamic" type="saml">
        <policy-references>
          <policy-reference enabled="true" category="security"
            uri="oracle/wss10_saml_token_client_policy"/>
        </policy-references>
      </identityPropagation>
    </soapClient>
  </server>
<server name="ERP" clientType="REMOTE">
  <soapClient>
    <rootEndPointURL>http://sta00147.ex.example.com:7001</rootEndPointURL>
      <identityPropagation mode="dynamic" type="saml">
        <policy-references>
          <policy-reference enabled="true" category="security"
          uri="oracle/wss10_saml_token_client_policy"/>
        </policy-references>
      </identityPropagation>
    </soapClient>
  <remoteClient>
    <serverURL>t3://sta00147.ex.example.com:7001</serverURL>
    <initialContextFactory>weblogic.jndi.WLInitialContextFactory</initialContextFactory>
    <participateInClientTransaction>false</participateInClientTransaction>
  </remoteClient>
</server>
<server name="CRM" clientType="REMOTE">
  <soapClient>
    <rootEndPointURL>http://sta00048.ex.example.com:7001</rootEndPointURL>
    <identityPropagation mode="dynamic" type="saml">
      <policy-references>
        <policy-reference enabled="true" category="security"
        uri="oracle/wss10_saml_token_client_policy"/>
      </policy-references>
    </identityPropagation>
  </soapClient>
  <remoteClient>
    <serverURL>t3://sta00048.ex.example.com:7001</serverURL>
    <initialContextFactory>weblogic.jndi.WLInitialContextFactory</initialContextFactory>
    <participateInClientTransaction>false</participateInClientTransaction>
  </remoteClient>
</server>
</workflowServicesClientConfiguration>

A.7 Sample: Bean Returning WorkflowServicesClientConfigurationType Object

This section provides a sample: bean with the method returning the WorkflowServicesClientConfigurationType object.

Note:

You must set the client type explicitly while building the JAXB object. For example:

ServerType server1 = new ServerType();
server1.setClientType("REMOTE"); // If REMOTE client is to be used.

Or:

server1.setClientType("SOAP"); // If SOAP client is to be used.

If you do not specify anything for the client type, the default is SOAP.

package view;

import java.util.List;

import oracle.bpel.services.workflow.client.config.IdentityPropagationType;
import oracle.bpel.services.workflow.client.config.PolicyReferenceType;
import oracle.bpel.services.workflow.client.config.PolicyReferencesType;
import oracle.bpel.services.workflow.client.config.RemoteClientType;
import oracle.bpel.services.workflow.client.config.ServerType;
import oracle.bpel.services.workflow.client.config.SoapClientType;
import oracle.bpel.services.workflow.client.config.WorkflowServicesClientConfigurationType;
import weblogic.nodemanager.common.ServerType;

public class WorklistBackingBean {
  WorkflowServicesClientConfigurationType wscct = null;

  public WorklistBackingBean() {
    super();
  }

  public WorkflowServicesClientConfigurationType getWSCC() {
    if (wscct == null) {
      wscct = new WorkflowServicesClientConfigurationType();
      List<ServerType> servers = wscct.getServer();
      /**** Setting default server in the list ****/
      ServerType defaultServer = new ServerType();
      defaultServer.setClientType("SOAP");
      servers.add(defaultServer);
      defaultServer.setDefault(true);
      //If this is true, the server is excluded from federated server list
      //By defalut it is false
      //defalutServer.setExcludeFromFederatedList(true);
      defaultServer.setName("default");
      RemoteClientType rct = new RemoteClientType();
      rct.setServerURL("t3://defaultHost:port");
      rct.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
      rct.setParticipateInClientTransaction(false);
      defaultServer.setRemoteClient(rct);
      SoapClientType sct = new SoapClientType();
      PolicyReferencesType prts = new PolicyReferencesType();
      PolicyReferenceType prt = new PolicyReferenceType();
      prt.setEnabled(true);
      prt.setCategory("security");
      prt.setUri("oracle/wss10_saml_token_client_policy");
      prts.getPolicyReference().add(prt);
      IdentityPropagationType ipt = new IdentityPropagationType();
      ipt.setMode("dynamic");
      ipt.setType("saml");
      ipt.setPolicyReferences(prts);
      sct.setRootEndPointURL("http://defaultHost:port");
      sct.setIdentityPropagation(ipt);
      defaultServer.setSoapClient(sct);
      /****** Setting Federated Server 1 to the list ****/
      ServerType server1 = new ServerType();
      server1.setClientType("SOAP");
      servers.add(server1);
      server1.setName("Human Resource");
      RemoteClientType rct1 = new RemoteClientType();
      rct1.setServerURL("t3://HumanResourcesHost:port");
      rct1.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
      rct1.setParticipateInClientTransaction(false);
      server1.setRemoteClient(rct1);
      SoapClientType sct1 = new SoapClientType();
      PolicyReferencesType prts1 = new PolicyReferencesType();
      PolicyReferenceType prt1 = new PolicyReferenceType();
      prt1.setEnabled(true);
      prt1.setCategory("security");
      prt1.setUri("oracle/wss10_saml_token_client_policy");
      prts1.getPolicyReference().add(prt1);
      IdentityPropagationType ipt1 = new IdentityPropagationType();
      ipt1.setMode("dynamic");
      ipt1.setType("saml");
      ipt1.setPolicyReferences(prts1);
      sct1.setRootEndPointURL("http://HumanResourcesHost:port");
      sct1.setIdentityPropagation(ipt1);
      server1.setSoapClient(sct1);
    }
    return wscct;
  }
}