24 Building a Guided Business Process Client Application

This chapter explains how to build a client application to display your process instances using the milestones you defined when creating your Guided Business Process.

This chapter includes the following sections:

24.1 Introduction to Building a Guided Business Process Client Application

Guided Business Processes provide you with predefined ADF tasksflows that you can use to build an ADF application to display and run Guided Business Processes.

If the provided ADF taskflows do not satisfy your requirements, then you can use the set of APIs that Guided Business Processes provide, to obtain the information that your UI client applications displays. These APIs allow you to obtain data about the milestones and tasks using web services and Enterprise Java Beans.

24.2 Developing a Guided Business Process Client Application with Oracle ADF

A Guided Business Process client application provides a user interface for the Guided Business Process task flow. The client application can be developed in a simple ADF JSPX page in any configuration. Typically, a client application includes a region displaying the Activity Guide tree and another region displaying the details of the specific node selected from the tree.

One way to display these two regions is to include a dynamic region on the left side of a JSPX page and a human task flow on the right. However, any configuration is possible.

24.2.1 How to Develop a Guided Business Process Client Application

To develop a Guided Business Process client application:

  1. In JDeveloper, create a new application with ADF Web project.

  2. Select the application ViewController and add the Activity Guide library activityguide-ui.jar to the application classpath.

    Add the following .jar files:

    • <FMW_home>/AS11gR1SOA/soa/modules/activityguide-ui_11.1.1.jar/activityguide-ui.jar

    • <FMW_home>/AS11gR1SOA/soa/modules/oracle.soa.workflow_11.1.1/bpm-services.jar

    • <FMW_home>/AS11gR1SOA/soa/modules/oracle.soa.bpel_11.1.1/orabpel-common.jar

    • <FMW_home>/AS11gR1SOA/soa/modules/oracle.soa.bpel_11.1.1/orabpel.jar

    • <FMW_home>/oracle_common/modules/oracle.xdk_11.1.0/xml.jar

    • <FMW_home>/AS11gR1SOA/soa/modules/oracle.soa.fabric_11.1.1/bpm-infra.jar

    • <FMW_home>/AS11gR1SOA/soa/modules/oracle.soa.fabric_11.1.1/fabric-runtime.jar

    • <FMW_home>/oracle_common/modules/oracle.webservices_11.1.1/wsclient.jar

    • Create a file called Config.jar using the wf_client_config.xml file and add it to the application classpath. The wf_client_config.xml file should include the host name and port of the WLS instance running the Guided Business Process instances.

    Note:

    Add these JAR files only from the latest version of the standalone Oracle WebLogic Server
  3. Create a new JSPX page in which the Activity Guide is to display.

  4. Drag and drop task flows onto the JSPX page, one for displaying the Activity Guide tree and one for displaying the individual Activity Guide node.

    Dragging and dropping a task flow automatically creates a region for that task flow.

  5. Create a file called activityguide.properties.

    shows the properties you can specify in this file.

    Example 24-1 shows a typical activityguide.properties file:

    Table 24-1 Activity Guide Properties

    Property Description Possible Values

    ServerAuthenticationMethod

    Specifies the authentication mode used to connect to services deployed in the SOA Engine.

    IDENTITY_PROPAGATION

    ServerConnectionMode

    Specifies the mode for the transmission of data.

    • SOAP

    • REMOTE

    WorklistHttpURL

    Specifies the URL to access the worklist application.

    http://host:port/integration/worklisapp

    SelectionFilter

    Specifies the filter used to filter the processes in an activity guide.

    • MY

    • PREVIOUS

    • REPORTEES

    • CREATOR

    • ADMIN

    AGDefinitionFilter

    Specifies the definition ID used to filter the process in an activity guide. The activity guide only displays those processes that match this ID.

    activity guide definition ID

    AGInstanceOrdering

    Specifies the order used to display the processes in the activity guide.

    For example: CREATION_DATE:ASC

    • column_name:ASC

    • column_name:DESC

    AGInstanceID

    Specifies the instance ID used to display the activity guide tree.

    For example: 10001

    activity guide instance ID

    CustomPredicate1

    Specifies an additional predicate to filter the list of processes in an activity guide.

    For example: CREATOR, EQ, jstein

    column name, operator, value

    CustomPredicate2

    Specifies a different additional predicate to filter the list of processes in an activity guide. This predicate is used with CustomPredicate1

    column name, operator, value

    ShowAllAGTreeNodesProperties

    Specifies if the activity guide shows a section at the top that describes the properties of activity guides, milestones and tasks.

    • true

    • false

    ShowRefreshButton

    Specifies if the regional area displays a refresh button. The default value is true.

    • true

    • false

    ShowGaugeTickMarks

    Specifies if the gauge indicator displays tick markers and labels. The default value is false.

    • true

    • false

    ShowGaugePercentLabel

    Specifies if the gauge indicator displays the Percent Complete Number label. The default value is false.

    • true

    • false

    AGTasksPopupTaskFlowID

    Specifies the content to display in the task pop-up.

    fully qualified TaskFlow ID

    AGDoneButtonLabel

    Use to configure label of the Done button with the values done, next activity, or next task. If you do not configure a value, then the property uses the default value Next Activity. Assigning a value that is not included in the possible values list causes an error.

    • AG_DONE

    • AG_NEXT_ACTIVITY

    • AG_NEXT_TASK


    Example 24-1 An activityguide.properties File

    ServerAuthenticationMethod=IDENTITY_PROPAGATION
    ServerConnectionMode=SOAP
    SelectionFilter=MY
    #AGInstanceOrdering=CREATION_DATE:ASC
    #ShowAllAGTreeNodesProperties=false
    #CustomPredicate1=abcd,EQ,abcd
    #AGInstanceID=#34
    #CustomPredicate2=CREATOR,EQ,jcooper
    

    If using identity propagation to secure the Activity Guide, then the properties WorkflowAdminUser and WorkflowAdminPassword are not required.

  6. To enable a task flow popup with summary information, include the following properties in the activityguide.properties file:

    AGTasksPopupTaskFlowID: Use this parameter to display a task flow summary in ADF dynamic regions. Enter the relevant task flow ID.

    If this parameter is not set then the popup shows the value of OutputText as the default task summary.

    If you provide an invalid task flow region ID, then the Guided Business Process does not render the region and logs a message in the server log.

  7. To enable a progress indicator in the Activity Guide UI:

    1. By default, the gauge is a simple bar. However, you can configure the progress indicator to display as ticks on the bar, percent complete or both.

      To enable tick marks, set the task flow parameter ShowGaugeTickMarks to true.

      To enable a percent complete label, set the task flow parameter ShowGaugePercentLabel to true.

      To enable both features, set both task flow parameters to true.

    2. The progress indicator shows the percentage of completion of a Guided Business Process. This value is computed based in the percentage weight you assigned to each milestone when you designed the SOA Composite.

  8. Configure the Activity Guide to display a refresh button in the Activity Guide tree., using the following alternative methods:

    • In the file activityguide.properties, add the parameter ShowRefreshButton. Set its value to true to enable the display of a refresh button, and false or any other value to disable the refresh button.

    • In the Activity Guide tree task flow, add the parameter ShowRefreshButton and set its value to true. This task flow parameter overrides the value of the parameter set in the activityguide.properties file.

      If the value of the ShowRefreshButton parameter is 'empty' or 'null', then the property ShowRefreshButton in the file activityguide.properties defines if the refresh button is shown. If the activityguide.properties file does not specify a value for this property then the refresh button is not shown in the client.

      Example 24-2 illustrates adding a ShowRefreshButton parameter to the tree task flow.

      Example 24-2 Add the ShowRefreshButton Parameter to the Tree Task Flow

      <taskFlow id="dynamicRegion1"
                    taskFlowId="${backingBeanScope.dynamicLeft.dynamicTaskFlowId}"
                    xmlns="http://xmlns.oracle.com/adf/controller/binding" >            
         <parameters>
            <parameter id="ShowRefreshButton" value="true”
                         xmlns="http://xmlns.oracle.com/adfm/uimodel"/>
         </parameters>
      </taskFlow> 
      
  9. Edit the file adfc-config.xml to include the location of the activity.properties file. This should be the absolute path to the activityguide.properties file.

    An example adfc-config.xml is shown in Example 24-3.

    Example 24-3 adfc-config.xml File with Reference to activityguide.properties File

    <managed-bean>
    <managed-bean-name>agProps</managed-bean-name>
    <managed-bean-class>oracle.bpel.activityguide.ui.beans.model.AGProperties</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>absAgPropsFileName</property-name>
    <property-class>java.lang.String</property-class>
    <value> C:\Projects\AG\activityguide.properties</value>
    </managed-property>
    </managed-bean>
    
  10. Create a Workflow Service client configuration file. An example is shown in Example 24-4.

    Example 24-4 Workflow Services Client Configuration File

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <workflowServicesClientConfiguration xmlns="http://xmlns.oracle.com/bpel/services/client">
       <server default="true" name="default">
          <localClient>
             <participateInClientTransaction>false</participateInClientTransaction>
          </localClient>
          <remoteClient>
             <serverURL>t3://host:7001</serverURL>
             <initialContextFactory>weblogic.jndi.WLInitialContextFactory</initialContextFactory>
             <participateInClientTransaction>false</participateInClientTransaction>
          </remoteClient>
          <soapClient>
             <rootEndPointURL>http://host: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>
    

24.2.2 What Happens When You Develop a Guided Business Process Application with Oracle ADF

A JDeveloper application with an ADF Web project is created. The application includes the following:

  • JSF page with two regions, one for the Activity Guide tree and the other for Activity Guide node details.

  • An activityguide.properties file.

24.2.3 What Happens at Run Time: How a Guided Business Process Application Is Developed with Oracle ADF

At run time, the Oracle ADF application displays the Guided Business Process developed at design time. A contextual event mechanism in the common ADF layer handles communication between the Activity Guide tree and Activity Guide node details, respectively.

When you click a Guided Business Process instance, the Activity Guide tree displays the information for the Activity Guides, milestones, and tasks in that Guided Business Process instance. Alternatively, the application can programmatically find and specify the Guided Business Process instance ID, and display the relevant instance and tree information.

When clicking a milestone node in the Activity Guide tree, it retrieves or refreshes the sub-tree beneath the milestone.

When clicking a task node in the Activity Guide tree, it displays detailed task information for the task.

24.3 Securing the Guided Business Process Client Application

Securing the Guided Business Process client application ensures that only users with proper credentials can complete the tasks outlined in the Guided Business Process. Security features include authentication, authorization, realm verification and policy enforcement.

To secure an ADF Guided Business Process Client Application, follow the instructions for securing a Web application described in the chapter "Enabling ADF Security in a Fusion Web Application" of Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

