Skip to main content

Loops Plugin API

LoopsPlugin API

This Plugin implements functions for handling loops in your scheme.

The LoopsPlugin use cases.

Actions​

Read about actions.

StartLoopFor​

Initializing and running a For loop.

Parameters:

Loop name : String *

The name of the loop to be created.

Default value: Loop

Loop state parameter name : String *

The name of the parameter to store the current state of the loop, LoopStates.

Default value: LoopState

Loop counter value parameter name : String *

The name of the parameter to store the current state of the counter, LoopCounter. *

Default value: LoopCounterValue

Counter type : CounterType *

Defines the counter type to be used in the loop.

Default value: Int

Start value *

The start value of the counter: if Int - any integer; if DateTime - read about DateTime Format.

Step *

The step of the counter: if Int - any integer; if DateTime - read about DateTime step format.

Step type : StepType

Defines the iterator type.

Default value: Increment

End value *

The end value of the counter: if Int - any integer; if DateTime - read about DateTime Format.

Include last value : Boolean *

The flag for the last value to be taken into account: true equivalent to <= or >= ; false equivalent to < or >

Default value: false

StartLoopForeach​

Initializing and running a Foreach loop.

Parameters:

Loop name : String *

The name of the loop to be created.

Default value: Loop

Loop state parameter name : String *

The name of the parameter to store the current state of the loop, LoopStates.

Default value: LoopState

Loop counter value parameter name : String *

The name of the parameter to store the current value of the counter, LoopCounter.

Default value: LoopCounterValue

Values *

The counter elements with a separator.

Example: Value1, Value2.

Separator : String *

The separator between the values.

Default value: comma

Reverse : Boolean *

The flag if the list of values should be reversed.

Default value: false

StartLoopForeachFromParameter​

Initializing and running a Foreach loop.

Parameters:

Loop name : String *

The name of the loop to be created.

Default value: Loop

Loop state parameter name : String *

The name of the parameter to store the current state of the loop, LoopStates.

Default value: LoopState

Loop counter value parameter name : String *

The name of the parameter to store the current value of the counter, LoopCounter.

Default value: LoopCounterValue

Parameter name : String *

The name of the parameter to get the list of elements with the separator.

Separator : String *

The separator between the values.

Default value: comma

Reverse : Boolean *

The flag if the list of values should be reversed.

Default value: false

SetLoopState​

Implements Continue/Break for a loop.

Parameters:

Loop name : String *

The name of the loop whose state should be changed.

Loop State : LoopStates *

The new state of the loop: Continue/Break.

Conditions​

Read about conditions.

LoopIsBroken​

Checks if the loop has been interrupted.

Parameters:

Loop name : String *

The name of the loop whose state is checked.

LoopIsCompleted​

Checks if the loop has been completed.

Parameters:

Loop name : String *

The name of the loop whose state is checked.

LoopIsCompletedOrBroken​

Checks if the actual loop state is Complete or Break. Therefore, the loop is completed or broken.

Parameters:

Loop name : String *

The name of the loop whose state is checked.

LoopIsNotCompletedAndBroken​

Checks if the actual loop state is Default or Continue. Allows you to determine whether another iteration will be performed.

Parameters:

Loop name : String *

The name of the loop whose state is checked.

LoopIsDefault​

Checks if the actual loop state is Default.

Parameters:

Loop name : String *

The name of the loop whose state is checked.

LoopIsNotDefault​

Checks if the actual loop state is Complete, Continue, or Break. Therefore, the loop has been completed, or continued, or broken.

Parameters:

Loop name : String *

The name of the loop whose state is checked.

Elements​

DateTimeFormat​

  • Format: yyyy-MM-dd HH:mm:ss.fff
  • Minimum value: 0001-01-01 00:00:00.000

For work with DateTime, you can use plugins, for example:

using OptimaJet.Workflow.Core.Plugins;

// For cast DateTime to string
string dateTimeString = DateTime.Now.ToLongStringDateTime();

// For cast string to DateTime
DateTime = dateTimeString.ToLongDateTime();

DateTimeStepFormat​

The following values can be set as a step:

  • integer followed by y, year or years, its value is interpreted as years.
  • integer followed by mm, month or months, its value is interpreted as months (the number of days determined by the calendar);
  • integer followed by d, day or days, its value is interpreted as days (24 hours);
  • integer followed by h, hour or hours, its value is interpreted as hours;
  • integer followed by m, minute or minutes, its value is interpreted as minutes;
  • integer followed by s, second or seconds, its value is interpreted as seconds;
  • integer followed by ms, millisecond or milliseconds, its value is interpreted as milliseconds;

The measurement units may be combined, for example, "1y 3mm 2d 5h 24m 15s 50 ms", "2days 5hours", etc.