--- title: "Changing a workitem state in a workflow" slug: "changing-a-workitem-state-in-a-workflow" updated: 2024-01-24T13:50:59Z published: 2024-01-24T13:50:59Z canonical: "help.pillir.io/changing-a-workitem-state-in-a-workflow" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.pillir.io/llms.txt > Use this file to discover all available pages before exploring further. # Changing a Workitem state in a Workflow My App design consists of a workflow process where a form needs to be approved at two levels. How do I set the workitem state at each level? In a workflow app the navigational arrows help to connect app components in two lanes(levels). While connecting two lanes, these arrows denote a particular state of the action. For example: 'Pending Approval'. The default states are 'Draft' and 'Completed'. Right-click the arrow and define a 'New Sate' if required. The following usecase provides an insight into defining the workitem state at two levels: Use-Case: This is a timesheet app. The employee submits a time sheet for approval at two levels. - Level 1 - Manager 1 - Here Manager 1 approves/rejects the timesheet using Approval App 1. If Approved, the workitem goes to Manager 2 for approval. If rejected, the workitem goes back to the employee for re-submission. - Level 2 - Manager 2 - Here Manager 2 approves/rejects the timesheet using Approval App 2. If Approved, the workflow is completed. If rejected, the workitem goes back to the employee for re-submission.[Video](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/EmpTS.mp4) ## Workitem States Defined for the Usecase: NoteThe following steps cover only about the different workitem states and how to define them in the APM. Other page related logic are not covered. ### Steps 1. **Draft** - This is a default state in a workflow. It points to the timesheet form(**TimeEntry page**) where the employee fills the timesheet. The employee clicks **Submit** after entering the timesheet.![draft1(1)](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/draft1(1).png) 2. A **State_Change** BOS is added to facilitate state change. Right-click and select '**Execute in workflow**'.![workflowbos-2(1)](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/workflowbos-2(1).png) 3. Connect the BOS arrow to **Manager1TS** page in Lane 2.  Right-click the arrow and define the state as '**PendingManagerApproval**'.![connecttomanager1-3](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/connecttomanager1-3.png) When the employee clicks 'Submit', the workitem state changes from 'Draft' to 'PendingManagerApproval'. NoteThe State_Change is an empty BOS. This is added since its a workflow component and helps to connect to the Lane 2  Manager TS page. You cannot connect lane 1 page component directly to the lane 2 page component, since they are non-workflow components. 1. A **Condition**(validation_1stapproval) component is added in lane 2. Right-click and select 'Execute in workflow'.![connecttomanger2-4](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/connecttomanger2-4.png) 2. The '**Yes**' arrow of the condition is connected to lane 3 **Manager2TS** page. 3. Right click the arrow and define the state '**PendingManager2Approva****l**'. 4. The '**No**' arrow is connected to the **TimeEntry** page. Set the state as '**Draft**'.![connectotimesheet-5](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/connectotimesheet-5.png) The condition checks if the workitem status is '**Approve****d**'. If approved, it connects to the lane 3 **Manager2TS** page. If the status is '**Rejected',** it connects to the **TimeEntry** page.![connecttocomplete-6](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/connecttocomplete-6.png) 1. A **Condition** component is added in lane 3. Right-click and select 'Execute in workflow'. 2. The '**Yes**' arrow of the condition completes the workflow. 3. Right click the arrow and define the state '**Completed**'. 4. The '**No**' arrow is connected to the **TimeEntry** page. Set the state as '**Draft**'. The condition checks if the workitem status is '**Approved**'. If approved, it connects to the **end**. If the status is '**Rejected**', it connects to the **TimeEntry** page. ## Points to Consider 1. **Do not define multiple workitem states** in the same lane. It leads to less clarity in the App design and complicates future customizations. ![multipleapprovals](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/multipleapprovals.png) 2. Each workitem and its state can be seen in the Console > Universal Worklist Log. ![universalworklist](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/universalworklist.png)