SAP Knowledge Base Article - Public

2396714 - Workflow not triggered when creating MDF entries via OData API call or Integration Center

Symptom

  • Workflow not getting triggered when adding MDF entries via OData API call or Integration Center
  • Workflow on business rules not getting triggered on MDF when creating data via OData API call or Integration Center

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental"

Environment

  • SAP SuccessFactors HXM Suite
    • OData API
    • Integration Center
    • Metadata Framework
    • Business Rules
    • MDF Workflows

Reproducing the Issue

  1. Add a business rule that will trigger a workflow on the MDF Object;
  2. Create new entries via OData API Call or Integration Center;
  3. Check the data created for a pending workflow approval request;

Cause

If the user creating the entry for the MDF object via API call has access to "Admin access to MDF OData API" granted, then as per the standard behavior for the admin users the Workflow execution will be skipped. Also, in addition to this permission check, the OData API call requires the parameter workflowConfirmed=true in order to trigger the workflow.

Resolution

Integration Center scenario

It won't be possible to trigger workflows if you are using Integration Center to import the data into the MDF object as Integration Center doesn't support additional parameters like workflowConfirmed=true, and this parameter is mandatory to proceed triggering the workflow as explained below.

OData API scenario

When an MDF object is associated with a workflow and a record is created via OData API, the MDF OData layer validates if the API user has the "Admin access to MDF OData API" permission granted:

  • If so, the workflow won't be triggered and this is an expected behavior;
  • If not, the workflow will be triggered; 

OBS.: You can check if the API user has the "Admin access to MDF OData API" permission under View User Permissions feature > Metadata Framework section.

When the API user doesn't have the permission above, the workflow is called, but gives the follow error message:

"<code>COE_GENERAL_BAD_REQUEST</code>
<message lang="en-US">In order to trigger workflow, please set the 'workflowConfirmed' flag to true!</message>"

This is because there is a step which has been skipped. When the user does a manual trigger from the UI, there's a pop-up for workflow and user must confirm that. Correspondingly in OData, a parameter named as "workflowConfirmed" should be set as true in the API call to simulate that operation.

Since MDF Workflow can be triggered generically on any MDF entity, every MDF OData entity has this parameter. The above error message will not happen if the requester set workflowConfirmed=true in the API call. This is explained in detail in workflowConfirmed chapter of OData API guide.

Keywords

MDF, Metadata Framework, OData, API, Business Rules, Workflows, API call, integration, center, not, trigger, triggering, triggered , KBA , LOD-SF-INT-MDF , Metadata Framework API (MDF) , LOD-SF-INT-INC-ODATA , ODATA API In Integration Center , LOD-SF-MDF-API , OData APIs & Integrations , Problem

Product

SAP SuccessFactors HCM Core all versions