# Class ProcessInstanceExtensions OptimaJet.Workflow.Plugins.LoopsPlugin.ProcessInstanceExtensions Namespace: [OptimaJet.Workflow.Plugins.LoopsPlugin](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/) ```csharp public static class ProcessInstanceExtensions ``` ## Methods `public static Task GetLoopStateAsync(this ProcessInstance processInstance, string loopName)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `loopName` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public static Task SetLoopStateAsync(this ProcessInstance processInstance, string loopName, LoopState loopState)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `loopName` | `String` | | | `loopState` | `LoopState` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public static Task LoopContinueAsync(this ProcessInstance processInstance, string loopName)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `loopName` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public static Task LoopBreakAsync(this ProcessInstance processInstance, string loopName)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `loopName` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public static Task GetLoopCurrentCounterValueAsync(this ProcessInstance processInstance, string loopName)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `loopName` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public static Task GetLoopPrevCounterValueAsync(this ProcessInstance processInstance, string loopName)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `loopName` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public static Task GetLoopNextCounterValueAsync(this ProcessInstance processInstance, string loopName)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `loopName` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | [Previous ParametersLoopPlugin](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/ParametersLoopPlugin/) [Next StepsType](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/StepsType/)