Skip to main content

Actions

The ballerinax/sap.successfactors.ecworkflow package exposes the following clients:

Available clients:

ClientPurpose
ClientManages ecworkflow objects: MyPendingWorkflow, WfRequestParticipator, WorkflowAllowedActionList, AlertMessage, WfRequestComments, WfRequestStep, AutoDelegateDetail, AutoDelegateConfig…, over the SAP SuccessFactors OData v2 API.

Client​

You can use these APIs to access data of employees workflow requests and and other workflow data such as current status.

Configuration​

ConnectionConfig​

Provides a set of configurations for controlling the behaviours when communicating with the SAP SuccessFactors OData endpoint. Passed as the argument to the client initializer.

FieldTypeDefaultDescription
authhttp:CredentialsConfigRequiredConfigurations related to client authentication
httpVersionhttp:HttpVersionSee defaultThe HTTP version understood by the client
http1Settingshttp:ClientHttp1SettingsSee defaultConfigurations related to HTTP/1.x protocol
http2Settingshttp:ClientHttp2SettingsSee defaultConfigurations related to HTTP/2 protocol
timeoutdecimalSee defaultThe maximum time to wait (in seconds) for a response before closing the connection
forwardedstringSee defaultThe choice of setting forwarded/x-forwarded header
followRedirectshttp:FollowRedirectsOptionalConfigurations associated with Redirection
poolConfighttp:PoolConfigurationOptionalConfigurations associated with request pooling
cachehttp:CacheConfigSee defaultHTTP caching related configurations
compressionhttp:CompressionSee defaultSpecifies the way of handling compression (accept-encoding) header
circuitBreakerhttp:CircuitBreakerConfigOptionalConfigurations associated with the behaviour of the Circuit Breaker
retryConfighttp:RetryConfigOptionalConfigurations associated with retrying
cookieConfighttp:CookieConfigOptionalConfigurations associated with cookies
responseLimitshttp:ResponseLimitConfigsSee defaultConfigurations associated with inbound response size limits
secureSockethttp:ClientSecureSocketOptionalSSL/TLS-related options
proxyhttp:ProxyConfigOptionalProxy server related options
socketConfighttp:ClientSocketConfigSee defaultProvides settings related to client socket configuration
validationbooleanSee defaultEnables the inbound payload validation functionality which provided by the constraint package. Enabled by default
laxDataBindingbooleanSee defaultEnables relaxed data binding on the client side. When enabled, nil values are treated as optional, and absent fields are handled as nilable types. Enabled by default.

The client also accepts a hostname string parameter (the SAP SuccessFactors API server host) and an optional port (defaults to 443).

Initializing the client​

import ballerinax/sap.successfactors.ecworkflow;

configurable string hostname = ?;
configurable string username = ?;
configurable string password = ?;

ecworkflow:Client client = check new (
{
auth: { username, password }
},
hostname
);

Operations​

MyPendingWorkflow​

listMyPendingWorkflows

Queries the MyPendingWorkflow collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListMyPendingWorkflowsQueriesNoQueries to be sent with the request

Returns: ListMyPendingWorkflowsResponse&#124;error

Sample code:

ListMyPendingWorkflowsResponse result = check client->listMyPendingWorkflows();

Sample response:

{
"d": {
"results": [
{
"wfRequestId": "1000"
}
]
}
}
getMyPendingWorkflow

Retrieves a single MyPendingWorkflow entity identified by its key property.

Parameters:

NameTypeRequiredDescription
wfRequestIdstringYeskey: wfRequestId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetMyPendingWorkflowQueriesNoQueries to be sent with the request

Returns: MyPendingWorkflow_1&#124;error

Sample code:

MyPendingWorkflow_1 result = check client->getMyPendingWorkflow(wfRequestId);

Sample response:

{
"d": {
"wfRequestId": "1000"
}
}

WfRequestParticipator​

listWfRequestParticipators

Queries the WfRequestParticipator collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListWfRequestParticipatorsQueriesNoQueries to be sent with the request

Returns: ListWfRequestParticipatorsResponse&#124;error

Sample code:

ListWfRequestParticipatorsResponse result = check client->listWfRequestParticipators();

Sample response:

