Using Java APIs for Oracle Human Workflows

In continuation of my previous blogpost where I had discussed how we can use the web service APIs for Human Workflow components in Oracle SOA Suite 11g this blog will discuss how we can use the JAVA API’s to query and interact with worklist task items.

The earlier blog post can be viewed here

https://beatechnologies.wordpress.com/2011/08/22/oracle-human-workflow-web-service-apis/

As previously discussed Oracle SOA Suite 11g has workflow API’s implemented both in JAVA as well as standard soap based web services. In some obvious cases there might be need to write some client side java code to interact with the workflow components.

Similar to the web service API’s I will talk about the two Java classes that is to be used for the purpose.

ITaskQueryService

This class provides a programmatic means for retrieving tasks, task details etc. To use this class to get access to task information and details we typically have to do the following

  • Write a remote client to connect to the remote SOA Suite server from the java class and get a client object.
  • Use an authentication method to authenticate a user and obtain an authenicated workflow context from the remote client object.
  • Use the obtained workflow context and a task list method to retrieve tasks that match some filter criterion viz taskNumber as displayed on the worklist page or taskStatus.
  • Use the context and a task details method to drill down on a task in the list (retrieve task details and actions that can be performed on the task)

ITaskService

The ITaskService class can be used to perform operations client operations on the task like adding/removing documents and comments, withdrawing/reassigning tasks, deleting/purging tasks etc.

The ITaskService uses the task query service to look up to a specific task and then do task operations on to them.

Writing the Java Client

I had followed the below steps to create a java client from the workflow classes.

Created a Java Project in JDeveloper and called it HumanTaskAPI. The libraries that have to be added to this project is shown below

image

Next create a class called TaskAuthenticationClient that would create a client object for the remote workflow service by looking up the server JNDI and also create a remote context for both the ITaskQueryService and ITaskService.

Here is the code snippet containing the explanatory comments along with it

package blog.oracletechnologies.sales;

import java.util.HashMap;
import java.util.Map;

import oracle.bpel.services.workflow.WorkflowException;
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.task.ITaskService;

public class TaskAuthenticationClient {
public TaskAuthenticationClient() {
super();
}

public IWorkflowServiceClient getWorkflowServiceContext () throws WorkflowException {

//Create WorflowServiceClient by looking up to the service JNDI
String domainUrl ="t3://localhost:4003"; // host:port of the soa server
Map<IWorkflowServiceClientConstants.CONNECTION_PROPERTY, String> connProperties = new HashMap<IWorkflowServiceClientConstants.CONNECTION_PROPERTY, String>();
connProperties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.CLIENT_TYPE,WorkflowServiceClientFactory.REMOTE_CLIENT);
connProperties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL,domainUrl);
connProperties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
IWorkflowServiceClient workflowServiceClient = WorkflowServiceClientFactory.getWorkflowServiceClient(connProperties, null, null);
return workflowServiceClient;
}

//Get the task query service handle
public ITaskQueryService getTaskQueryServiceRemoteContext () throws WorkflowException {
ITaskQueryService taskQueryService = getWorkflowServiceContext().getTaskQueryService();
return taskQueryService;
}

public ITaskService getTaskServiceRemoteContext () throws WorkflowException {
//Get the task service handle
ITaskService taskService = getWorkflowServiceContext().getTaskService();
return taskService;
}
}

Next create a class TaskQueryServiceClient that has two methods viz queryWorklistTasks() and getTaskDetailsByNumber()  that fetches task details from the soa workflow component.

The queryWorklistTask() operation accepts tow inputs objects. One is a Predicate object that determines what tasks need to be queried, the ordering and paging of result etc. The other input is a list of queryColumns that determines which columns in the task detail will be part of the output Task object.

The complete Class with a main() is copied below

package blog.oracletechnologies.sales;

import java.io.StringWriter;

import java.util.ArrayList;
import java.util.List;

import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import oracle.bpel.services.workflow.IWorkflowConstants;
import oracle.bpel.services.workflow.WorkflowException;
import oracle.bpel.services.workflow.query.ITaskQueryService;
import oracle.bpel.services.workflow.repos.Predicate;
import oracle.bpel.services.workflow.repos.TableConstants;
import oracle.bpel.services.workflow.task.model.Task;
import oracle.bpel.services.workflow.verification.IWorkflowContext;