24.4 Guided Business Process Schemas and Software Components

Guided Business Process schemas and software components are as follows:

24.4.1 com.oracle.bpel.activityguide Package

The com.oracle.bpel.activityguide sub-package is used to manage Guided Business Process instances and enable the Guided Business Process metadata service.

This sub-package contains the following sub-packages:

  • schema: Guided Business Process instance, Guided Business Process definition, and Guided Business Process metadata service XSD and WSDL files.

  • instance: Guided Business Process instance management code.

  • metadata: Guided Business Process metadata service.

24.4.2 oracle.bpel.service.workflow.activityguide Package

The oracle.bpel.service.workflow.activityguide sub-package enables the Guided Business Process metadata and query services.

Guided Business Process Metadata Service

The Guided Business Process metadata service implementation is part of the SOA composite package com.oracle.bpel.activityguide.metadata. The Guided Business Process instance management code and the deployment manager in the SOA composite package make local Java calls to the Guided Business Process metadata service classes.

The Guided Business Process metadata service is also exposed as an EJB and web service so that it can be invoked from anywhere, similar to the Guided Business Process query service. The Guided Business Process metadata service is packaged in the same soa-infra-wls.ear file.

Guided Business Process Query Service

The Guided Business Process uses workflow services such as WorkflowServiceLocator, Ejbgenerator, and the EJB and web service configuration files.

