Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

The Finish Instruction makes

Purpose

...

an order

...

leave a workflow or branch of the JS7 - Fork-Join Instruction. The order is considered

...

to be completed and will assume a successful or unsuccessful outcome in the JS7 - Order History, for details about order states see JS7 - Order State Transitions.

  • By default finished orders leave the workflow or branch with an unchanged outcome.
    • If a Finish Instruction is used in the Catch block of a JS7 - Try-Catch Instruction then by default the outcome will be successful as a previous error is caught before the Finish Instruction is executed..
    • Other occurrences of the Finish Instruction will pick up the order's successful or unsuccessful outcome.
  • Users can specify a successful outcome to be forced on an order from the occurrence of the Finish Instruction.
  • Users can specify an unsuccessful outcome to be forced on an order from the occurrence of the Finish Instruction. Such orders appear in the Order History with a failed history status.
  • is assigned the FINISHED state.
  • FINISHED orders remain with their workflow and cannot transition from this state. They require user intervention to make them leave the workflow.
  • Users have to cancel FINISHED orders, see JS7 - Order State Transitions

Workflow Instruction: Finish

Download Workflow Example (.json upload)pdwFinish.json

Image Removed

Finish Instruction with unchanged Outcome

Image Added


Explanation:

  • The workflow makes use of a Try/Catch Instruction. If job1 in the Try block fails then the order will assume an unsuccessful outcome.
  • The Catch block will catch the error and will cause the order's outcome to be successful.
  • The Finish Instruction will make the order leave the workflow without modifying its outcome. Therefore the final outcome will be successful (unchanged).

Finish Instruction with successful Outcome

Image Added


ExplanationExplanations:

  • The workflow makes use of an If Instruction to check a previous job's return valuesvalue. See See JS7 - If Instruction for details of how to add expressions to If Instructions.
  • If the If Instruction evaluates to true then the left-hand branch with the Finish Instruction is executed which is configured to force a successful outcome.
  • The order is then assigned the FINISHED state.optionally assigned a message, for example, specifying the reason for finishing the order.
  • Display feature availability
    StartingFromRelease2.5.4

Finish Instruction with unsuccessful Outcome

Image Added


Explanation:

  • If the If Instruction evaluates to false then the right-hand branch with the Finish Instruction is executed.
  • The radio-button for Unsuccessful outcome is selected.
  • The order can optionally be assigned a message, for example, specifying When finishing an order then a message and a return code optionally can be added that specify the reason for finishing the order.
  • Display feature availability
    StartingFromRelease2.5.0