Skip to main content

parallel

Short summary

Method to perform a given action on all objects inside the collection. All objects are invoked with the applier until all are done. If at any point the applier returns an error the foreach stops and returns an error. Action to perform needs to implement :ref:IApplier.

*Attention: This method is single cycle, what means the call waits for all appliers to finish. Therefore none of the appliers should wait for anything (Events/IO/...)

Example: You have a list of numbers: 1 2 3 and a ConcreteIncrementApplier that can take a number and increment it. Calling list.forEach(ConcreteIncrementApplier) will increment all numbers in the list, becoming: 2 3 4.

Return: SUCCESS: Alle appliers returned with SUCCESS ERROR: The applier returned error for at least one object, or any other error occured

Parameters

NameTypeCommentKind
applierIApplierthe applier (action) to be used on all obejcts in the collectioninput

Code

Declaration

METHOD parallel :CNM_ReturnTypes.SingleExecutionResult
VAR_INPUT
(*the applier (action) to be used on all obejcts in the collection*)
applier :IApplier;
END_VAR