# Class Loop OptimaJet.Workflow.Plugins.LoopsPlugin.Loop Namespace: [OptimaJet.Workflow.Plugins.LoopsPlugin](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/) ```csharp [JsonConverter(typeof(NewtonsoftLoopTypeConverter))] [JsonConverter(typeof(SystemTextLoopTypeConverter))] public abstract class Loop ``` ## Type Hierarchy - Loop Current type - [LoopFor](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/LoopFor-TStartEndValues-TStep/) - [LoopForDateTime](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/LoopForDateTime/) - [LoopForInt](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/LoopForInt/) - [LoopForeach](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/LoopForeach/) ## Attributes - `Newtonsoft.Json.JsonConverterAttribute`: Attribute of type Newtonsoft.Json.JsonConverterAttribute - `System.Text.Json.Serialization.JsonConverterAttribute`: Attribute of type System.Text.Json.Serialization.JsonConverterAttribute ## Properties `public abstract string LoopType { get; }` ## Methods `protected abstract bool ConditionValid(LoopCounter counter)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `counter` | `LoopCounter` | | ### Returns | Type | Description | | --- | --- | | `Boolean` | | `public abstract Task InitAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `protected abstract LoopCounter DoStep(LoopCounter counter, StepsType stepType)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `counter` | `LoopCounter` | | | `stepType` | `StepsType` | | ### Returns | Type | Description | | --- | --- | | `LoopCounter` | | `public static Task GetLoopAsync(ProcessInstance processInstance, string loopName)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `loopName` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task SetStateAsync(ProcessInstance processInstance, LoopState loopState)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `loopState` | `LoopState` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task GetStateAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `protected Task GetCounterAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `protected Task SetCounterAsync(ProcessInstance processInstance, LoopCounter counter)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `counter` | `LoopCounter` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task GetPrevCounterValueAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task GetCurrentCounterValueAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task GetNextCounterValueAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task IsCompletedAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task DoStepAsyncAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task ContinueAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task BreakAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task CompleteAsync(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | ## Fields `public string Name` `public string StateParameterName` `public string CounterValueParameterName` `public StepsType StepType` `public bool IncludeLastValue` [Previous CounterType](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/CounterType/) [Next LoopCounterExtensions](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.LoopsPlugin/LoopCounterExtensions/)