The Guided Business Process query service is created in a sub-package of the workflow package, and is called oracle.bpel.services.workflow.activityguide.query.

This sub-package contains the following sub-packages:

  • bpelmetadata: Contains utility classes for interacting with the process analysis schema. Used for branching and future tasks.

  • client: Guided Business Process query service EJB and web service clients.

  • ejb: Guided Business Process query service EJB interfaces.

  • impl: Guided Business Process query service implementation.

  • model: Auto-generated Guided Business Process query service classes based on the XSD files.

  • soap: Guided Business Process query service web service interfaces.

24.5 Guided Business Process Run-time APIs

Guided Business Processes provide you a set of APIs that enable you to get details about the available milestones and the tasks that compose them. If the predefined Activity Guide ADF taskflows do not satisfy your requirements then you can use these APIs to obtain the information that you display in the client application.

24.5.1 Guided Business Process query Service API

This API is designed to support the following user navigation scenarios in an application displaying a Guided Business Process:

Display a list of Guided Business Process instances using a filter. Available filters are:

  • MY: Guided Business Process instances containing active tasks assigned to the user.

  • REPORTEES: Guided Business Process instances containing active tasks assigned to reportees to the current user.

  • PREVIOUS: Guided Business Process instances containing completed tasks assigned to the user, and instances in which a particular task is reassigned to another user.

  • CREATOR: Guided Business Process instances initiated by the user.

  • ADMIN: Guided Business Process instances visible to the Guided Business Process administrator. Active instances can be assigned to any user.

Note:

The BPMAGAdmin role maps to a user with an Administrator role assigned. This role enables the user to query for all the Guided Business Process instances available in the server, including completed, active, and instances with errors. The configuration file located in $DOMAIN_HOME/config/fmwconfig/system-jazn-data.xml contains the definition of this role.

Note:

The Guided Business Process APIs enables retrieving detailed task information by providing the task ID, but do not retrieve the task information. Other APIs, such as the Workflow service APIs, are required for this purpose.

For more information about Workflow services, see "Introduction to Human Workflow Services" in Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite.

Table 24-2 Guided Business Process Query Service API

Method Description

List queryAGDisplayInfos(String bpmProcessType,IWorkflowContext ctx,List agDisplayColumns,AGAssignmentFilter agAssignmentFilter,Predicate predicate,Ordering ordering,int startRow,int endRow)

Returns a list of AGDisplayInfo objects with fields defined in displayColumns, meeting the criteria defined by assignmentFilter and predicate, in the order specified by order, and with row numbers between startRow and endRow.

The AGDisplayInfo objects contain both metadata and run-time data of the Guided Business Process instances involved, which you can use to render the Guided Business Process instance views in Oracle BPEL Worklist or custom applications.

You can assign the String parameter bpmProcessType the following values:

  • IAGQueryService.AG_PROCESS_TYPE_BPM

  • IAGQueryService.AG_PROCESS_TYPE_BPEL

  • IAGQueryService.AG_PROCESS_TYPE_ANY

As milestones and tasks are not visible from the Activity Guide instance views, it is recommended not to include the MILESTONE_STATE column in displayColumns to avoid unnecessary performance overhead.

AGDisplayInfo getAGDisplayInfoDetailsById(String bpmProcessType,IWorkflowContext ctx,long ciKey,List taskDisplayColumns,String agAssignmentFilter)

