@Component(value="com.sap.cloud.sdk.services.scp.workflow.cf.api.WorkflowInstancesApi") @Beta public class WorkflowInstancesApi extends AbstractRestService
apiClient
Constructor and Description |
---|
WorkflowInstancesApi(HttpDestinationProperties httpDestination)
Instantiates this API class to invoke operations on the the Workflow API for Cloud Foundry.
|
Modifier and Type | Method and Description |
---|---|
WorkflowInstance |
createInstances(WorkflowInstancesPOST body)
Start a new instance
|
List<WorkflowInstanceErrorMessage> |
getErrorMessages(String workflowInstanceId)
Retrieve error messages
|
WorkflowInstanceRolesGET |
getRoles(String workflowInstanceId)
Retrieve instance roles
|
List<CustomAttribute> |
getWorkflowAttributes(String workflowInstanceId)
Retrieve custom workflow attributes by workflow instance ID
|
Object |
getWorkflowContext(String workflowInstanceId)
Retrieve instance context
|
WorkflowInstance |
getWorkflowInstance(String workflowInstanceId)
Retrieve workflow instance by ID
|
WorkflowInstance |
getWorkflowInstance(String workflowInstanceId,
String $expand)
Retrieve workflow instance by ID
|
List<WorkflowInstance> |
getWorkflowInstances()
Retrieve all instances by query parameters
|
List<WorkflowInstance> |
getWorkflowInstances(String $orderby,
Integer $skip,
Integer $top,
String $inlinecount,
String $expand,
String id,
String definitionId,
String definitionVersion,
String status,
String startedAt,
String startedFrom,
String startedUpTo,
String completedAt,
String completedFrom,
String completedUpTo,
String startedBy,
String subject,
String containsText,
String businessKey,
String attributesExampleCustomAttribute)
Retrieve all instances by query parameters
|
RestResponse |
overwriteContext(String workflowInstanceId,
Object body)
Overwrite instance context
|
List<WorkflowInstanceExecutionLog> |
retrieveExecutionLogs(String workflowInstanceId)
Retrieve execution logs
|
RestResponse |
updateContext(String workflowInstanceId,
Object body)
Update instance context
|
RestResponse |
updateInstances(List<Object> body)
Delete instance by ID
|
RestResponse |
updateRoles(String workflowInstanceId,
WorkflowInstanceRolesPATCH body)
Update instance roles
|
RestResponse |
updateWorkflowInstance(String workflowInstanceId,
WorkflowInstancePATCH body)
Update instance
|
public WorkflowInstancesApi(@Nonnull HttpDestinationProperties httpDestination)
httpDestination
- The destination that API should be used with@Nullable public WorkflowInstance createInstances(@Nonnull WorkflowInstancesPOST body) throws RestRequestException
Start a new instance
Starts a new workflow instance of the provided workflow definition. Specify the ID of the workflow definition in the body. The workflow instance automatically starts based on the latest deployed version of the definition. Roles permitted to execute this operation: - Global roles: WorkflowInitiator - Scope: WORKFLOW_INSTANCE_START
201 - Returns the newly created workflow instance.
400 - Incorrect format or structure of the provided request body.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - Workflow definition not found. Either the payload does not contain a definitionId property or the specified ID is incorrect.
422 - The workflow context in the request body contains invalid keys or values.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
body
- Specify the request body according to the given schema. Note that the length of the request body is
limited to ensure an optimal operation of the service.RestRequestException
- if an error occurs while attempting to invoke the API@Nullable public List<WorkflowInstanceErrorMessage> getErrorMessages(@Nonnull String workflowInstanceId) throws RestRequestException
Retrieve error messages
Retrieves current error messages for a workflow instance. Roles permitted to execute this operation: - Global roles: WorkflowDeveloper, WorkflowAdmin - Instance-specific roles: adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_GET_ERROR_MESSAGES
200 - Returns a list of error messages.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- The workflow instance ID for which the error messages should be retrieved. The workflow instance ID is
36 characters long.RestRequestException
- if an error occurs while attempting to invoke the API@Nullable public WorkflowInstanceRolesGET getRoles(@Nonnull String workflowInstanceId) throws RestRequestException
Retrieve instance roles
Retrieves the instance-specific role assignments of the given workflow instance. Roles permitted to execute this operation: - Global roles: WorkflowAdmin - Instance-specific roles: adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_GET_ROLES
200 - Returns a list of assigned users and a list of assigned groups for each role on the given workflow instance.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- The workflow instance ID for which the roles should be retrieved. The workflow instance ID is 36
characters long.RestRequestException
- if an error occurs while attempting to invoke the API@Nullable public List<CustomAttribute> getWorkflowAttributes(@Nonnull String workflowInstanceId) throws RestRequestException
Retrieve custom workflow attributes by workflow instance ID
Retrieves custom workflow attributes for a workflow instance. Labels as well as the order of the custom workflow attributes in which they are returned, are taken from the latest versions of the workflow definitions where these attributes are present. Roles permitted to execute this operation: - Global roles: WorkflowViewer, WorkflowAdmin - Instance-specific roles: viewerUsers, viewerGroups, adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_GET_ATTRIBUTES
200 - Returns the custom workflow attributes for the requested workflow instance.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- The ID of the workflow instance for which the custom workflow attributes should be retrieved. The ID
is 36 characters long.RestRequestException
- if an error occurs while attempting to invoke the API@Nullable public Object getWorkflowContext(@Nonnull String workflowInstanceId) throws RestRequestException
Retrieve instance context
**Warning: Users with the role \"WorkflowAdmin\" are no longer able to view the workflow context. To allow these users to continue to view the context, assign the role \"WorkflowContextViewer\" to them.** Retrieves the context for a workflow instance independent of its status. For the necessary authorization configuration, see the Security Guide for SAP Cloud Platform Workflow at: https://help.sap.com/viewer/p/WORKFLOW_SERVICE. Roles permitted to execute this operation: - Global roles: WorkflowContextViewer, WorkflowContextAdmin - Instance-specific roles: contextViewerUsers, contextViewerGroups, contextAdminUsers, contextAdminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_GET_CONTEXT
200 - Returns the context of the workflow instance.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- The workflow instance ID for which the context should be retrieved. The workflow instance ID is 36
characters long.RestRequestException
- if an error occurs while attempting to invoke the API@Nullable public WorkflowInstance getWorkflowInstance(@Nonnull String workflowInstanceId, @Nullable String $expand) throws RestRequestException
Retrieve workflow instance by ID
Retrieves the workflow instance with the specified workflow instance ID. Roles permitted to execute this operation: - Global roles: WorkflowViewer, WorkflowAdmin - Instance-specific roles: viewerUsers, viewerGroups, adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_GET
200 - The requested workflow instance.
400 - Incorrect format or structure of the provided request body.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- (Required) The ID of the workflow instance, which should be retrieved. The workflow instance ID is 36
characters long.$expand
- (Optional) You can request custom workflow attributes to become part of the workflow instance output
by specifying the value 'attributes' for the '$expand' parameter. Otherwise, if the
'$expand' parameter is not specified, the 'attributes' field is not included into the
output of the workflow instance. Note that labels as well as the order of the custom workflow
attributes in which they are returned, are taken from the latest versions of the workflow definitions
where these attributes are present.RestRequestException
- if an error occurs while attempting to invoke the API@Nullable public WorkflowInstance getWorkflowInstance(@Nonnull String workflowInstanceId) throws RestRequestException
Retrieve workflow instance by ID
Retrieves the workflow instance with the specified workflow instance ID. Roles permitted to execute this operation: - Global roles: WorkflowViewer, WorkflowAdmin - Instance-specific roles: viewerUsers, viewerGroups, adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_GET
200 - The requested workflow instance.
400 - Incorrect format or structure of the provided request body.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- The ID of the workflow instance, which should be retrieved. The workflow instance ID is 36 characters
long.RestRequestException
- if an error occurs while attempting to invoke the API@Nullable public List<WorkflowInstance> getWorkflowInstances(@Nullable String $orderby, @Nullable Integer $skip, @Nullable Integer $top, @Nullable String $inlinecount, @Nullable String $expand, @Nullable String id, @Nullable String definitionId, @Nullable String definitionVersion, @Nullable String status, @Nullable String startedAt, @Nullable String startedFrom, @Nullable String startedUpTo, @Nullable String completedAt, @Nullable String completedFrom, @Nullable String completedUpTo, @Nullable String startedBy, @Nullable String subject, @Nullable String containsText, @Nullable String businessKey, @Nullable String attributesExampleCustomAttribute) throws RestRequestException
Retrieve all instances by query parameters
Retrieves workflow instances by parameters. If no parameters are specified, all RUNNING, or ERRONEOUS instances are returned. Parameters for different attributes of the instance are evaluated using the logical 'and' operator. If multiple parameters are specified for the same attribute or a parameter is specified multiple times, results are matched using the logical 'or' operator, unless noted otherwise. Empty parameters are treated as if they were not given. Roles permitted to execute this operation: - Global roles: WorkflowViewer, WorkflowAdmin - Instance-specific roles: viewerUsers, viewerGroups, adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_GET
200 - Returns a list of workflow instances.
403 - Access forbidden. You do not have the required permissions to access the resource.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
$orderby
- (Optional, default to startedAt desc) The attribute and direction by which workflow instances are
sorted. The sort attribute and direction are separated by a space. The parameter value is
case-sensitive. You can only specify one ordering parameter, which contains attribute and direction.
If sort by definitionVersion is enabled, then definitionId is also added to the sorting query. If not
specified, the results are sorted by the 'startedAt' attribute, in descending order. * id asc
- Ascending, from A to Z case-sensitive. * id desc - Descending, from Z to A case-sensitive. *
definitionId asc - Ascending, from A to Z case-sensitive. * definitionId desc - Descending, from Z to
A case-sensitive. * definitionVersion asc - Ascending, from A to Z case-sensitive. * definitionVersion
desc - Descending, from Z to A case-sensitive. * startedAt asc - Ascending, from A to Z
case-sensitive. * startedAt desc - Descending, from Z to A case-sensitive. * completedAt asc -
Ascending, workflow instance completion or cancelation time from the oldest to the most recent, not
yet COMPLETED workflow instances first. * completedAt desc - Descending, from the most recently
COMPLETED or CANCELED workflow instance to the oldest ones, not yet COMPLETED workflow instances last.
* startedBy asc - Ascending, from A to Z case-sensitive. * startedBy desc - Descending, from Z to A
case-sensitive. * subject asc - Ascending, from A to Z case-sensitive, workflow instances without
subject first. * subject desc - Descending, from Z to A case-sensitive, workflow instances without
subject last. * businessKey asc - Ascending, from A to Z case-sensitive, workflow instances without
business key first. * businessKey desc - Descending, from Z to A case-sensitive, workflow instances
without business key last.$skip
- (Optional, default to 0) Specify the number of records you want to skip from the beginning. You can
skip at most 4000 records. To indicate a result range that starts, for example, at 1001, combine the
$skip with the $top parameter. If not specified, no records are skipped. Refer also to the $top
parameter.$top
- (Optional, default to 100) Specify the number of records you want to show. You can get at most 1000
records per API call. To indicate a result range that starts, for example, at 1001, combine the $top
with the $skip parameter. If not specified, 100 records are returned. Refer also to the $skip
parameter.$inlinecount
- (Optional, default to none) Specify whether the total count of the workflow instances, which match the
search criteria, should be returned as a value of the X-Total-Count response header. To enable the
header, use the 'allpages' setting. To disable the header, use the 'none' setting. The
values are case-sensitive.$expand
- (Optional) You can request custom workflow attributes to become part of the workflow instance output
by specifying the value 'attributes' for the '$expand' parameter. Otherwise, if the
'$expand' parameter is not specified, the 'attributes' field is not included into the
output of the workflow instance. Note that labels as well as the order of the custom workflow
attributes in which they are returned, are taken from the latest versions of the workflow definitions
where these attributes are present.id
- (Optional) Specify the workflow instance ID. The workflow instance ID is 36 characters long.definitionId
- (Optional) Specify the ID of the workflow definition. The ID is at most 64 characters long.definitionVersion
- (Optional) Specify the version of the workflow definition.status
- (Optional) Specify the status of the workflow instance. The values are not case-sensitive.startedAt
- (Optional) Specify at what time the workflow instance was started. Supports two date formats 1)
yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 2) yyyyMMddHHmmss.SSS.startedFrom
- (Optional) Specify the beginning (inclusive) of the time range during which a returned workflow was
started. Supports two date formats: 1. yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 1.
yyyyMMddHHmmss.SSS The parameter operates on the 'startedAt' attribute of a workflow instance.
It is combined with the following parameters, if available: 'startedUpTo' parameter using the
logical 'and' operator; 'startedAt' parameter using the logical 'or' operator.startedUpTo
- (Optional) Specify the end (inclusive) of the time range during which a returned workflow was started.
Supports two date formats: 1. yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 1. yyyyMMddHHmmss.SSS The
parameter operates on the 'startedAt' attribute of a workflow instance. It is combined with
the following parameters, if available: 'startedFrom' parameter using the logical
'and' operator; 'startedAt' parameter using the logical 'or' operator.completedAt
- (Optional) Specify at what time the workflow instance was changed to status COMPLETED or CANCELED.
Supports two date formats: 1. yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 1. yyyyMMddHHmmss.SSScompletedFrom
- (Optional) Specify the beginning (inclusive) of the time range during which a returned workflow was
changed to status COMPLETED or CANCELED. Supports two date formats: 1.
yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 1. yyyyMMddHHmmss.SSS The parameter operates on the
'completedAt' attribute of a workflow instance. It is combined with the following parameters,
if available: 'completedUpTo' parameter using the logical 'and' operator;
'completedAt' parameter using the logical 'or' operator.completedUpTo
- (Optional) Specify the end (inclusive) of the time range during which a returned workflow was changed
to status COMPLETED or CANCELED. Supports two date formats: 1.
yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 1. yyyyMMddHHmmss.SSS The parameter operates on the
'completedAt' attribute of a workflow instance. It is combined with the following parameters,
if available: 'completedFrom' parameter using the logical 'and' operator;
'completedAt' parameter using the logical 'or' operator.startedBy
- (Optional) Specify the user who started the workflow instance, in UTF-8 encoding. The user ID is at
most 255 characters long.subject
- (Optional) Specify the subject of the workflow instance, in UTF-8 encoding. The subject of a workflow
instance is limited to 255 characters.containsText
- (Optional) Specify the text to search for, in UTF-8 encoding. Searches the id, definitionId, subject,
startedBy, and businessKey attributes of the workflow instances. The maximum length of these
attributes is 255 characters.businessKey
- (Optional) Specify the business key of the workflow instance, in UTF-8 encoding. The business key of a
workflow instance is limited to 255 characters.attributesExampleCustomAttribute
- (Optional) Example of a parameter that filters workflow instances by the value of the custom workflow
attribute with the ID 'ExampleCustomAttribute'. You can specify parameters for other
attributes in an analogous way. If you specify a parameter several times, the logical operators apply
as outlined in the overall description of this API. If custom workflow attributes with different IDs
are present in the URL, only workflow instances which contain all of them with the values specified
will be returned as a response to the request. If a query by custom workflow attributes matches too
many workflow definitions, you have to limit the query further. Refer, for example, to parameter
'definitionId'.RestRequestException
- if an error occurs while attempting to invoke the API@Nullable public List<WorkflowInstance> getWorkflowInstances() throws RestRequestException
Retrieve all instances by query parameters
Retrieves workflow instances by parameters. If no parameters are specified, all RUNNING, or ERRONEOUS instances are returned. Parameters for different attributes of the instance are evaluated using the logical 'and' operator. If multiple parameters are specified for the same attribute or a parameter is specified multiple times, results are matched using the logical 'or' operator, unless noted otherwise. Empty parameters are treated as if they were not given. Roles permitted to execute this operation: - Global roles: WorkflowViewer, WorkflowAdmin - Instance-specific roles: viewerUsers, viewerGroups, adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_GET
200 - Returns a list of workflow instances.
403 - Access forbidden. You do not have the required permissions to access the resource.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
RestRequestException
- if an error occurs while attempting to invoke the API@Nonnull public RestResponse overwriteContext(@Nonnull String workflowInstanceId, @Nonnull Object body) throws RestRequestException
Overwrite instance context
Overrides the context for a workflow instance independent of its status. For the necessary authorization configuration, see the Security Guide for SAP Cloud Platform Workflow at: https://help.sap.com/viewer/p/WORKFLOW_SERVICE. Take special care when using this API, because it will override the workflow context, that is, it might change the workflow context in ways that are incompatible with the expectations of the tasks in the workflow definition. Before changing the context, we recommend that you suspend the workflow instance and check that the execution has come to a halt, that is, no further steps are being added to the execution log. Refer to PATCH on the parent resource and GET on the 'execution-logs' sibling resource. Roles permitted to execute this operation: - Global roles: WorkflowContextAdmin - Instance-specific roles: contextAdminUsers, contextAdminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_UPDATE_CONTEXT
204 - The context has been updated.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- Specify the workflow instance ID for which the context should be overridden. The workflow instance ID
is 36 characters long.body
- Specify the new context according to the given schema. The length of the request body is limited to
ensure an optimal operation of the service.RestRequestException
- if an error occurs while attempting to invoke the API@Nullable public List<WorkflowInstanceExecutionLog> retrieveExecutionLogs(@Nonnull String workflowInstanceId) throws RestRequestException
Retrieve execution logs
Retrieves execution logs for a given workflow instance. Roles permitted to execute this operation: - Global roles: WorkflowViewer, WorkflowAdmin - Instance-specific roles: viewerUsers, viewerGroups, adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_GET_EXECUTION_LOGS
200 - Returns a list of execution logs.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- The workflow instance ID for which the execution logs should be retrieved. The workflow instance ID is
36 characters long.RestRequestException
- if an error occurs while attempting to invoke the API@Nonnull public RestResponse updateContext(@Nonnull String workflowInstanceId, @Nonnull Object body) throws RestRequestException
Update instance context
Modifies parts of the context for a workflow instance independent of its status. For the necessary authorization configuration, see the Security Guide for SAP Cloud Platform Workflow at: https://help.sap.com/viewer/p/WORKFLOW_SERVICE. Take special care when using this API, because it might change the workflow context in ways that are incompatible with the expectations of the tasks in the workflow definition. Before changing the context, we recommend that you suspend the workflow instance and make sure that the execution has come to a halt, that is, that no further steps are being added to the execution log. Refer to PATCH on the parent resource and GET on the 'execution-logs' sibling resource. Roles permitted to execute this operation: - Global roles: WorkflowContextAdmin - Instance-specific roles: contextAdminUsers, contextAdminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_UPDATE_CONTEXT
204 - The context has been updated.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- Specify the workflow instance ID for which the context should be modified. The workflow instance ID is
36 characters long.body
- Specify the modified parts of the context. Note that the modification is limited by the allowed
content length of the request body. The length is restricted to ensure an optimal operation of the
service.RestRequestException
- if an error occurs while attempting to invoke the API@Nonnull public RestResponse updateInstances(@Nonnull List<Object> body) throws RestRequestException
Delete instance by ID
Modifies the given workflow instances according to the specified operations. Currently, the only operation supported is the deletion of workflow instances. You can at most specify 10000 instances to delete in one API call. Roles permitted to execute this operation: - Global roles: WorkflowTenantOperator - Scope: WORKFLOW_INSTANCES_UPDATE
200 - Requested operations were completed successfully. Note: You also receive this response code if you have not requested an operation on any of the workflow instances or if the list of workflow instances was empty.
202 - The request was successful and corresponding operations with process instances will be performed asynchronously. The response will include the header 'Location' that points to a dedicated resource. Using this resource you can track the status of the operation.
400 - Incorrect format or structure of the provided request body.
403 - Access forbidden. You do not have the required permissions to access the resource.
422 - The request body contains at least one entry for which you have not provided a workflow instance ID.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
body
- Specify the request body according to the given schema. Note that the length of the request body is
limited to ensure an optimal operation of the service.RestRequestException
- if an error occurs while attempting to invoke the API@Nonnull public RestResponse updateRoles(@Nonnull String workflowInstanceId, @Nonnull WorkflowInstanceRolesPATCH body) throws RestRequestException
Update instance roles
Updates the instance-specific role assignments of the given workflow instance. Any of the role assignment properties that is present in the request body will overwrite the existing assignments with the new assignments. Any properties that are either null or not present at all in the request body will leave the corresponding role assignments unchanged. The maximum number of users and groups that can be assigned to each role is limited to 100. The use of expressions as part of the role assignments (e.g. ${context.variable}) is only allowed for workflow instances that are not yet COMPLETED or CANCELED. Roles permitted to execute this operation: - Global roles: WorkflowAdmin - Instance-specific roles: adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scope: WORKFLOW_INSTANCE_UPDATE_ROLES Examples: - Setting **viewerUsers: \"UserId1, UserId8\"** will remove all existing user assignments of the viewer role and then assign only the two specified users to the role. - Setting **viewerUsers: \"\"** will remove all existing user assignments of the viewer role. - Specifying any non-null **viewerUsers** in the request body and leaving out **viewerGroups** will update the user assignments and leave the group assignments unchanged.
204 - The workflow instance role assignments were updated.
400 - The workflow instance that you specified is already in status COMPLETED or CANCELED and you attempted to use expressions in your operation.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- The workflow instance ID for which the role assignments should be updated. The workflow instance ID is
36 characters long.body
- Specify new role assignments.RestRequestException
- if an error occurs while attempting to invoke the API@Nonnull public RestResponse updateWorkflowInstance(@Nonnull String workflowInstanceId, @Nonnull WorkflowInstancePATCH body) throws RestRequestException
Update instance
Modifies the properties of a given workflow instance, for example, sets its status to CANCELED or RUNNING. Status change effects may not take effect immediately, due to asynchronous processing of the request. When you change the status to CANCELED, note the following: * Workflow instances in CANCELED status are considered final, that is, no further changes are allowed. This is valid as well for other APIs and the processing according to the workflow definition. * Workflow instances in CANCELED status stop processing as soon as the system allows. When you are changing the status to SUSPENDED, note the following: * Status SUSPENDED manually and temporarily suspends processing. * Workflow instances in SUSPENDED status stop processing as soon as the system allows. * Workflow instances remain in SUSPENDED status until a status change to RUNNING or CANCELED is requested. * While the workflow instance status reported by the respective API might change with immediate effect, follow-up actions might only be successful, after asynchronous processing within the workflow instance actually has stopped. To check whether asynchronous processing is ongoing, analyze the execution logs or check the workflow definition structure. When you are changing the status to RUNNING, note the following: * For workflow instances in ERRONEOUS status, this retries the failed activities. If these activities continue failing, the workflow instance automatically moves again into ERRONEOUS status. * If the workflow instance had previously been suspended while in ERRONEOUS status, failed activities, such as service tasks, are retried. Roles permitted to execute this operation: - Global roles: WorkflowAdmin - Instance-specific roles: adminUsers, adminGroups [Prerequisite: You are assigned to the WorkflowParticipant global role.] - Scopes: WORKFLOW_INSTANCE_CANCEL, WORKFLOW_INSTANCE_RETRY_RESUME, WORKFLOW_INSTANCE_SUSPEND
202 - The request is successful and the properties will be changed asynchronously.
400 - Incorrect format or structure of the provided request body.
403 - Access forbidden. You do not have the required permissions to access the resource.
404 - URL not found. Check whether the URL is correct and whether you refer to an existing workflow instance.
422 - The status provided in the request body was invalid.
429 - You have reached the usage limits that are configured for your tenant. You are performing too many requests or consume too many resources.
500 - Internal server error. The operation you requested led to an error during execution.
workflowInstanceId
- The ID of the workflow instance, which should be modified. The workflow instance ID is 36 characters
long.body
- The value for the parameter bodyRestRequestException
- if an error occurs while attempting to invoke the APICopyright © 2020 SAP SE. All rights reserved.