{
"d": {
"results": [
{
"wfRequestParticipatorId": "1000"
}
]
}
}
getWfRequestParticipator

Retrieves a single WfRequestParticipator entity identified by its key property.

Parameters:

NameTypeRequiredDescription
wfRequestParticipatorIdintYeskey: wfRequestParticipatorId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetWfRequestParticipatorQueriesNoQueries to be sent with the request

Returns: WfRequestParticipator_1&#124;error

Sample code:

WfRequestParticipator_1 result = check client->getWfRequestParticipator(wfRequestParticipatorId);

Sample response:

{
"d": {
"wfRequestParticipatorId": "1000"
}
}

WorkflowAllowedActionList​

listWorkflowAllowedActionLists

Queries the WorkflowAllowedActionList collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListWorkflowAllowedActionListsQueriesNoQueries to be sent with the request

Returns: ListWorkflowAllowedActionListsResponse&#124;error

Sample code:

ListWorkflowAllowedActionListsResponse result = check client->listWorkflowAllowedActionLists();

Sample response:

{
"d": {
"results": [
{
"wfRequestId": "1000"
}
]
}
}
getWorkflowAllowedActionList

Retrieves a single WorkflowAllowedActionList entity identified by its key property.

Parameters:

NameTypeRequiredDescription
wfRequestIdintYeskey: wfRequestId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetWorkflowAllowedActionListQueriesNoQueries to be sent with the request

Returns: WorkflowAllowedActionList_1&#124;error

Sample code:

WorkflowAllowedActionList_1 result = check client->getWorkflowAllowedActionList(wfRequestId);

Sample response:

{
"d": {
"wfRequestId": "1000"
}
}

AlertMessage​

listAlertMessages

Queries the AlertMessage collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListAlertMessagesQueriesNoQueries to be sent with the request

Returns: ListAlertMessagesResponse&#124;error

Sample code:

ListAlertMessagesResponse result = check client->listAlertMessages();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000",
"wfRequestNav": {}
}
]
}
}
createAlertMessage

Creates a new AlertMessage entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadAlertMessageYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedAlertMessage&#124;error

Sample code:

CreatedAlertMessage result = check client->createAlertMessage(payload);

Sample response:

{
"d": {
"externalCode": "1000",
"wfRequestNav": {
"results": []
}
}
}
getAlertMessage

Retrieves a single AlertMessage entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetAlertMessageQueriesNoQueries to be sent with the request

Returns: AlertMessage_1&#124;error

Sample code:

AlertMessage_1 result = check client->getAlertMessage(externalCode);

Sample response:

{
"d": {
"externalCode": "1000",
"wfRequestNav": {
"results": []
}
}
}
updateAlertMessage

Updates the AlertMessage identified by its key property with the supplied payload.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
payloadModifiedAlertMessageYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateAlertMessage(externalCode, payload);
deleteAlertMessage

Deletes the AlertMessage identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteAlertMessageHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteAlertMessage(externalCode);

WfRequestComments​

listWfRequestCommentss

Queries the WfRequestComments collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListWfRequestCommentssQueriesNoQueries to be sent with the request

Returns: ListWfRequestCommentssResponse&#124;error

Sample code:

ListWfRequestCommentssResponse result = check client->listWfRequestCommentss();

Sample response:

{
"d": {
"results": [
{
"wfRequestCommentId": "1000"
}
]
}
}
getWfRequestComments

Retrieves a single WfRequestComments entity identified by its key property.

Parameters:

NameTypeRequiredDescription
wfRequestCommentIdintYeskey: wfRequestCommentId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetWfRequestCommentsQueriesNoQueries to be sent with the request

Returns: WfRequestComments_1&#124;error

Sample code:

WfRequestComments_1 result = check client->getWfRequestComments(wfRequestCommentId);

Sample response:

{
"d": {
"wfRequestCommentId": "1000"
}
}

WfRequestStep​

listWfRequestSteps

Queries the WfRequestStep collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListWfRequestStepsQueriesNoQueries to be sent with the request

Returns: ListWfRequestStepsResponse&#124;error

Sample code:

ListWfRequestStepsResponse result = check client->listWfRequestSteps();

Sample response:

{
"d": {
"results": [
{
"wfRequestStepId": "1000",
"wfRequestNav": {}
}
]
}
}
getWfRequestStep

Retrieves a single WfRequestStep entity identified by its key property.

Parameters:

NameTypeRequiredDescription
wfRequestStepIdintYeskey: wfRequestStepId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetWfRequestStepQueriesNoQueries to be sent with the request

Returns: WfRequestStep_1&#124;error

Sample code:

WfRequestStep_1 result = check client->getWfRequestStep(wfRequestStepId);

Sample response:

{
"d": {
"wfRequestStepId": "1000",
"wfRequestNav": {
"wfRequestId": "1000",
"empWfRequestNav": {},
"parentWfRequestNav": {},
"wfRequestCommentsNav": {},
"wfRequestParticipatorNav": {},
"wfRequestStepNav": {},
"workflowAllowedActionListNav": {}
}
}
}

AutoDelegateDetail​

listAutoDelegateDetails

Queries the AutoDelegateDetail collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListAutoDelegateDetailsQueriesNoQueries to be sent with the request

Returns: ListAutoDelegateDetailsResponse&#124;error

Sample code:

ListAutoDelegateDetailsResponse result = check client->listAutoDelegateDetails();

Sample response:

{
"d": {
"results": [
{
"AutoDelegateConfig_delegator": "string",
"externalCode": "1000"
}
]
}
}
createAutoDelegateDetail

Creates a new AutoDelegateDetail entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadAutoDelegateDetailYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedAutoDelegateDetail&#124;error

Sample code:

CreatedAutoDelegateDetail result = check client->createAutoDelegateDetail(payload);

Sample response:

{
"d": {
"AutoDelegateConfig_delegator": "string",
"externalCode": "1000"
}
}
getAutoDelegateDetail

Retrieves a single AutoDelegateDetail entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
AutoDelegateConfig_delegatorstringYeskey: AutoDelegateConfig_delegator
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetAutoDelegateDetailQueriesNoQueries to be sent with the request

Returns: AutoDelegateDetail_1&#124;error

Sample code:

AutoDelegateDetail_1 result = check client->getAutoDelegateDetail(AutoDelegateConfig_delegator, externalCode);

Sample response:

{
"d": {
"AutoDelegateConfig_delegator": "string",
"externalCode": "1000"
}
}
updateAutoDelegateDetail

Updates the AutoDelegateDetail identified by its key properties with the supplied payload.

Parameters:

NameTypeRequiredDescription
AutoDelegateConfig_delegatorstringYeskey: AutoDelegateConfig_delegator
externalCodestringYeskey: externalCode
payloadModifiedAutoDelegateDetailYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateAutoDelegateDetail(AutoDelegateConfig_delegator, externalCode, payload);
deleteAutoDelegateDetail

Deletes the AutoDelegateDetail identified by its key properties.

Parameters:

NameTypeRequiredDescription
AutoDelegateConfig_delegatorstringYeskey: AutoDelegateConfig_delegator
externalCodestringYeskey: externalCode
headersDeleteAutoDelegateDetailHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteAutoDelegateDetail(AutoDelegateConfig_delegator, externalCode);

AutoDelegateConfig​

listAutoDelegateConfigs

Queries the AutoDelegateConfig collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListAutoDelegateConfigsQueriesNoQueries to be sent with the request

Returns: json&#124;error

Sample code:

json result = check client->listAutoDelegateConfigs();
getAutoDelegateConfig

Retrieves a single AutoDelegateConfig entity identified by its key property.

Parameters:

NameTypeRequiredDescription
delegatorstringYeskey: delegator
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetAutoDelegateConfigQueriesNoQueries to be sent with the request

Returns: json&#124;error

Sample code:

json result = check client->getAutoDelegateConfig(delegator);
deleteAutoDelegateConfig

Deletes the AutoDelegateConfig identified by its key property.

Parameters:

NameTypeRequiredDescription
delegatorstringYeskey: delegator
headersDeleteAutoDelegateConfigHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteAutoDelegateConfig(delegator);

EmpWfRequest​

listEmpWfRequests

Queries the EmpWfRequest collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmpWfRequestsQueriesNoQueries to be sent with the request

