Flow Designer: With 'Request Cancelled' stage 'Always Show' as false, request state not updated accordingly when RITM is rejected by approver


Description

Stage which isn't always shown isn't shown when it's actually hit.  This happens when there's more than one occurrence of that same stage and the first occurrence is skipped.

Steps to Reproduce

1. Install the "Flow Designer Support for Service Catalog" Plugin with demo data,
2. Open the Flow designer flow called 'Service Catalog Item Request', see that there are a number of stages being used on this flow OOB, See that 'Request Canelled' is only referenced on alternate paths to the critical path.
3. Select the options menu (next tot he activate/deactivate button) and then 'stages' to open the Stage config window.
4. set the 'Show Always' slider on the request canceled Stage to false. Now this stage should only be displayed on the visualisation IF either the sate is currently set to 'Request cancelled' on the request, OR the stage is configured on the flow to trigger in the critical path, (which its not)
5. save and publish the Flow.
6. Open a Request Item and Configure it to use the 'Service Catalog Item Request' Flow for processing and not the legacy Workflow
7. Raise a new Request for this item and reject the request when it is sent for approval

Expected: Request Item and Request state should update accordingly
Actual: It remains in the same state

Workaround

  1. Make the stage which isn't "Always Show" always shown
  2. Make unique Request Cancelled stages for each occurrence.
    Example:
    Request Cancelled due to Operational Approval
    Request Cancelled due to Business Approval

Related Problem: PRB1377525