import org.w3c.dom.Element;

public class TaskQueryServiceClient {
public TaskQueryServiceClient() {
super();
}

public static IWorkflowContext getWorkflowContext () throws WorkflowException {
return getTaskQueryService().authenticate("weblogic", "welcome123".toCharArray(), null);
}
public static ITaskQueryService getTaskQueryService () throws WorkflowException {
TaskAuthenticationClient authenticationClient = new TaskAuthenticationClient();
ITaskQueryService taskQueryService =authenticationClient.getTaskQueryServiceRemoteContext();
return taskQueryService;
}
public static Predicate getTaskPredicate () throws WorkflowException {
Predicate statePredicate=  new Predicate(TableConstants.WFTASK_STATE_COLUMN,Predicate.OP_EQ,IWorkflowConstants.TASK_STATE_ASSIGNED);
return statePredicate;
}
public static List<String> getTaskQueryColumns () throws WorkflowException {
// Set up list of columns to query. Also remember that only these columns will be fetched in taskQuery.
List<String> queryColumns = new ArrayList<String>();
queryColumns.add("TASKNUMBER");
queryColumns.add("TASKID");
queryColumns.add("TASKNUMBER");
queryColumns.add("TITLE");
queryColumns.add("OUTCOME");
queryColumns.add("STATE");
queryColumns.add("PRIORITY");
return queryColumns;
}

public void queryWorklistTasks(Predicate statePredicate, List<String> queryColumns) throws WorkflowException
{
//Query a list of tasks - list of Task objects
List taskList = getTaskQueryService().queryTasks(getWorkflowContext(),
queryColumns, //Custom Defined QueryColumns list
null, // Do not query additional info
ITaskQueryService.AssignmentFilter.MY_AND_GROUP,
null, //No keywords
statePredicate, //Custom Defined Predicate
null, // No Task Ordering ordering
0,0);  // Do not page the query result
// Print exisiting Assigned tasks
if (taskList != null)
{
System.out.println("Result of queryTask Opeartion");
System.out.println("Total number of tasks: " + taskList.size());
System.out.println("Tasks List: ");
Task task = null;
for (int i = 0; i < taskList.size(); i++)
{
task = (Task) taskList.get(i);
System.out.println("Task Number: " + task.getSystemAttributes().getTaskNumber());
System.out.println("Task Id: " + task.getSystemAttributes().getTaskId());
System.out.println("Title: " + task.getTitle());
System.out.println("Priority: " + task.getPriority());
System.out.println("State: " + task.getSystemAttributes().getState());
}
}
}
public void getTaskDetailsByNumber(String taskNumber) throws WorkflowException,TransformerConfigurationException,TransformerException {
// Query a list of tasks - list of Task objects
Task task = getTaskQueryService().getTaskDetailsByNumber(getWorkflowContext(),Integer.valueOf(taskNumber));
// Print exisiting Assigned tasks
System.out.println("Result of getTaskDetailsByNumber Opeartion");
System.out.println("Task Number: " + task.getSystemAttributes().getTaskNumber());
System.out.println("Task Id: " + task.getSystemAttributes().getTaskId());
System.out.println("Title: " + task.getTitle());
System.out.println("Priority: " + task.getPriority());
System.out.println("State: " + task.getSystemAttributes().getState());
// This allows we to get the task payload (task data specific to our application). This is in XML format
List list = task.getPayload().getContent();
System.out.println("Task Payload : ");
for (int i = 0; i < list.size(); i++)
{
Element taskDetails = (Element) list.get(i);
printElement(taskDetails);
}
}
 public static void  printElement (Element element) throws TransformerConfigurationException,TransformerException
 {
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer();
StringWriter buffer = new StringWriter();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.transform(new DOMSource(element),new StreamResult(buffer));
String str = buffer.toString();
System.out.println(str);
}
public static void main (String args[]) throws WorkflowException,TransformerConfigurationException,TransformerException
{
TaskQueryServiceClient taskQueryClient = new TaskQueryServiceClient();
taskQueryClient.queryWorklistTasks(getTaskPredicate(),getTaskQueryColumns());
taskQueryClient.getTaskDetailsByNumber("200783");
}
}