Returns the AGDisplayInfo object specified by the Activity Guide instance ID.

The AGDisplayInfo object returned includes both milestone and task information, which you can use to render the Activity Guide tree structure in the custom application.

You can assign the String parameter bpmProcessType the following values:

  • IAGQueryService.AG_PROCESS_TYPE_BPM

  • IAGQueryService.AG_PROCESS_TYPE_BPEL

  • IAGQueryService.AG_PROCESS_TYPE_ANY

The String parameter agAssignmentFilter enables specifying a filter for this method. The following IAGQueryService parameters can be used as values this parameter:

  • IAGQueryService.AGASSIGNMENT_FILTER_MY

  • IAGQueryService.AGASSIGNMENT_FILTER_REPORTEES

  • IAGQueryService.AGASSIGNMENT_FILTER_CREATOR

  • IAGQueryService.AGASSIGNMENT_FILTER_PREVIOUS

  • IAGQueryService.AGASSIGNMENT_FILTER_ADMIN

MilestoneDisplayInfo getMilestoneDisplayInfo(String bpmProcessType,IWorkflowContext ctx,long cikey,String milestoneName,List taskDisplayColumns,String agAssignmentFilter)

Returns the display information for a milestone in an Activity Guide instance.

The MilestoneDisplayInfo object returned contains the metadata and run-time data of the specified milestone and the tasks in the milestone. You can use these to refresh the milestone sub-tree in a custom application when an end-user clicks the milestone.

You can assign the String parameter bpmProcessType the following values:

  • IAGQueryService.AG_PROCESS_TYPE_BPM

  • IAGQueryService.AG_PROCESS_TYPE_BPEL

  • IAGQueryService.AG_PROCESS_TYPE_ANY

The String parameter agAssignmentFilter enables specifying a filter for this method. The following IAGQueryService parameters can be used as values for this parameter:

  • IAGQueryService.AGASSIGNMENT_FILTER_MY

  • IAGQueryService.AGASSIGNMENT_FILTER_REPORTEES

  • IAGQueryService.AGASSIGNMENT_FILTER_CREATOR

  • IAGQueryService.AGASSIGNMENT_FILTER_PREVIOUS

  • IAGQueryService.AGASSIGNMENT_FILTER_ADMIN


24.5.2 JNDI Names for the Guided Business Process Enterprise Java Beans

The following table describes the JNDI names for the Guided Business Process Enterprise Java Beans.

Service Name JNDI Names for the Enterprise JavaBeans
Activity Guide MetaData Store ejb/bpel/services/workflow/AGMetadataService
Activity Guide Query Service ejb/bpel/services/workflow/AGQueryService

24.6 Developing an Example of a User Interface for Guided Business Process Tasks Using Guided Business Process Run-Time Services

APIs enable accessing the Guided Business Process query and Metadata Services from within a custom application.

The following example illustrates the use of Java APIs to access Guided Business Process run-time services:

Example 24-5 Accessing the Guided Business Process Run-Time Service Using EJB

package client;
import com.oracle.bpel.activityguide.metadata.definition.model.AGDefinition;
import java.util.ArrayList;
import java.util.List;
import oracle.bpel.services.workflow.IWorkflowConstants;
import oracle.bpel.services.workflow.task.model.Task;
import oracle.bpel.services.workflow.verification.IWorkflowContext;
import oracle.bpel.services.workflow.client.IWorkflowServiceClient;
import oracle.bpel.services.workflow.client.IWorkflowServiceClientConstants;
import oracle.bpel.services.workflow.client.WorkflowServiceClientFactory;
import oracle.bpel.services.workflow.query.ITaskQueryService;
import oracle.bpel.services.workflow.query.impl.TaskQueryService;
import oracle.bpel.services.workflow.client.WorkflowServiceClientContext;
import oracle.bpel.services.workflow.metadata.config.ResourceBundleInfo;
import oracle.bpel.services.workflow.activityguide.query.IAGQueryService;
import oracle.bpel.services.workflow.activityguide.query.impl.AGQueryService;
import oracle.bpel.services.workflow.activityguide.query.model.AGDisplayInfo;
import oracle.bpel.services.workflow.activityguide.query.model.MilestoneDisplayInfo;
import oracle.bpel.services.workflow.activityguide.metadata.IAGMetadataService;
import oracle.bpel.services.workflow.activityguide.metadata.impl.AGMetadataService;
import sun.security.util.Password;
public class AGServiceSampleCode {
 
