Search

Home

Home

STOP PROCESS

STOP PROCESS

The STOP PROCESS operator allows you to immediately stop the entire data processing flow at the point where the operator is placed. This enables a controlled interruption of further processing without the need to pass through the remaining operators and paths defined in the project.

When stopping the process, you can choose whether it should end with an error or a successful result. The operator also allows you to manage database transactions that were opened during the process — you can decide whether they should be committed or rolled back.

For this reason, the STOP operator is useful in situations where continuing the process no longer makes sense (for example, when an error is detected or an end condition is met). It allows the process to end efficiently without performing unnecessary steps.

Example of a GRAVITY project that uses the STOP:

image

OPERATOR CONFIGURATION

You must decide in the Action field whether stopping the project should generate a process execution error and how to handle any database transactions opened within the project.

image

You can choose from four options:

  • Stop processing with error and rollback → Stops the process with an error and rolls back all transactions.
  • Stop processing with success and commit → Stops the process successfully and commits all transactions.
  • Stop processing with error and commit → Stops the process with an error and commits all transactions.
  • Stop processing with success and rollback→ Stops the process successfully and rolls back all transactions.

In the Message field, you can specify the message that will be passed to the method invoking the project.

This message can be parameterized using bus bits or project parameters.

image

Although the message is always returned, it is most meaningful when the response is processed by the invoking mechanism. Therefore, when using the REST API invocation mechanism, the returned message is most significant.

When the Stop with error… option is selected in the Action field, the GRAVITY server handling REST API requests will return StatusCode = 500 and the following body:

{
"process_id": 33294,
"state": "Fault",
"error": "Value of message field  \r\n"
}

When the Stop with success… option is used, it will return StatusCode = 200 and the following body:

{
"process_id": 33292,
"state": "Success",
"message": "Value of message field  \r\n"
}

where the error and message fields originate from the Message field definition in the STOP operator:

icon
For more information about REST API calls and responses in GRAVITY, see the chapter REST API Invocation and Response.