Running the java class will print the result of the task in the output console.

image

Finally the last thing that this article will show is a simple demonstration of how we can update an existing task with some extra comment. For this we would first need to fetch/query the specific task and use the ITaskService  class object to add an additional comment in the task.

Below is the TaskUpdateServiceClient class that has an addCommentToTask() method that takes a taskNumber as input and adds a user comment to it. This is very similar that we did with the Web service API.

The class also contains a main() method so that it can be run as a standalone class. Run the class and verify whether the comment has been added to the task comment section in the task.

package blog.oracletechnologies.sales;

import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;

import oracle.bpel.services.workflow.StaleObjectException;
import oracle.bpel.services.workflow.WorkflowException;
import oracle.bpel.services.workflow.task.ITaskService;
import oracle.bpel.services.workflow.task.model.Task;

public class TaskUpdateServiceClient {
public TaskUpdateServiceClient() {
super();
}

public static ITaskService getTaskService() throws WorkflowException
{
TaskAuthenticationClient authenticationClient =new TaskAuthenticationClient();
ITaskService taskService =authenticationClient.getTaskServiceRemoteContext();
return taskService;
}

public void addCommentToTask(String taskNumber) throws TransformerConfigurationException,TransformerException,WorkflowException,StaleObjectException
{
TaskQueryServiceClient taskQueryScvClient = new TaskQueryServiceClient();
Task task = taskQueryScvClient.getTaskQueryService().getTaskDetailsByNumber
(taskQueryScvClient.getWorkflowContext(),Integer.valueOf(taskNumber));

if (task != null)
{
TaskAuthenticationClient authenticationClient =new TaskAuthenticationClient();
authenticationClient.getTaskServiceRemoteContext().addComment(taskQueryScvClient.getWorkflowContext(), task, "Comment Added From Java Client");
}

}
public static void main (String args[]) throws WorkflowException,TransformerConfigurationException,TransformerException,StaleObjectException {
TaskUpdateServiceClient taskUpdateServiceClient = new TaskUpdateServiceClient();
taskUpdateServiceClient.addCommentToTask("200783");
}
}

image

As you can see in the screenshot above that the comment that we added from the Java client reflects in the task detail page of the worklist user interface.

The ITaskQueryService and ITaskService offers an large set of methods that can be used further to exhaustively query and interact with worklist tasks in the Human Workflow component.

The JDeveloper Java project used in this article can be downloaded from here.

Another important note is that if you plan to use the code in the examples above make sure to handle and throw errors judiciously by having a suitable try-catch mechanism.

.

