microsoft / powercat-business-approvals-kit

MIT License
34 stars 3 forks source link

[Business Approvals Kit - Feature]: Add new End Workflow Node Type #277

Open shrikant-singh31 opened 2 months ago

shrikant-singh31 commented 2 months ago

Is your feature request related to a problem? Please describe.

In the current version of the Business Approvals Kit, all custom response approvals remain in new state as we are not sure which custom response will be considered as Completed and which of them will be considered as Canceled. To end the workflow with the particular status we propose using End Workflow node type with previous node outcome in next Stage condition. The End Workflow feature can also be used as an independent feature where user don't want the workflow to continue and wants to end the workflow based on some conditions in a particular branch. The feature is not restricted for handling custom responses node only but it can be used in any branch where user wants to exit the workflow with a particular instance status.

Business Context: The End Workflow node type feature would allow users to end the workflow in between if there is no further approval required. It gives users the flexibility of ending the workflow instead of processing all the nodes of each stage whenever they want by adding the End Workflow Node type. It also enables them to end or take particular action for a custom response nodes by using the Previous Node Outcome condition.

Describe the solution you'd like

The End Workflow node type feature could be implemented by adding a new choice to the Node type global choice. Add a new column Instance Status in design and runtime node tables. Also add a End Workflow flag in Stage Instance table. Adding a new End Workflow panel with columns Name, Description and Instance Status. Add logic for End Workflow node type in flow.

Describe alternatives you've considered

No response

Additional context?

End Workflow feature-1 End Node Panel

For above process in screenshot-1 we have 1st node in Stage S1 has approval type as custom responses with options being Yes,No and Maybe. If the response is not Yes then in the next stage S2 condition result will be false and it goes to process the false node 'End Workflow Node S2' which is of type End Workflow and will terminate the process with Canceled status as set in the End Node panel (refer screenshot 2) and not go on processing further nodes and stage S3 after that node. The feature is not restricted for handling custom responses node but it can be used in any branch where we want to exit the workflow with a particular instance status.

MCSDWes commented 1 month ago

@shrikant-singh31 - Is it possible to have this option available in the first Node as well? For example, I have an absent request approval which goes into a condition. If the submitted data is equal to today's date then I need to end the flow as Completed if not then send approval. However, Go To stage and End Workflow are grayed out in the first Node.