Stop-KFScript

Syntax

For PowerShell workflows:

Stop-KFScript

For SharePoint and email workflows:

Stop-KFScript
  [-StopWorkflow]
  [-StopWeb]
  [-StopList]
  [-StopState]
  [-Failed]

Support

>= kenaflow 2.0.14

Return

Nothing.

Description

This cmdlet can be used to force a workflow script to spot immediately at this point of execution.

Without any additional parameter the script stops immediately.

  • In case of list or state workflows for SharePoint only the current execution of the script for the current list item will be stopped.
  • In case of email workflows only the current execution of the script for the current email will be stopped.

In case of SharePoint workflows and E-Mail workflows the parameters -StopWorkflow can be used to stop the workflow execution for this time. (The workflow will start again later as configured.)

In case of SharePoint state machine workflows and SharePoint list workflows the parameter -StopList can be used to stop the execution of the current workflow list. This is only relevant if you have specified more than 1 list to be processed by the workflow. Otherwise it will stop the workflow.

In case of SharePoint state machine workflows and SharePoint list workflows the parameter -StopWeb can be used to stop the execution of the current web. This is only relevant if you have specified more than 1 web to be processed by the workflow. Otherwise it will stop the workflow.

In case of SharePoint state machine workflows the parameter -StopState can be used to stop the execution of the current workflow state.

In case of PowerShell workflows there are no parameters besides -Failed. You can only stop the whole workflow by using the cmdlet.

To mark the workflow execution as "failed" the parameter -Failed can be used.

Parameters

-StopWorkflow

Stop the execution of the current workflow. No more items will be executed in the current workflow run.

-StopState

Stop the execution of the current state. No more items in this state will be executed in the current workflow run.

-StopList

Stop the execution of the current workflow list. No more items in this list will be executed in the current workflow run.

-StopWeb

Stop the execution of the current web. No more items in this web will be executed in the current workflow run.

-Failed

Used to mark the execution as "failed".

Examples

Stop-KFScript

This stops the current item for SharePoint workflows and email workflows. For PowerShell workflows it stops the workflow.