    private static String USERNAME = "jcooper";
    private static String PASSWORD = "welcome1";
    private static String REALM = "jazn.com";
    private static IWorkflowServiceClient wfSvcClient;
    private static IWorkflowContext sJCooperCtx;
 
    public static void main(String[] args) 
    {
        try {
 
            testSetUp();
           
            // GetAGDefinition API requires an AG instance as input, which is not easily accessible in customer's env.
            // As a result, the sample code for invoking this API is not provided.
            //testGetAGDefinition();
 
            testGetAGDefinitionById();
            testGetAGResourceBundleInfo();
 
            testQueryAGDisplayInfos();
            testQueryAGDisplayInfoDetailsById();
            testQueryAGMilestoneDisplayInfo();
                
        } catch (Exception e) {
 
            e.printStackTrace();
        }
    }
 
    private static void testSetUp()
        throws Exception
    {
        wfSvcClient =
                WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT); 
 
        sJCooperCtx =
            wfSvcClient.getTaskQueryService().authenticate(USERNAME, PASSWORD, REALM, null);
    }
 
    private static void testGetAGDefinitionById()
        throws Exception
    {
        String agDefinitionId = "HelpDeskRequestSCAApp/HelpDeskRequestComposite!1.0*2007-10-22_13-32-50_536//HelpDeskRequestProcess//HelpDeskRequestProcess.ag"; // Need to supply a valid AG definition id here
 
        AGDefinition agDefinition = 
            wfSvcClient.getAGMetadataService().getAGDefinitionById (sJCooperCtx, agDefinitionId);
 
        if (agDefinition != null)
        {
            System.out.println("ag def obtained");
            System.out.println("ag def name: " + agDefinition.getName());
            System.out.println("ag def milestone display mode: " + agDefinition.getMilestoneDisplayMode());
        }
    }
 
    private static void testGetAGResourceBundleInfo()
        throws Exception
    {
        String agDefinitionId = "HelpDeskRequestSCAApp/HelpDeskRequestComposite!1.0*2007-10-22_13-32-50_536//HelpDeskRequestProcess//HelpDeskRequestProcess.ag"; // Need to supply a valid AG definition id here
 
        ResourceBundleInfo resourceBundleInfo = wfSvcClient.getAGMetadataService().getResourceBundleInfo(sJCooperCtx, agDefinitionId, sJCooperCtx.getLocale());
 
        System.out.println("bundle name: " + resourceBundleInfo.getName());
    }
 
    private static void testQueryAGDisplayInfos()
        throws Exception
    {
        List agQueryColumns = new ArrayList();
        agQueryColumns.add("MILESTONE_STATE");     
        agQueryColumns.add("DEFINITION_ID");
 
        // Query for all AG instances belonging to user jcooper
        List agDisplayInfoList = 
              wfSvcClient.getAGQueryService().queryAGDisplayInfos(sJCooperCtx, 
                                                                  agQueryColumns,
                                                                  IAGQueryService.AGAssignmentFilter.MY,
                                                                  null, //agPredicate,
                                                                  null, //ordering,
                                                                  0,
                                                                  0);
                
        System.out.println("ag display info list size:" +  agDisplayInfoList.size());
        if ( agDisplayInfoList.size() > 0 )
        {
            AGDisplayInfo agDisplayInfo =  (AGDisplayInfo) agDisplayInfoList.get(0);
            System.out.println("AG title:" +  agDisplayInfo.getTitle());
            System.out.println("milestone display info list size:" +  agDisplayInfo.getMilestoneDisplayInfo().size());
            for (int i=0; i< agDisplayInfo.getMilestoneDisplayInfo().size(); i++)
            {
                System.out.println("i = " + i + " milestone display info:" + ((MilestoneDisplayInfo) agDisplayInfo.getMilestoneDisplayInfo().get(i)).getMilestoneInstance().getName());
            }
        }
    }
 
    private static void testQueryAGDisplayInfoDetailsById()
        throws Exception
    {
        long cikey = 1; // Need to supply a valid AG cikey here
 
        List taskQueryColumns = new ArrayList();
        taskQueryColumns.add("TASKID");
        taskQueryColumns.add("TITLE");
        taskQueryColumns.add("OUTCOME");
 
        AGDisplayInfo agDisplayInfo = 
              wfSvcClient.getAGQueryService().getAGDisplayInfoDetailsById (sJCooperCtx, cikey, taskQueryColumns);
        System.out.println("AG display info status:" +  agDisplayInfo.getAGInstanceInfo().getStatus());
        System.out.println("AG display info bpel status:" +  agDisplayInfo.getAGInstanceInfo().getBpelStatus());
    }
 
    private static void testQueryAGMilestoneDisplayInfo()
        throws Exception
    {
        long cikey = 1; // Need to supply a valid AG cikey here
        String milestoneName = "ApprovePricing"; //  Need to supply a valid AG milestone name here
 
        List taskQueryColumns = new ArrayList();
        taskQueryColumns.add("TASKID");
        taskQueryColumns.add("TITLE");
        taskQueryColumns.add("OUTCOME");
 
        MilestoneDisplayInfo milestoneDisplayInfo = null;
 
        milestoneDisplayInfo = 
            wfSvcClient.getAGQueryService().getMilestoneDisplayInfo (sJCooperCtx, cikey, milestoneName, taskQueryColumns);
 
        System.out.println("milestone display info name:" +  milestoneDisplayInfo.getMilestoneInstance().getName());
        System.out.println("milestone display info title:" +  milestoneDisplayInfo.getTitle());
        System.out.println("milestone display info task list size:" +  milestoneDisplayInfo.getTask().size());
    }
 
}

