HMSyncTOC("index.html", "api_odata_saveactivity.htm");

Data to save Activities from the Work Portal

<< Click to Display Table of Contents >>

Data to save Activities from the Work Portal

 

Data to save Activities from the Work Portal

  •     Overview
  •     Resource URL
  •     Example
  • Overview

    Bizagi features an OData service which handles aspects of the Experience design.

    Through the Cases/Workitems URI, you can handle case data related to the pending activities of a user (not stakeholder), as described at Activities from Work Portal cases.

    This article describes how to save an activity of a specific case, given its ID.

     

    Resource URL

    Start with the following URL:

    [your_bizagi_project_url]/odata/data/cases([caseID])/workitems([workitemID])/save

     

    Customizations:

    [ID_case]: the GUID of a case as returned when invoking Cases from Work Portal.

    [ID_workitem]: the GUID of a workitem as returned when invoking Activities from Work Portal cases.

    [your_bizagi_project_url]: the URL where end users access the Bizagi Work Portal.

    For an on-premises Bizagi project, the URL would be:

    https://[your_server]/[your_project]/odata/data/cases([ID_case])/workitems([ID_workitem])/next

    For Automation Service projects, the URL would be:

    https://[project_environment]-[your_project]-[your_company].bizagi.com/odata/data/cases([ID_case])/workitems([ID_workitem])/next

     

    Example

    To complete a workitem, invoke the URL described above using an HTTP POST.

    Consider including the following JSON structure in the body to send parameters:

    {

          "startParameters": [

           {

               "xpath": "[xpath_name]",

               "value": "[value_for_xpath]"

           }

       ]

    }

     

    Customizations:

    [xpath_name]: The exact Xpath  expected by parameters of the workitem.

    [value_for_xpath]: The value you want to set to the Xpath parameter.

     

    If you have more than one parameter, use:

    {

          "startParameters": [

           {

               "xpath": "[xpath1_name]",

               "value": "[value_for_xpath1]"

           },

           {

               "xpath": "[xpath2_name]",

               "value": "[value_for_xpath2]"

           }

       ]

    }

     

    If no parameters are expected (not explicitly required), use:

    {

     "startParameters": [

     ]

    }

     

    To filter the search with parameters, consider the notes for the different data types, as described at Values and formats for data types.

    To dynamically obtain business values that you may need as an input parameter to start a new process, refer to Related entities services.

     

    The following image illustrates data in the body you can send in an HTTP POST.

     

    OData_save01

     

    If the invocation is successful, the response you obtain confirming that the activity or event was saved contains the case id.

     

    OData_save02

     

    Once the endpoint is executed, you can see in the Work Portal the activity with the values sent through the OData layer.

     

    OData_save03

     

    In this article