3 Replies Latest reply: Apr 9, 2013 1:57 PM by AliAbidi RSS

    payload set by API but dataObject remains empty and data does not flow

    AliAbidi
      Hi,

      We used ADF to programatically set the payload of a new BPM Instance, using JDev 11.1.1.6 and our BPM is also 11.1.1.6. Followed standard documentation.. and payload gets set, and submitted.

      firstTask.setPayloadAsElement(payload);
      wfSvcClient_.getTaskService().updateTaskOutcome(ctx, firstTask, Utilities.INIT_TASK_SUBMIT_OUTCOME);

      When we check in the BPMN for "exiting the initiator activity", we see payload set BUT dataObject with no elements set (empty):
      <auditQueryPayload auditId="505000" ciKey="560017">
      <serviceOutput>
      <element name="execData" detailId="59246" isBusinessIndicator="false"> <value> <task xmlns="http://xmlns.oracle.com/bpel/workflow/task"> ...
      <payload> <PurposeOfFiling xmlns="http://xmlns.oracle.com/OR1/OR1_FORMS_V2/PurposeOfFiling">
      *<purOrganizationId>C078</purOrganizationId>*
      </PurposeOfFiling> </payload>
      ..... </serviceOutput>
      <dataState> <dataObject name="PurposeOfFiling" isBusinessIndicator="false"> <value>
      <PurposeOfFiling xmlns="http://xmlns.oracle.com/bpm/bpmobject/BusinessObjects/PurposeOfFiling">
      *<purOrganizationId></purOrganizationId>*
      </value></dataObject></dataState>
      </auditQueryPayload>

      On entering the second activity (there is nothing between the first and second activity, i.e. direct link), the form comes up empty.

      It appears that in "firstTask.setPayloadAsElement(payload);" the payload is getting set, but the dataObject is empty, and that the dataObject is what is feeding the second activity, and so that is empty.

      Is there a way that we can ensure that the payload "feeds" the dataObject?
      Or alternatively, that the payload "feeds" the second activity?

      How would it be done? Would really appreciate any assistance.

      Thanks!
      Ali.
        • 1. Re: payload set by API but dataObject remains empty and data does not flow
          AliAbidi
          I have made some more progress in evaluation tests, and can provide more info./confirmation of the problem:

          I added a SCRIPT TASK before the first Human Task, and this initialized/populated the <dataObject>

          Now when the application is invoked, including the code:
          firstTask.setPayloadAsElement(payload);
          wfSvcClient_.getTaskService().updateTaskOutcome(ctx, firstTask, Utilities.INIT_TASK_SUBMIT_OUTCOME);

          The task payload for the first task gets set (just as before) with what we set programatically in it,
          AND the dataObject gets set with the Initialization values from the SCRIPT-Task.

          So this is a confirmation that the "setPayloadAsElement" is NOT setting the "dataObject".

          Apparently there are two payloads : Task Payload and Data Payload.
          Here is the conundrum that needs resolution:
          "setPayloadAsElement" sets the Task Payload only, whereas it is the Data Payload that gets passed (from Activity to activity)!
          So what is the point of the API setting the Task Payload, without the Data Payload, if it is the Data Payload that will be passed?

          Is there a fix for this issue? Am I missing something?
          Is there some way to set the Data Payload from the Task Payload?
          or some API to set the Data Payload directly (because the "setPayloadAsElement" seems to only set the Task Payload)
          or some way to link the Task Payload in Output to the Data Payload? (the execData Task Payload is not exposed so I cannot see how?)

          I'd appreciate any help.
          Ali.
          • 2. Re: payload set by API but dataObject remains empty and data does not flow
            Bill Wallen
            After you set the payload, you have to update the task to persist the values.

            firstTask.setPayloadAsElement(payload);
            wfSvcClient_.getTaskService().updateTask(ctx, firstTask);
            wfSvcClient_.getTaskService().updateTaskOutcome(ctx, firstTask, Utilities.INIT_TASK_SUBMIT_OUTCOME);
            • 3. Re: payload set by API but dataObject remains empty and data does not flow
              AliAbidi
              Thanks Bill.

              It was something that I had in an earlier build (when I was looking into payload updates) and had removed.. but I've gone ahead and put it back.

              These are my results:
              When the BPM Application Output is wired for dataObject -to- dataObject (which I think is the right way to do), then the dataObject still remains empty.
              When the BPM Application Output is wired for UI -to- dataObject, then the Instance gets suspended due to uninitializedVariable.
              When the BPM Application Output is not wired at all (and Input was never wired to begin with) then dataObject is missing all together.

              One thing I noticed (on just trying the first activity by itself) is that the payload is shown in the UI (i.e. task Payload gets into UI). This was the effect of the "updateTask".
              However, in case of programatic SUBMIT, the payload is still not passed to the next activity. This appears to be once again because the dataObject itself is not being set.

              Also interestingly I found the below BUG request recently (3/22/2013) registered with Oracle, asking for APIs to be able to get/set the actual dataObject:
              BUG 16537745 - ABILITY TO ACCESS PROCESS INSTANCE DATAOBJECT VALUES USING API --> Oracle Business Process Management Suite
              - I don't have access to the details of it, but I'm guessing that their dataObject was not being set, and so API Access is requested to set it.

              However, if there is an existing solution - whereby the dataObject payload can be set (besides the task Payload), I'd much appreciate.

              Thanks!