For more information regarding the EJB and Web Service APIS, see the Javadoc.

24.7 Using Guided Business Process Logging

Guided Business Processes use a log file to store information about the different operations they perform. This file contains log messages that track the application behavior and possible errors that might occur while running the application.

You can use the information in this log file to find out the cause of an unexpected behavior in your application.

The importance of the log messages varies according to their level. The level of the messages used for debugging purposes is different to the level of the messages that contain warnings or errors.

You can configure Guided Business Process Logging to log only certain level of messages according to your needs.

24.7.1 How to Enable Client Side Logging

You can configure Guided Business Processes to generate a log file on the client side.

To enable client side logging:

  1. Locate the logging.xml file in the directory <DOMAIN_HOME>/config/fmwconfig/servers/AdminServer

  2. Open the logging.xml file for editing.

  3. Add the following entry in the <loggers> element:

    <logger name="oracle.bpel.activityguide.ui" level="NOTIFICATION:1" useParentHandlers='false'>

    <handler name="old-handler"/>

    </logger>

  4. Save the changes.

  5. Re-start Web Logic Server.

24.7.2 How to Enable Server-Side Logging

You can configure Guided Business Processes to generate a log on the server side.

To enable server-side logging:

  1. Locate the logging.xml file in the directory <DOMAIN_HOME>/config/fmwconfig/servers/AdminServer

  2. Open the logging.xml file for editing.

  3. Add the following entry in the <loggers> element:

    <logger name="oracle.soa.services.workflow.ag" level="NOTIFICATION:1" useParentHandlers='false'>

    <handler name="oracle-soa-handler"/>

    </logger>

  4. Save the changes.

  5. Re-start Web Logic Server.

