Description
In HCL Leap, there are scenarios where we need to identify the next workflow stage before the form is saved or before the user completes an action such as clicking a Validate or Submit button.
Currently, to determine the next stage, we need to use PAction and manually perform the required workflow mapping/logic to identify where the form will move next. This requires additional configuration and custom logic, especially for workflows with multiple stages and conditional transitions.
Proposed Enhancement
HCL Leap could provide a built-in way to determine the next workflow stage/action before the form is actually saved or submitted.
For example, provide an API, expression, or workflow function such as:
Get Next Stage / Get Next Workflow Action
which could be evaluated during:
Form validation
Button click events
Before Save
Before Submit
Client-side validation
Conditional UI logic
The functionality should evaluate the configured workflow conditions and return the stage/action that the form would move to based on the current form data.
Example
Before the user clicks Submit, the application may need to display:
"After submission, this request will move to Manager Approval."
Or it may need to perform additional validation based on the expected next stage.
Instead of manually recreating the workflow mapping using PAction, the application should be able to directly query the workflow:
Current Stage → Evaluate Conditions → Next Stage / Action
Benefits
Eliminates duplicate workflow-mapping logic.
Reduces the need for custom PAction implementations.
Makes complex workflows easier to maintain.
Allows developers to perform validation based on the actual next workflow stage.
Provides better visibility to users before submitting a form.
Ensures custom logic stays synchronized with the configured workflow.