Class JobDef

  • All Implemented Interfaces:
    IDefJsonSerializer

    public class JobDef
    extends Object
    implements IDefJsonSerializer
    Provides an immutable Job definition configuration class. The Job configuration contains an object graph of StepConfig objects.

    Job JSON Configuration

     {
        "jobDetails" : {
           "name" : "Review and Approval Job"
        }
        "jobGroups" : [
          {
            "name" : "HL Melbourne",
            "description" : "Home Loan Customer Care Group for Vic"
          },
          {
            "name" : "HL Sydney",
            "description" : "Home Loan Customer Care Group for NSW"
          }
        ]
        "steps" : [
           { ... },
           { ... },
           { ... }
        ]
     }
     
    Since:
    4.0.0
    • Constructor Detail

      • JobDef

        public JobDef​(String jobJson)
        Creates the Job configuration object from the given JSON map. A validation exception is returned if the Job configuration JSON (String):
        • does not contain a jobDetails or a jobDetails.name
        • does not contain a steps or the steps Array is empty.
        • a step does not have a valid name.
        • validation in the StepDefinition fails (StepDefinition.java)
        Parameters:
        jobJson - this job definition JSON source (required)
    • Method Detail

      • getName

        public String getName()
        Return the name of this job configuration.
        Returns:
        the job name
      • setName

        public void setName​(String value)
        Set the name of this job configuration.
        Parameters:
        value - the job name
      • getDisplayName

        public String getDisplayName()
        Returns:
        the job details user display name.
      • getDescription

        public String getDescription()
        Returns:
        the job details user description.
      • getReferenceNumberLabel

        public String getReferenceNumberLabel()
        Returns:
        the job details reference number display label.
      • isProcessSubmitImmediate

        public boolean isProcessSubmitImmediate()
        Return true if user form submit operations should be processed immediately in the user thread.
        Returns:
        true if user form submit operations should be processed immediately in the user thread
      • setVersion

        public void setVersion​(String version)
        Set the version of this job configuration.
        Parameters:
        version - the job name
      • getJobDetailsPropertyValue

        public String getJobDetailsPropertyValue​(String name)
        Return the job details property value.
        Parameters:
        name - the job detail property name
        Returns:
        the Job details property value
      • getStepDef

        public StepDef getStepDef​(String stepName)
        Return the step definition for the given step name.
        Parameters:
        stepName - the step name
        Returns:
        the step definition for the given step name.
      • getStepDefMap

        public Map<String,​StepDef> getStepDefMap()
        Returns:
        the map of step definitions keyed on step name.
      • getStepDefList

        public List<StepDef> getStepDefList()
        Return the step definition list.
        Returns:
        the step definition list
      • getStartStepDef

        public StepDef getStartStepDef()
        Return the start step definition.
        Returns:
        the start step definition.
      • getNextStepName

        public String getNextStepName​(String currentStepName,
                                      String routeName)
        Return the next route step name for the given step and and route name.
        Parameters:
        currentStepName - the current step name
        routeName - the route name
        Returns:
        the name of the next step
        Throws:
        IllegalArgumentException - if the current step was not found
      • getDefaultNextStepName

        public String getDefaultNextStepName​(String currentStepName)
        Return the default next route next step for the given step name.
        Parameters:
        currentStepName - the current steps name (required)
        Returns:
        the default next route next step for the given step name
        Throws:
        IllegalArgumentException - if the current step was not found
      • getPreviousStepName

        public String getPreviousStepName​(String currentStepName)
        Return the name of the previous step form the current step name.
        Parameters:
        currentStepName - the current step name (required)
        Returns:
        the name of the previous step form the current step name
        Throws:
        IllegalArgumentException - if the current step was not found or is a start step
      • 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
      • toString

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

        public String toJSONString()
        Returns:
        the JSON formatted string representation of this object.
      • getJobGroups

        public List<Map> getJobGroups()
        Get the Job Groups as a List<Map>. The Map has the keys name, description
        Returns:
        the job groups as a List<Map>
        Since:
        17.10.0