Class JobDef
- java.lang.Object
-
- com.avoka.fc.core.service.job.config.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
-
-
Field Summary
Fields Modifier and Type Field Description static String
DESCRIPTION
The JSON job details description attribute.static String
NAME
The JSON job details name attribute.static String
PRE_CONDITION_SUBMISSION_STEP
The pre-condition submission step name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDefaultNextStepName(String currentStepName)
Return the default next route next step for the given step name.String
getDescription()
String
getDisplayName()
String
getJobDetailsPropertyValue(String name)
Return the job details property value.List<Map>
getJobGroups()
Get the Job Groups as a List<Map>.String
getName()
Return the name of this job configuration.String
getNextStepName(String currentStepName, String routeName)
Return the next route step name for the given step and and route name.String
getPreviousStepName(String currentStepName)
Return the name of the previous step form the current step name.Map<String,String>
getPropertyMap()
String
getPropertyValue(String propertyName)
String
getReferenceNumberLabel()
StepDef
getStartStepDef()
Return the start step definition.StepDef
getStepDef(String stepName)
Return the step definition for the given step name.List<StepDef>
getStepDefList()
Return the step definition list.Map<String,StepDef>
getStepDefMap()
boolean
isProcessSubmitImmediate()
Return true if user form submit operations should be processed immediately in the user thread.void
setName(String value)
Set the name of this job configuration.void
setVersion(String version)
Set the version of this job configuration.String
toJSONString()
String
toString()
Return the string representation of this object.void
writeJson(StringBuilder builder)
Appends the JSON text representation of this object to the string builder.
-
-
-
Field Detail
-
PRE_CONDITION_SUBMISSION_STEP
public static final String PRE_CONDITION_SUBMISSION_STEP
The pre-condition submission step name.- See Also:
- Constant Field Values
-
NAME
public static final String NAME
The JSON job details name attribute.- See Also:
- Constant Field Values
-
DESCRIPTION
public static final String DESCRIPTION
The JSON job details description attribute.- See Also:
- Constant Field Values
-
-
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 namerouteName
- 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
-
toString
public String toString()
Return the string representation of this object.
-
toJSONString
public String toJSONString()
- Returns:
- the JSON formatted string representation of this object.
-
writeJson
public void writeJson(StringBuilder builder)
Description copied from interface:IDefJsonSerializer
Appends the JSON text representation of this object to the string builder.- Specified by:
writeJson
in interfaceIDefJsonSerializer
- Parameters:
builder
- JSON string builder to write to- See Also:
IDefJsonSerializer.writeJson(StringBuilder)
-
-