How to Develop a Guided Business Process Client Application

Building a Guided Business Process Client Application 25-9

25.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. 25.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 25–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; MilestoneDisplayInfo getMilestoneDisplayIn foString bpmProcessType,IWorkf lowContext ctx,long cikey,String milestoneName,List taskDisplayColumns,St ring 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_PREVIOUS ■ IAGQueryService.AGASSIGNMENT_FILTER_ADMIN Service Name JNDI Names for the Enterprise JavaBeans Activity Guide MetaData Store ejbbpelservicesworkflowAGMetadataService Activity Guide Query Service ejbbpelservicesworkflowAGQueryService Table 25–1 Cont. Guided Business Process Query Service API Method Description 25-10 Modeling and Implementation Guide for Oracle Business Process Management 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 mainString[] args { try { testSetUp; GetAGDefinition API requires an AG instance as input, which is not easily accessible in customers 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.getWorkflowServiceClientWorkflowServiceClientFactory .REMOTE_CLIENT; sJCooperCtx = wfSvcClient.getTaskQueryService.authenticateUSERNAME, PASSWORD, REALM, null; } private static void testGetAGDefinitionById Building a Guided Business Process Client Application 25-11 throws Exception { String agDefinitionId = HelpDeskRequestSCAAppHelpDeskRequestComposite1.02007-10-22_13-32-50_ 536HelpDeskRequestProcessHelpDeskRequestProcess.ag; Need to supply a valid AG definition id here AGDefinition agDefinition = wfSvcClient.getAGMetadataService.getAGDefinitionById sJCooperCtx, agDefinitionId; if agDefinition = null { System.out.printlnag def obtained; System.out.printlnag def name: + agDefinition.getName; System.out.printlnag def milestone display mode: + agDefinition.getMilestoneDisplayMode; } } private static void testGetAGResourceBundleInfo throws Exception { String agDefinitionId = HelpDeskRequestSCAAppHelpDeskRequestComposite1.02007-10-22_13-32-50_ 536HelpDeskRequestProcessHelpDeskRequestProcess.ag; Need to supply a valid AG definition id here ResourceBundleInfo resourceBundleInfo = wfSvcClient.getAGMetadataService.getResourceBundleInfosJCooperCtx, agDefinitionId, sJCooperCtx.getLocale; System.out.printlnbundle name: + resourceBundleInfo.getName; } private static void testQueryAGDisplayInfos throws Exception { List agQueryColumns = new ArrayList; agQueryColumns.addMILESTONE_STATE; agQueryColumns.addDEFINITION_ID; Query for all AG instances belonging to user jcooper List agDisplayInfoList = wfSvcClient.getAGQueryService.queryAGDisplayInfossJCooperCtx, agQueryColumns, IAGQueryService.AGAssignmentFilter.MY, null, agPredicate, null, ordering, 0, 0; System.out.printlnag display info list size: + agDisplayInfoList.size; if agDisplayInfoList.size 0 { AGDisplayInfo agDisplayInfo = AGDisplayInfo agDisplayInfoList.get0; System.out.printlnAG title: + agDisplayInfo.getTitle; System.out.printlnmilestone display info list size: + agDisplayInfo.getMilestoneDisplayInfo.size; for int i=0; i agDisplayInfo.getMilestoneDisplayInfo.size; i++