# Workflow Application: RAISEEXCEPTION usage

**URL:** <https://discuss.workflowgen.com/t/workflow-application-raiseexception-usage/1604>\
**Category:** Workflow Applications\
**Created:** [March 31, 2020, 7:20pm UTC](https://discuss.workflowgen.com/t/workflow-application-raiseexception-usage/1604 "2020-03-31T19:20:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [March 31, 2020, 7:20pm UTC](https://discuss.workflowgen.com/t/workflow-application-raiseexception-usage/1604/1 "2020-03-31T19:20:43Z")

</div>

The RAISEEXCEPTION workflow application raises the cancel exceptions on specified actions, as controlled by the action cancellation workflow exception in the conditions definition panel.

For more information, including a list of possible execution errors, see the [RAISEEXCEPTION Workflow Application](https://docs.workflowgen.com/admin/workflow-applications/raiseexception-workflow-application) section in the [WorkflowGen Administration Guide](https://docs.workflowgen.com/admin/).

### Default parameters

The `REQUEST_ID` and `ACTIVITY_NAME` parameters must always be used together.

| Parameter | Type | Direction | Description |
| --- | --- | --- | --- |
| `REQUEST_ID` | Numeric | IN | ID of the request where the action will be cancelled |
| `ACTIVITY_NAME` | Text | IN | Name of the action that will be cancelled |

#### Example

‌In this example, the application will cancel all instances of the `PENDING_ACTION` action in request `455` :

```auto
REQUEST_ID = 455  
ACTIVITY_NAME = "PENDING_ACTION"

```

### Optional parameters

The `REQUEST_ID_LIST` and `ACTIVITY_NAME_LIST` parameters must always be used together.

| Parameter | Type | Direction | Description |
| --- | --- | --- | --- |
| `REQUEST_ID_LIST` | TEXT | IN | List of request IDs where the action will be cancelled |
| `ACTIVITY_NAME_LIST` | TEXT | IN | List of action names that will be cancelled |
| `USERNAME` | TEXT | IN | Used to set the username used to cancel the action  

- This username must be part of a participant of the process.
- If this parameter is not specified then the account used is the one defined as the **Workflow engine service default identity** in the **Configuration Panel**

 |
| `PASSWORD` | TEXT | IN | Used to set the password corresponding to the username used to cancel the action |
| `EXCEPTION_NAME` | Text | IN | Exception that will be triggered on the action (`CANCEL`, `ERROR`, `TIMEOUT`, `ASSIGNMENT_ERROR`) |
| `EXCEPTION_MESSAGE` | Text | IN | Used with the `ERROR` exception name to provide more details about the error in the follow-up action |

#### Examples

In this example, the application will cancel all the instances of the actions `PENDING_ACTION1` and `PENDING_ACTION2` in each of requests `445` , `446` , and `447` :

```auto
REQUEST_ID_LIST = "455, 456, 457"  
ACTIVITY_NAME_LIST = "PENDING_ACTION1, PENDING_ACTION2"

```

In this example, the application will cancel all the instances of the action named `PENDING_ACTION` in request `445` on behalf of John Doe ( `jdoe` ):

```auto
REQUEST_ID = "455"
ACTIVITY_NAME = "PENDING_ACTION"
USERNAME = "jdoe"
PASSWORD = "1234"

```

### Additional parameters

| Parameter | Type | Direction | Description |
| --- | --- | --- | --- |
| `EX?_REQUEST_ID` | Numeric | IN | Indicates the ID of the request where the action will be cancelled for the pair specified by the `?` (question mark) |
| `EX?_ACTIVITY_NAME` | Text | IN | Indicates the name of the action that will be cancelled for the pair specified by the `?` (question mark) |
| `IGNORE_NOTHINGTODO_ERROR` | Text | IN | Ignore `Nothing to do` error  
  
By default, `RAISE_EXCEPTION` returns an error if you try to cancel an action that doesn’t have any open instantiation. If you set this parameter value to `Y` , the application will ignore this type of error. |

#### Example

In this example, the application will cancel all instances of the `PENDING_ACTION1` action in request `455` and all instantiations of the `PENDING_ACTION2` action in request `456` . If actions `455` and `456` have no instance then no error is raised.

```auto
EX1_REQUEST_ID = 455
EX1_ACTIVITY_NAME = "PENDING_ACTION1"
EX2_REQUEST_ID = 456
EX2_ACTIVITY_NAME = "PENDING_ACTION2"
IGNORE_NOTHINGTODO_ERROR = "Y"

```

---

<div class="post-metadata">

**Author:** ![jianan.hsu](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/jianan.hsu/32/411_2.png) [@jianan.hsu](https://discuss.workflowgen.com/u/jianan.hsu)\
**Post date:** [November 29, 2024, 9:44pm UTC](https://discuss.workflowgen.com/t/workflow-application-raiseexception-usage/1604/3 "2024-11-29T21:44:47Z")

</div>