24.7.3 Configuring Log Levels

Log messages contain a level that identifies the severity of the problem.

Table 28-3 shows the available log levels. The Severity column describes the common term used to identify a certain severity. The Log Level Value common specifies the value that you must use in the logging.xml file.

Table 24-3 Log Level Values

Severity Log Level Value Description

Fatal

INCIDENT_ERROR:1

Indicates a serious problem caused by unknown reasons. Users cannot fix the problem by themselves, they must contact Oracle Support.

Severe

ERROR:1

Indicates a serious problem that requires immediate attention from the System Administrator

Warning

WARNING:1

Indicates a potential problem. The System Administrator should review these log messages.

Information

NOTIFICATION:1

Indicates a major lifecycle event such as the activation or deactivation of a primary sub-component or feature.

Configuration

NOTIFICATION:16

Specifies a normal event occurred at a lower level.

Fine

TRACE:1

Specifies trace or debug information for events that are meaningful to end users of the product, such as public API entry/exit points.

Finer

TRACE:16

Specifies a detailed trace or debug information that can help Oracle Support diagnose problems with a particular subsystem.


You can configure Guided Business Process Logging to specify the level of detail of the information stored in the Guided Business Process logs.

To set the log level must change the value of the attribute level in the logger element in the logging.xml file.

When you set the log level to a certain severity, all the messages that correspond to higher severities are also stored. For example, if you set the log level to severe, then the log messages of severity fatal are also logged.

24.7.4 How to View Guided Business Process Log Messages

Log messages are stored in the following file: <DOMAIN HOME>/servers/<Server Name>/logs/DefaultServer-diagnostic.log

You can view the file that contains the log messages using a text editor.

24.7.5 Understanding Guided Business Process Log Messages

A log message contains information that helps you identify the problems in your Guided Business Process application.

Table 28-3 describes the items that compose a log message.

Table 24-4 Log Message Items

Log Message Item Description

Date and Time

Specifies the date and time when this log message was generated.

Message Type

Specifies the severity of the message.

Execution Context ID (ECID)

A global unique identifier and a sequence number that correspond to the thread where the originating component is running. You can use it to correlate messages from multiple components that may be involved in the same thread.

Application Name

Specifies the name of the application that generated the log message.

Class Package Name

Specifies the package of the class that generated the log message.

Message ID

Specifies a short identifier that uniquely identifies the message.

Message Text

Describes the event. This message is localized, thus it displays in the language that corresponds to the locale of your system.


When you read a log file you must look for the message text, this text describes what happened. The message type helps you identify how serious the problem is. For more information about the different message types, see Table 24-3.

You can use the date and time of the log message to identify the action that caused the problem.

Note:

before contacting Oracle Support make sure you can provide them the message ID and the execution context ID.

Example 24-6 Log Message Example

DefaultServer-diagnostic.log:[2009-07-10T17:39:35.220-07:00] [DefaultServer] [NOTIFICATION] [AGU-12605] [oracle.bpel.activityguide.ui.beans] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: jstein] [ecid: 0000I9bG2R3DScQ6ube9UH1ALxd1000007,0] [APP: AGNonUIshellApp#V2.0] [arg: jstein] Setting user, jstein as the loginUserId in server interfacing bean.[[

Example 28-12 shows a notification log message that contains information about a loginUserId change. In this example the different log message items are:

  • Date and Time: 2009-07-10T17:39:35.220-07:00

  • Message Type: NOTIFICATION

  • Execution Context ID: ecid: 0000I9bG2R3DScQ6ube9UH1ALxd1000007,0

  • Application Name: APP: AGNonUIshellApp#V2.0

  • Class Package Name: oracle.bpel.activityguide.ui.beans

  • Message ID: AGU-12605

  • Message Text: Setting user, jstein as the loginUserId in server interfacing bean.