Topic
4 replies Latest Post - ‏2013-02-25T21:32:55Z by SystemAdmin
SystemAdmin
SystemAdmin
7615 Posts
ACCEPTED ANSWER

Pinned topic BrokenReferenceException when completing a task with REST API

‏2013-02-21T20:31:33Z |
Hello,

We've got the REST API working for completing tasks from an external client. However, when attempting to complete the task, we get the following exception. When no parameters are passed as part of the task completion, it works properly, but when a parameter is passed in the exception occurs. Any thoughts on what might be off?

Exception:

2/21/13 14:51:43:017 EST 000000bb RestHelper W src context: Snapshot.e0651f3f-8075-467c-874f-9365ab1313c0, path: 181164d6-59c5-4078-abba-e3eb0e673005
com.lombardisoftware.client.persistence.common.BrokenReferenceException: src context: Snapshot.e0651f3f-8075-467c-874f-9365ab1313c0, path: 181164d6-59c5-4078-abba-e3eb0e673005
at com.lombardisoftware.client.persistence.common.Reference.resolve(Reference.java:145)
at com.lombardisoftware.client.persistence.common.Reference.resolve(Reference.java:114)
at com.lombardisoftware.client.persistence.common.factorydelegate.VersionedFactoryDelegate.findByPrimaryKey(VersionedFactoryDelegate.java:68)
at com.lombardisoftware.client.persistence.common.AbstractVersionedPOFactory.findByPrimaryKey(AbstractVersionedPOFactory.java:123)
at com.lombardisoftware.client.persistence.common.AbstractVersionedPOFactory.findByPrimaryKey(AbstractVersionedPOFactory.java:111)
at com.ibm.bpm.rest.util.BulkDataProcessor.buildBusinessObjects(BulkDataProcessor.java:418)
at com.ibm.bpm.rest.util.BulkDataProcessor.setData(BulkDataProcessor.java:135)
at com.ibm.bpm.rest.internal.impl.WLE75InternalAPIImpl.finishTask(WLE75InternalAPIImpl.java:431)
at com.ibm.bpm.rest.impl.task.FinishActionHandler.handleAction(FinishActionHandler.java:60)
at com.ibm.bpm.rest.impl.task.TaskResource.processTaskAction(TaskResource.java:508)
at sun.reflect.GeneratedMethodAccessor994.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
Updated on 2013-02-25T21:32:55Z at 2013-02-25T21:32:55Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: BrokenReferenceException when completing a task with REST API

    ‏2013-02-21T21:42:59Z  in response to SystemAdmin
    Can you post some snippets that we can try out on our own systems? Some thing like -

    when I do -
    
    http:
    //myserver:9080/rest/bpm/wle/v1/task/1066?action=finish&parts=all
    


    it fails but when I do

    
    http:
    //myserver:9080/rest/bpm/wle/v1/task/1067?action=finish&params={bob : 15}&parts=all
    


    it is working. (Note- both of those worked for me}

    Andrew Paier | Director of Special Operations | BP3 Global, Inc. www.bp-3.com
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: BrokenReferenceException when completing a task with REST API

    ‏2013-02-22T16:51:13Z  in response to SystemAdmin
    Certainly:

    Failures:
    http://bpmHost/rest/bpm/wle/v1/task/1234?action=finish&params={"myString":""}&parts=all
    http://bpmHost/rest/bpm/wle/v1/task/1234?action=finish&params={"myString":"asdf"}&parts=all

    Success:
    http://bpmHost/rest/bpm/wle/v1/task/1234?action=finish&parts=all
    http://bpmHost/rest/bpm/wle/v1/task/1234?action=finish&params={}&parts=all
  • SystemAdmin
    SystemAdmin
    7615 Posts
    ACCEPTED ANSWER

    Re: BrokenReferenceException when completing a task with REST API

    ‏2013-02-25T20:13:01Z  in response to SystemAdmin
    Okay, some further info and steps to reproduce with a brand new toolkit and process:

    1. Create a toolkit
    2. Create an external implementation within this toolkit with a String output parameter "myParam"
    3. Create a process app, make it dependent on this toolkit
    4. Create a BPD with one activity, the external activity above
    5. Try and kick off the process and complete the external activity with the REST API while providing a value for myParam.

    It works fine if the external implementation is within the process app, but an external implementation used from within a toolkit seems to cause this error. Anyone ever seen this? Any advice? Seems like a bug...
    • SystemAdmin
      SystemAdmin
      7615 Posts
      ACCEPTED ANSWER

      Re: BrokenReferenceException when completing a task with REST API

      ‏2013-02-25T21:32:55Z  in response to SystemAdmin
      I've attached a sample process app that can be used to demonstrate the issue. There are three processes:

      1. BPD Works - this process uses an external implementation provided by the process app and works correctly with the REST API.
      2. BPD Doesnt work - this process uses an external implementation provided by the toolkit and does not work correctly with the REST API.
      3. Toolkit BPD doesnt work - this process uses a link process provided by the toolkit that uses the external implementation provided by the toolkit and does not work correctly with the REST API.

      The toolkit includes a process that uses the external implementation provided by the toolkit and works correctly with the rest API.