Class StepDef

  • All Implemented Interfaces:
    IDefJsonSerializer

    public class StepDef
    extends Object
    implements IDefJsonSerializer
    Provides an immutable StepConfig configuration class.

    Step JSON Configuration

     {
        "name" : "Initial Review",
        "type" : "",
        "dynamicPreConditions": true,
        "shareFormData" : true,
        "shareExtractData": false,
        "allFormsEditable" : true,
        "showPreviousForms" : true,
        "redirectNext": true,
        "expiryRule" : "+5d",
        "expiryServiceName" : "Review Expiry Service",
        "expiryServiceVersion" : "12",
        "actions": [
           { "name" : "Assign Review",  "type" : "Job Task Assign" },
           { "name" : "Review Wait",  "type" : "Job Task Wait" }
        ],
        "routes": [
           { "name" : "Default",  "nextStep" : "Management Review" },
           { "name" : "Expiry",  "nextStep" : "Review Expiry" }
        ],
        "properties": [
            { "name": "Task Review Submission Step",  "value": "Start" },
            { "name": "Task Group",  "value": "Application Reviewers" }
        ]
     }
     
    Since:
    4.0.0
    • Field Detail

      • NEXT_STEP_PREVOUS_STEP

        public static final String NEXT_STEP_PREVOUS_STEP
        nextStep special field value: previous step
        See Also:
        Constant Field Values
      • VALID_TYPES

        public static final String[] VALID_TYPES
        Array Containing the valid step types
    • Constructor Detail

      • StepDef

        public StepDef​(Map<String,​Object> stepMap,
                       List<String> allStepNames,
                       String jobJson)
        Create a StepConfig using the given JSON Job Step configuration map. A validation exception is returned if the step for the Job definition JSON (String):
        • step does not contain a name
        • has an invalid step type
        If the type is not an endpoint then the JSON:
        • must have an actions attribute that is an array and it must contain at least 1 action
        • validation in the ActionDefinition fails (ActionDefinition.java)
        • must have a routes attribute that is an Array, and it must contain at least 1 route
        • each route must have an name and nextStep attributes which are not empty
        • the nextStep in the route must be either ##PREVIOUS_STEP() (excluding step of type start), or a valid step name contained in the job.
        • must have an customProperties attribute that is an Array. Note this can be an empty array
        • custom properties must have a name, the value (String) is optional and can be empty
        Parameters:
        stepMap - the step configuration map JSON (required)
        allStepNames - the list of job configuration step names used to validate this step configuration (required)
        jobJson - this job definition JSON source (required)
    • Method Detail

      • getName

        public String getName()
        Returns:
        the step name
      • getType

        public String getType()
        Returns:
        the step type
      • getExpiryRule

        public String getExpiryRule()
        Returns:
        the expiry rule
      • getExpiryServiceName

        public String getExpiryServiceName()
        Returns:
        the expiry service name
      • getExpiryServiceVersion

        public String getExpiryServiceVersion()
        Returns:
        the expiry service version number
        Since:
        5.1.0
      • getPreCondition

        public String getPreCondition()
        Returns:
        the action creation pre-condition
      • getActionDefList

        public List<ActionDef> getActionDefList()
        Returns:
        a list of Actions Definition
      • getNextStep

        public String getNextStep​(String routeName)
        Parameters:
        routeName - the name of the route
        Returns:
        the stepName (String) for the Next Step
      • getRouteNextStepMap

        public Map<String,​String> getRouteNextStepMap()
        Return the route result to step name map.
        Returns:
        the route result to step name map.
      • getDisplayRoutes

        public List<String> getDisplayRoutes()
        Return the List of the available route names to display on the form
        Returns:
        the List of the available route names to display on the form
      • getDefaultRouteStep

        public String getDefaultRouteStep()
        Returns:
        the default route step name.
      • getExpiryRouteStep

        public String getExpiryRouteStep()
        Returns:
        the expiry route step name.
      • getPropertyValue

        public String getPropertyValue​(String propertyName)
        Parameters:
        propertyName - the name of the property
        Returns:
        the value(String) for the corresponding property name
      • getPropertyMap

        public Map<String,​String> getPropertyMap()
        Returns:
        a map of step property values
      • isDynamicPreConditions

        public boolean isDynamicPreConditions()
        Returns:
        true if the step configured to use dynamic preCondition evaluation for step actions
        Since:
        4.3.0
      • isShareExtractData

        public boolean isShareExtractData()
        Returns:
        true if the step submissions should share extract data
        Since:
        4.3.0
      • isShareFormData

        public boolean isShareFormData()
        Returns:
        true if the step submissions should share form data
        Since:
        4.1.8
      • isAllFormsEditable

        public boolean isAllFormsEditable()
        Returns:
        true if the step submissions should share form data
        Since:
        4.2.0
      • isShowPreviousForms

        public boolean isShowPreviousForms()
        Returns:
        true if the step forms show all the previous step forms
        Since:
        4.3.0
      • isRedirectNext

        public boolean isRedirectNext()
        Returns:
        true if the step should redirect the user to the next form
        Since:
        4.3.0
      • isTypeEndpoint

        public boolean isTypeEndpoint()
        Returns:
        true if an "endpoint" type step.
      • isTypeStart

        public boolean isTypeStart()
        Returns:
        true if an "start" type step.
      • toString

        public String toString()
        Return the string representation of this object.
        Overrides:
        toString in class Object
        Returns:
        the string representation of this object
      • hasPreviousStep

        protected Boolean hasPreviousStep()
        Return true if contains the previous step function. This method used by JobDef to create the Diagram Links.
        Returns:
        true if contains previous step function