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
- Add a business rule that will trigger a workflow on the MDF Object
- Create new entries via OData API Call or Integration Center
- 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 if an instance is created via OData API, the workflow will not be triggered and this is a expected behavior if the user is MDF OData Admin.
- If the user is MDF OData Admin, workflow won't be triggered.
- If the user not MDF OData Admin, workflow will be triggered.
This is controlled in MDF OData layer. When creating an MDF entity via Odata API 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.
Follow the steps below to check if the user is an MDF OData Admin:
- Login to the instance and navigate to Manage Permission Roles
- Go to the assigned Permission Role for the user that is making the API call
- Navigate to Administrator Permissions category > Metadata Framework
See Also
More details in the guide page: workflowConfirmed - SAP Help Portal.
Keywords
MDF, Metadata Framework, OData, API, Business Rules, Workflows, API call, integration, center, , 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