Returns: ListEmpWfRequestsResponse&#124;error

Sample code:

ListEmpWfRequestsResponse result = check client->listEmpWfRequests();

Sample response:

{
"d": {
"results": [
{
"empWfRequestId": "1000"
}
]
}
}
getEmpWfRequest

Retrieves a single EmpWfRequest entity identified by its key property.

Parameters:

NameTypeRequiredDescription
empWfRequestIdintYeskey: empWfRequestId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmpWfRequestQueriesNoQueries to be sent with the request

Returns: EmpWfRequest_1&#124;error

Sample code:

EmpWfRequest_1 result = check client->getEmpWfRequest(empWfRequestId);

Sample response:

{
"d": {
"empWfRequestId": "1000"
}
}

WfRequest​

listWfRequests

Queries the WfRequest collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListWfRequestsQueriesNoQueries to be sent with the request

Returns: ListWfRequestsResponse&#124;error

Sample code:

ListWfRequestsResponse result = check client->listWfRequests();

Sample response:

{
"d": {
"results": [
{
"wfRequestId": "1000",
"empWfRequestNav": {},
"parentWfRequestNav": {},
"wfRequestCommentsNav": {},
"wfRequestParticipatorNav": {},
"wfRequestStepNav": {},
"workflowAllowedActionListNav": {}
}
]
}
}
getWfRequest

Retrieves a single WfRequest entity identified by its key property.

Parameters:

NameTypeRequiredDescription
wfRequestIdintYeskey: wfRequestId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetWfRequestQueriesNoQueries to be sent with the request

Returns: WfRequest_1&#124;error

Sample code:

WfRequest_1 result = check client->getWfRequest(wfRequestId);

Sample response:

{
"d": {
"wfRequestId": "1000",
"empWfRequestNav": {
"empWfRequestId": "1000"
},
"parentWfRequestNav": {},
"wfRequestCommentsNav": {
"results": []
},
"wfRequestParticipatorNav": {
"results": []
},
"wfRequestStepNav": {
"results": []
},
"workflowAllowedActionListNav": {
"results": []
}
}
}

approveWfRequest​

createapproveWfRequest

Creates a new approveWfRequest entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesCreateapproveWfRequestQueriesNoQueries to be sent with the request

Returns: Result&#124;error

Sample code:

Result result = check client->createapproveWfRequest();

Sample response:

{
"d": {
"results": [
{}
]
}
}

commentWfRequest​

createcommentWfRequest

Creates a new commentWfRequest entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesCreatecommentWfRequestQueriesNoQueries to be sent with the request

Returns: Result&#124;error

Sample code:

Result result = check client->createcommentWfRequest();

Sample response:

{
"d": {
"results": [
{}
]
}
}

rejectWfRequest​

createrejectWfRequest

Creates a new rejectWfRequest entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesCreaterejectWfRequestQueriesNoQueries to be sent with the request

Returns: Result&#124;error

Sample code:

Result result = check client->createrejectWfRequest();

Sample response:

{
"d": {
"results": [
{}
]
}
}

sendbackWfRequest​

createsendbackWfRequest

Creates a new sendbackWfRequest entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesCreatesendbackWfRequestQueriesNoQueries to be sent with the request

Returns: Result&#124;error

Sample code:

Result result = check client->createsendbackWfRequest();

Sample response:

{
"d": {
"results": [
{}
]
}
}

getWorkflowPendingData​

creategetWorkflowPendingData

Creates a new getWorkflowPendingData entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesCreategetWorkflowPendingDataQueriesNoQueries to be sent with the request

Returns: Result_1&#124;error

Sample code:

Result_1 result = check client->creategetWorkflowPendingData();

Sample response:

{
"d": {
"results": [
{
"wfRequestId": 0,
"workflowAttributeGroups": []
}
]
}
}

withdrawWfRequest​

createwithdrawWfRequest

Creates a new withdrawWfRequest entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesCreatewithdrawWfRequestQueriesNoQueries to be sent with the request

Returns: Result&#124;error

Sample code:

Result result = check client->createwithdrawWfRequest();

Sample response:

{
"d": {
"results": [
{}
]
}
}