Class WorkflowReferenceHelper


  • public final class WorkflowReferenceHelper
    extends Object
    Utilities for scanning workflow element model class instances via reflection.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • readDefaultEntityReferenceDescriptors

        @Deprecated
        public static <Model> List<IEntityReferenceDescriptor> readDefaultEntityReferenceDescriptors​(IReadEntityRefsParams<Model> params)
        Deprecated.
        Creates a list of entity reference descriptors from the given model, using the default strategy for getting references. Used as the default implementation of handler.readEntityReferences().
        Type Parameters:
        Model - Type of the deserialized property model of the workflow node or trigger.
        Parameters:
        params - Parameters with the deserialized model from which to read the entity references.
        Returns:
        A list of entity reference descriptors from the given model.
      • readDefaultObjectReferenceDescriptors

        public static <Model> List<IObjectReferenceDescriptor> readDefaultObjectReferenceDescriptors​(IElementHandler<Model,​?> handler,
                                                                                                     IReadObjectReferencesParams<Model> params)
        Creates a list of object reference descriptors from the given model, using the default strategy for getting references. Used as the default implementation of handler.readObjectReferences() .
        Type Parameters:
        Model - Type of the deserialized property model of the workflow node or trigger.
        Parameters:
        handler - The trigger or node handler instance.
        params - Parameters with the deserialized model from which to read the entity references.
        Returns:
        A list of entity reference descriptors from the given model.
      • readDefaultPlaceholders

        public static List<IPlaceholderProperty<?,​?>> readDefaultPlaceholders​(IReadPlaceholdersParams<?> params)
        Iterates over all fields via reflection and looks for placeholders in string fields.
        Parameters:
        params - Properties model to scan.
        Returns:
        All placeholders found in the properties model.
      • writeDefaultEntityReferenceDescriptors

        @Deprecated
        public static int writeDefaultEntityReferenceDescriptors​(IWriteEntityRefsParams<?> params)
        Deprecated.
        Updates all entity references in the given model with the given descriptors, using the default strategy for updating entity references. Each descriptor consists of a path pointing to the reference to update, and a new value for the reference. This is the default implementation of handler.writeEntityReferences().
        Parameters:
        params - Parameters with the deserialized properties model (of the workflow node or trigger) that should be updated.
        Returns:
        The number of references that have been updated
      • writeDefaultObjectReferenceDescriptors

        public static <Model> int writeDefaultObjectReferenceDescriptors​(IElementHandler<Model,​?> handler,
                                                                         IWriteObjectReferencesParams<Model> params)
        Updates all object references in the given model with the given descriptors, using the default strategy for updating object references. Each descriptor consists of a path pointing to the reference to update, and a new value for the reference. This is the default implementation of handler.writeobjectReferences().
        Type Parameters:
        Model - Type of the deserialized property model of the workflow node or trigger.
        Parameters:
        handler - The trigger or node handler instance.
        params - Parameters with the deserialized properties model (of the workflow node or trigger) that should be updated.
        Returns:
        The number of references that have been updated
      • writeDefaultPlaceholders

        public static void writeDefaultPlaceholders​(IWritePlaceholdersParams<?> params)
        Writes back the placeholders to string fields via reflection.
        Parameters:
        params - Properties model to scan.