Thursday, July 29, 2010

Oracle SOA 11g Human Task Query Service Remote Client

In my previous post I provided a link which has a sample code which uses the ITaskQueryService to query and act upon Human Tasks. The sample code provided over there used SOAP_CLIENT to establish connection to the server but if you wish to use the REMOTE_CLIENT below is the code snippet.


           WorkflowServicesClientConfigurationType wscct =
                new WorkflowServicesClientConfigurationType();
            wscct.setClientType(WorkflowServiceClientFactory.REMOTE_CLIENT);
            List servers = wscct.getServer();
            ServerType server1 = new ServerType();
            server1.setDefault(true);
            server1.setName("HcmSOAServer");
            servers.add(server1);

          
            RemoteClientType rct1 = new RemoteClientType();
            rct1.setServerURL("t3://ss-cmpq02.us.oracle.com:8001");
            rct1.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
            rct1.setParticipateInClientTransaction(false);
            server1.setRemoteClient(rct1);

            IWorkflowServiceClient client =
                WorkflowServiceClientFactory.getWorkflowServiceClient(wscct, null);
            ITaskService taskSvc = client.getTaskService();
            ITaskQueryService taskQuerySvc = client.getTaskQueryService();          
            IWorkflowContext ctx = taskQuerySvc.authenticate("employee", "Welcome1".toCharArray(), "jazn.com");

No comments: