Interface VariableParallelismEBP

  • All Superinterfaces:
    ExecutableBusinessProcess, LocalisedString, PluginDataContainer, UserAttributeContainer

    public interface VariableParallelismEBP
    extends ExecutableBusinessProcess
    Variable parallelism resembles a foreach which iterates through all elements of a list but parallel instead of one after the other. This is modelled by a parallel split which only has one branch at modelling time. The branch is instantiated multiple times at runtime depending on the amount of elements in the list.
    To simplify the management of variable parallelism, the duplicated branch is represented as a subprocess step (LightWeightProcess) that has at least one input parameter of a simple type which is connected to an input parameter of the corresponding list type. At runtime the subprocess is instantiated several times, once for each of the list elements. The mapping from a list input to the corresponding simple type is provided by this VariableParallelismEBP which wraps the template for the subprocess.
    Input parameters may be either indexed (that is, a list is split and distributed to the created subprocesses) or normal. A normal input parameter of type list is provided as a whole to all subprocesses. Output parameters are always indexed, that is, each output parameter of one subprocess is gathered in a list (besides the corresponding output parameters of the other subprocesses). Therefore for every output parameter there is an output parameter of type list in the corresponding (variable parallelism) EBP.

    Technically speaking, this interface provides the subprocess template (as LightWeightProcess) as well as the interface for the variable parallelism as seen by the parent process. That is, all normal output parameters (ActivityConstants.AccessType.WRITE) are of list type, the input parameters (ActivityConstants.AccessType.READ) may be of arbitrary type, but all indexed parameters are also of list type. These indexed input parameters determine the amount of instantiated subprocesses - therefore at least one indexed parameter has to be provided. The encapsulated lightweight process has a different interface: indexed input parameters are of the inner type of the list, output parameters are the inner types of the lists this wrapper has as output parameters.

    To allow for easily mapping of the parameters of the wrapped lightweight process and this wrapping EBP, the names have to be the same, that is, normal input parameters have the same name as well as indexed input parameters and output parameters. Note that although having the same name, they are of different type (list of the corresponding inner type for this EBP).

    Author:
    Ulrich Kreher
    • Method Detail

      • getIndexedInputParameters

        Set<ProcessModelParameter> getIndexedInputParameters()
        Gets the input parameters of access type ActivityConstants.AccessType.READ that are split and distributed for the created subprocess instances. All of these parameters are of list type. They (the very same objects) are also in the set of normal input parameters provided by ExecutableBusinessProcess.getParameters(de.aristaflow.adept2.model.globals.ActivityConstants.AccessType). At runtime the values of these parameters determine the amount of created subprocess instances as follows:
        • the length of the shortest mandatory input list
        • if all list inputs are optional, the length of the longest optional input list
        Therefore there has to be at least one indexed parameter. Otherwise no subprocesses can be created.
        Returns:
        The set of the input of the EBP in the top-level process that are distributed to the created subprocess instances.
      • getLightWeightProcess

        LightWeightProcess getLightWeightProcess()
        Gets the lightweight process which is instantiated several times in the variable parallel branch. This can be either a referenced or an embedded subprocess. The returned process object has a different interface than this EBP for all indexed input parameters as well as for all output parameters.
        Returns:
        The lightweight process wrapped by this VariableParallelismEBP that is instantiated several times at runtime.