Skip to Content
Author's profile photo Former Member

Complete a task: Build OutputData

Hi there,

I had the problem that I was not able to complete a BPM task, because I didn’t manage to fill the task’s OutputData structure of the BPM oData service correctly.

After having solved the issue, I’m writing my first blog to share my solution with you. 🙂

Let’s imagine you have a task with the same complex input/output type called “HandleRequestType”:

<complexType name="HandleRequestType">
          <element name="Approver" type="tns:ApproverType" maxOccurs="1" minOccurs="1">
          <element name="Request" type="tns:RequestType" maxOccurs="1" minOccurs="1">
          <element name="Requester" type="tns:RequesterType" maxOccurs="1" minOccurs="1">
          <element name="Status" type="tns:StatusType" maxOccurs="1" minOccurs="0">

As you can see it consists of a lot of complex subtypes like “RequestType” or “RequesterType”.

Let’s imagine that you only want to fill two fields of this data structure:

  1. Field “Action” in element “Status”
  2. Field “ReferenceNumber” in element “Request”

The coding is very easy, but it took me several hours to find out how it works.

Please have a look at the completeTask() method which builds OutputData and sends a POST request to the oData service.


completeTask : function() {
    // Get TaskID and data model
    var taskId = getValueOfURLParameter("taskId");
    var odataModel = this.getView().getModel();
    // Create OutputData
    var outputData = {};
    // Create all needed subtypes
    var handleRequestType = {};
    var status = {};
    var request = {};
    // Fill values for fields that need to be sent
    status.Action = "Approved";
    request.ReferenceNumber = "1234";
    // Build OutputData
    handleRequestType.Status = status;
    handleRequestType.Request = request;
    outputData.HandleRequestType = handleRequestType;
    // Complete task with built OutputData
    odataModel.create( "/OutputData", outputData, null,
          function sendData_OnSuccess(oData, response) {
              alert("Task has been completed successfully");
          function sendData_OnError(oError) {
              alert("Task could not be completed");

Keep in mind that you can build up the OutputData data structure without any binding of InputData defined on your view!

It took me some time to figure that out.

Best regards,


P.S.: Please note, that you have to unzip the attachment “” and remove the .txt extension. Then you can extract the “WebContent” folder. It’s a little bit weird, but that’s what happens when you upload a “*.zip.txt” file…

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Andre Hofeditz
      Andre Hofeditz

      Great blog post and an important point: Using the InputData is of course optional: You can use it, but you can also build up the required data on your own. This is especially interesting in scenarios, where the input data differs from the output data.