Workflows

The Benevia platform can do multiple OData calls without saving changes between calls. This allows the client to make incremental changes and get real-time business logic modifications. For example: When entering a quantity and a product on a sales order, the business logic computes the prices and the total of the order. With workflows, the user can see these values change as he enters data into the sales order.

Lifecycle of workflow: Create workflow → Multiple OData queries → Commit

  1. Create workflow: POST /API/workflow

    {
        "message": "Workflow created successfully",
        "workflowId": "a0d77a58-b208-46ce-b7f6-ddb03b89a6af"
    }
    
  2. Do multiple OData queries such as GET, PATCH or POST with these headers:

    Workflow-Id: 1c9f2f65-7d3c-4f6b-b0d1-a2efa4a56c0d Workflow-Index: 1 Increment the index with each query

    To return updated data in your PATCH query, use $select and $expand parameters

  3. Commit workflow /api/workflow/commit with the above headers

Virtual entities are supported — within a workflow they stage in memory and commit atomically. See Virtual Entities › Workflows.

//TODO: More documentation needed to explain workflows