--- alias: user-guide-business-workflow-task-resource-change-state render_macros: false description: "This task facilitates changing a resource’s state based on defined conditions and actions" --- # Change State The task allows the user to Change State of a Resource. ![Screenshot showing a business workflow task resource change state, with "Material Abort Post 1" as the task name.](images/business_workflow_task_resource_change_state.png) ??? example "Example" Trigger: - Task Name: `MaterialAbortPost_1` - Meaning: After performing Abort Material. Condition: - Input Expression: `{{$MaterialAbortPost_1.Resource.Type=="Legacy"}}` - Meaning: If the Resource from which the Material was aborted is of Type "Legacy". Action: - Input: - `{{$MaterialAbortPost_1.Resource}}` - `"Unscheduled Down"` - Meaning: The Resource from which the Material was aborted transitions to the Unscheduled Down state. ## Behavior The user will define a Resource, a New State and a Reason. ## Inputs | Name | Data Type | Description |Expression| | --------------- | ---------- | - |--- | | `Resource` | `Resource` | The Resource that will be modified |- `{{$.Resource}}`
- ``| | `NewState` | `String` | The New State of the Resource |- ``| | `Reason` | `String` | The Reason for the state change if available || | `Comment` | `String` | An optional comment that will be associated with the operation that is being executed || ## Outputs | Name | Data Type | Description | | --------------- | ---------- | - | | `Resource` | `Resource` | The Resource that was modified | ## Remarks The Resource input can be defined by the user as a simple name or an expression, such as **\{\{\$task.Resource\}\}** where `task` is the name of a block that has the Resource as input/output.