# Class PredefinedActions OptimaJet.Workflow.Core.PredefinedActions.PredefinedActions Contains all predefined actions Namespace: [OptimaJet.Workflow.Core.PredefinedActions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.PredefinedActions/) ```csharp public static class PredefinedActions ``` ## Methods `public static Task CheckAllSubprocessesCompletedAsync(ProcessInstance processInstance, WorkflowRuntime runtime)` Check that all subprocesses was completed ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | ### Returns | Type | Description | | --- | --- | | `Task` | true - if there are no active suprocesses | `public static bool CheckAllSubprocessesCompleted(ProcessInstance processInstance, WorkflowRuntime runtime)` Check that all subprocesses was completed ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | ### Returns | Type | Description | | --- | --- | | `Boolean` | | `public static bool CheckAllSubprocessesAndParentProcessCompleted(ProcessInstance processInstance, WorkflowRuntime runtime)` Checks whether a process and all of its direct subprocess branches have converged at the same subprocess merge activity. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | The [ProcessInstance](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) on which the outgoing transition from the merge activity is being evaluated. | | `runtime` | `WorkflowRuntime` | The [WorkflowRuntime](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) used to inspect the active subprocess tree. | ### Returns | Type | Description | | --- | --- | | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when [ProcessInstance.CurrentActivity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) is the [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) activity of [ProcessInstance.ExecutedTransition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) and no direct subprocesses remain active; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | ### Remarks Use this method as a condition on an outgoing transition from a subprocess merge activity. It permits that transition only after the process itself is waiting at the merge activity and every direct subprocess branch has finalized and merged into it. `public static Task CheckAllSubprocessesAndParentProcessCompletedAsync(ProcessInstance processInstance, WorkflowRuntime runtime)` Checks whether a process and all of its direct subprocess branches have converged at the same subprocess merge activity. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | The [ProcessInstance](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) on which the outgoing transition from the merge activity is being evaluated. | | `runtime` | `WorkflowRuntime` | The [WorkflowRuntime](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) used to inspect the active subprocess tree. | ### Returns | Type | Description | | --- | --- | | `Task` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when [ProcessInstance.CurrentActivity](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) is the [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) activity of [ProcessInstance.ExecutedTransition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) and no direct subprocesses remain active; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | ### Remarks Use this method as a condition on an outgoing transition from a subprocess merge activity. It permits that transition only after the process itself is waiting at the merge activity and every direct subprocess branch has finalized and merged into it. `public static Task DeleteAllSubprocessesAsync(ProcessInstance processInstance, WorkflowRuntime runtime)` Delete all subprocesses for process ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | ### Returns | Type | Description | | --- | --- | | `Task` | Count of deleted subprocesses | `public static int DeleteAllSubprocesses(ProcessInstance processInstance, WorkflowRuntime runtime)` Delete all subprocesses for process ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | ### Returns | Type | Description | | --- | --- | | `Int32` | Count of deleted subprocesses | [Previous SystemTextLoopTypeConverter](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Plugins.LoopsPlugin.Other/SystemTextLoopTypeConverter/) [Next ActorsApi](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/ActorsApi/)