Instances
The Instances tab is used to administer active instances of workflows in the environment.
To manage a workflow instance, select the instance from the list and click a button in the toolbar to perform that action on the instance. Use the table below for reference (note that not all the listed buttons may be visible or enabled):
Option | Description | Notes |
---|---|---|
Restart | Resume an instance that is in the “Stopped” state. |
To resume an instance that was previously stopped, click on the stopped instance from the view and click the Start button. The status of the instance will change from Stopped to Active and the workflow instance will continue from the workflow step where it was previously stopped. You can only Start a process that is in the “Stopped” state The Start/Stop functions are normally used to suspend execution for processes temporarily, for example to hold off execution until a problem has been resolved. Note that if any events like Escalations occur while the process is stopped, K2 will not execute those actions while the process is stooped, but will execute them immediately when the process is started if the escalation time was reached while the workflow was stopped. Stopped instances will not appear in users’ worklists. |
Stop | Stop (suspend) the selected instances if the workflow is in “Active” or “Running” status. |
To stop a running instance, click on the instance from the view and click the Stop button. Click OK on the confirmation message. The status of the instance will change from Active to Stopped. You can only Stop process instances that are in the “Active” or “Running” state. “Active” means that the process is “alive” but waiting for something to happen. Usually this means that there is a client event that must be completed before the process can continue. “Running” means that K2 is busy executing code against the process. Processes should never be in “running” status for more than a few seconds (a few minutes is exceptional cases). If a process is constantly in the “running” status, it usually means that the workflow is in an endless loop and is negatively affecting the performance of the K2 server. |
Delete | Delete the process instance. |
To delete an instance, click on the instance or select a group of instances from the view, and then click the Delete button. On the Delete Instances page, check the Delete Reporting Data (Logs) checkbox to delete the logging information of the process instances. Then click OK. Deleted instances cannot be recovered. |
Go To Activity | Force an active process to go to a specific activity in the workflow. |
To go to a specific step in an active workflow, select the instance from the view and click the GoTo Activity button. Select the Activity Name you want to go to and click OK. Click OK on the confirmation message and OK again on the information message. The workflow instance will now continue with the activity that has been selected. This function is normally use to “skip” steps in the workflow or force the process to go back to a previous step. You can only redirect the process back to an activity in the same version of the process: if a newer version of the workflow has additional activities, they will not appear in this list. Note that K2 will execute all rules for the activity (e.g. destination rules, escalations etc.) again if the activity is restarted. |
View Flow | Opens the View Flow report for the selected instance. See How To: Expire Parallel Tasks Based on a Condition for an example of using the View Flow to observe the behavior of a workflow. | To view the real time execution of a workflow instance, select the instance from the view and click View Flow. For more information on how the View Flow can be used and what information is available, see the View Flow topic. |
Start New | Start a new instance of the workflow manually, optionally specifying the folio and entering values for any process-level data fields. See How To: Expire Parallel Tasks Based on a Condition for an example of using the Start New function to start a new instance of a workflow. |
Normally used to start "test" instances of a workflow manually, to start workflows that do not have an associated interface for starting the workflow, or to start a process that performs some type of “polling” action. You can provide a Folio for the new instance, specify whether the instance should start Synchronously or Asynchronously, and provide values for the process-level data fields and XML datafields defined in the workflow. |
Refresh | Reload the list of workflow instances. | To reload the list of workflow instances in the view, click the Refresh button. Any instance started since accessing this page or a previous refresh, will now be added to the workflow instances listed in the view. |
Retry | Retry an instance that is in Error status. | Use this option to retry a instance that is in Error state. See the topic Retrying workflow errors for more information on using the Retry command. |
Selected Filter | Create a filter. | A predefined filter is configured to return the workflow instances in the view. You can however create various filters that are saved for reuse when revisiting this page. Follow these steps to create a reusable filter. |
Quick Search | Search for workflow instances by predefined filters. | The Quick Search filter allows you to search for workflow instances by predefined filters. The quick search is however a once off search that is not saved. Follow these steps to learn how to use the Quick Search functionality. |
Considerations when managing instances of a workflow
- Once an instance of the workflow is Completed, it can no longer be managed using the Instances tab. A workflow instance is “Completed” when the process has nowhere else to go. This means that if the developer made a logic error (for example in a line rule) that caused the process to complete unexpectedly, you cannot “re-start” the process or force the process to skip that line, since it has already completed. The only way is to fix the logic error, deploy the process and then create a new instance of the workflow.
- You should take extra care when using the Instances functions to manage process instances. Taking override or delete actions in a production environment may lead to unintended consequences and the override actions you take may be irrevocable. You should understand the impact that the administrative override action will have on the workflow before performing that action