18 thoughts on “Using Java APIs for Oracle Human Workflows

  1. First of all thank you for this wonderful post.
    I am using BPM 11.1.1.6 and have used your example to get an handle to the list of attachments that is attached as part of process instance. My requirement is to read the contents of the attachment and do some parsing. But I am getting a peculiar error , the scenario is as under:

    As an initiator, I attach an attachment and run the sample code snippet below under the credentials of the initator or “weblogic” and I am getting a message “You do not have permission to view the attachment” , in the server console I am getting the following message:
    < Could not get stream for task attachment:

    I am able to view the same attached file when I view it from the workspace logged in as initiator or “weblogic”. Is this a product bug or is their any different way to handle this. I am using the WorkflowAttachmentUtil.getAttachment because attachmenttype.getInputStream() returned null.

    Any pointers would be really appreciated.

    Sample Code snippet:

    String taskID=task.getSystemAttributes().getTaskId();
    String domainUrl =”http://localhost:8001″; // host:port of the soa server
    List attach= task.getAttachment();
    int i=0;
    for (Object obj :attach){
    i=i+1;
    AttachmentType taskAttachment = (AttachmentType)obj;
    int xVersion=taskAttachment.getVersion();
    String xFile=taskAttachment.getName();
    System.out.println(“Task Attachment ” + i + ” ” + taskAttachment.getName());
    System.out.println(“Task Attachment Version” + i + ” ” + taskAttachment.getVersion());

    InputStream in = WorkflowAttachmentUtil.getAttachment(
    getWorkflowContext(), // context
    domainUrl, // SOA URL
    taskID, // task id
    xVersion, // attachment version
    xFile, // file name
    null); // logger

    Regards
    Venkat

    Like

  2. Hi Arun,
    I am getting the following exception while running this application.

    Exceptionoracle.bpel.services.workflow.client.WorkflowServiceClientException: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.io.EOFException

    can you please help me to get out of this.

    Like

  3. Hi Arun,

    This was extremely helpful. But when tried to adopt this to my scenario, I m getting an exception.

    When I tried to access TaskQueryServiceClient from an external java class, and pass task number to it,
    I got this exception.

    Migrate workflow client configuration file wf_client_config.xml to new schema
    Use utility: java -classpath wsclient_extended.jar:bpm-services.jar \
    oracle.bpel.services.workflow.client.config.MigrateClientConfiguration []
    Exception in thread “main” oracle.bpel.services.workflow.client.WorkflowServiceClientException: javax.xml.bind.UnmarshalException: unexpected element (uri:”http://xmlns.oracle.com/bpel/services/client”, local:”servicesClientConfigurations”). Expected elements are
    at oracle.bpel.services.workflow.client.config.ClientConfigurationUtil.getClientConfiguration(ClientConfigurationUtil.java:371)
    at oracle.bpel.services.workflow.client.WorkflowServiceClientContext.(WorkflowServiceClientContext.java:214)
    at oracle.bpel.services.workflow.client.WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.java:261)
    at oracle.bpel.services.workflow.client.WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.java:339)
    at client.taskflow.TaskAuthenticationClient.getWorkflowServiceContext(TaskAuthenticationClient.java:43)
    at client.taskflow.TaskAuthenticationClient.getTaskQueryServiceRemoteContext(TaskAuthenticationClient.java:57)
    at client.taskflow.TaskQueryServiceClient.getTaskQueryService(TaskQueryServiceClient.java:48)
    at client.taskflow.TaskQueryServiceClient.queryWorklistTasks(TaskQueryServiceClient.java:71)
    at client.taskflow.TaskQueryServiceClient.getPayload(TaskQueryServiceClient.java:153)
    at client.WorklistClient.main(WorklistClient.java:144)
    Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:”http://xmlns.oracle.com/bpel/services/client”, local:”servicesClientConfigurations”). Expected elements are
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:642)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:254)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:249)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1049)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:478)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:459)
    at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:133)
    at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:173)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:211)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:184)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
    at oracle.bpel.services.workflow.client.config.ClientConfigurationUtil.getClientConfiguration(ClientConfigurationUtil.java:365)
    … 9 more
    Process exited with exit code 1.

    Kindly help.
    Thanks,
    Archana

    Like

  4. Pingback: Functional Testing Business Processes In Oracle BPM Suite 11g | Oracle Technologies Premier

  5. Hi Arun,

    Assume that we have already logged in to portal and authenticated. To get all the assigned task it seems that we need to authenticate one more time for getting list of tasks. Instead of hard coding user name/password. Is it possible we can pass only username/SSO/ another ways around.

    return getTaskQueryService().authenticate(“weblogic”, “welcome123”.toCharArray(), null);

    Please advise me.

    Thanks,
    Meera Hussain

    Like

    • Hi Meera,

      The Oracle Human Workflow API’s can accept SAML based tokens for authentication and in most real cases this is indeed how it is used.

      You can more specifically look for examples on that regard.

      Hope that helps.

      Cheers

      Like

  6. Pingback: Functional Testing Business Processes In Oracle BPM Suite 11g | Rubicon Red

  7. Hi This Hari,
    I’m getting Invalid Token Error

    if you any Idea on this error can you reply immediatly

    ORABPEL-30503

    Invalid Token Error in Verification Service.
    Invalid Token Error in Verification Service. Received invalid token in null.
    Verify that correct token is passed.

    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
    at oracle.bpel.services.workflow.query.ejb.TaskQueryService_oz1ipg_EOImpl_1036_WLStub.queryTasks(Unknown Source)
    at oracle.bpel.services.workflow.query.client.TaskQueryServiceRemoteClient.queryTasks(TaskQueryServiceRemoteClient.java:849)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.bpel.services.workflow.client.WFClientRetryInvocationHandler.invokeTarget(WFClientRetryInvocationHandler.java:144)
    at oracle.bpel.services.workflow.client.WFClientRetryInvocationHandler.invoke(WFClientRetryInvocationHandler.java:82)
    at $Proxy14.queryTasks(Unknown Source)
    at com.atc.pw.util.ChangeTaskStatus.getTaskList(ChangeTaskStatus.java:76)
    at com.atc.pw.util.ChangeTaskStatus.main(ChangeTaskStatus.java:30)
    Caused by: java.lang.Exception: Null token
    at oracle.bpel.services.workflow.verification.impl.VerificationService.validateContextToken(VerificationService.java:1769)
    at oracle.bpel.services.workflow.verification.impl.VerificationService.validateContext(VerificationService.java:1662)
    at oracle.bpel.services.workflow.verification.impl.VerificationService.validateContext(VerificationService.java:1969)
    at sun.reflect.GeneratedMethodAccessor2954.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at oracle.bpel.services.workflow.common.WorkflowServiceCacheEventAdvice.invoke(WorkflowServiceCacheEventAdvice.java:91)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy482.validateContext(Unknown Source)
    at oracle.bpel.services.workflow.query.impl.TaskQueryService.queryTasks(TaskQueryService.java:849)
    at sun.reflect.GeneratedMethodAccessor4325.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at oracle.bpel.services.workflow.common.WorkflowServiceCacheEventAdvice.invoke(WorkflowServiceCacheEventAdvice.java:91)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at oracle.bpel.services.workflow.test.workflow.ExceptionTestCaseBuilder.invoke(ExceptionTestCaseBuilder.java:155)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at oracle.bpel.services.common.dms.MethodEventAspect.invoke(MethodEventAspect.java:70)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at oracle.bpel.services.common.dms.MethodPhaseEventAspect.invoke(MethodPhaseEventAspect.java:82)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy496.queryTasks(Unknown Source)
    at oracle.bpel.services.workflow.query.ejb.TaskQueryServiceBean.queryTasks(TaskQueryServiceBean.java:310)
    at sun.reflect.GeneratedMethodAccessor4324.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:103)
    at oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:113)
    at oracle.security.jps.util.JpsSubject.doAs(JpsSubject.java:213)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:454)
    at oracle.security.jps.ee.ejb.JpsAbsInterceptor.runJaasMode(JpsAbsInterceptor.java:100)
    at oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:154)
    at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:113)

    Like

  8. Hi Arun,

    Is this solution still works?

    Can we make visible/update approver/approvers Comments to fulfillment level??

    A quick response will be very much helpful.

    Thanks,
    Manoj

    Like

    • Hi Manoj,

      I am assuming you are asking the following.

      1. Can you restrict task view?
      Task action and views are restricted by their configuration done at design time. The APIs provide a means to query tasks. They allow you to pass query filter to restrict both the context and the content of these returned tasks.

      2.Can you update approver/approvers?

      Approver is not a valid role for a workflow task. It can be a context in a BPM processes. A task has assignees, owners,creators, etc. Depending upon what is configured (again at design time), members in these roles can perform workflow functions like provide task outcome. The API allows retrieving both the metadata as well as submit task outcomes.

      Let me know if i got something wrong or missed your point

      Like

  9. How can I delete a task using task Query Services , I am using weblogic context to delete a task its saying weblogic not a valid user to perform this activity , which user can delete task

    Like

    • Hi Amit,

      Yes you can delete a task but it depends upon the task permission that you set. Usually Process or Task Admins can delete a task but weblogic is neither. You can configure fine grained task control actions in the .task file by opening it in JDeveloper.

      Like

  10. Pingback: Functional Testing Business Processes In Oracle BPM Suite | Oracle Technologies Primer

If you have any comments, suggestions or feedback about the post, please feel free to type it here and I will do my best to address them asap