Class StepDef
- java.lang.Object
-
- com.avoka.fc.core.service.job.config.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 Summary
Fields Modifier and Type Field Description static String
DEFAULT_ROUTE_NAME
The "Default" route name.static String
EXPIRY_ROUTE_NAME
The "Expiry" route name.static String
NEXT_STEP_PREVOUS_STEP
nextStep special field value: previous stepstatic String
TYPE_ENDPOINT
the step type endpoint attribute valuestatic String
TYPE_START
the step type start attribute valuestatic String[]
VALID_TYPES
Array Containing the valid step types
-
Method Summary
-
-
-
Field Detail
-
DEFAULT_ROUTE_NAME
public static final String DEFAULT_ROUTE_NAME
The "Default" route name.- See Also:
- Constant Field Values
-
EXPIRY_ROUTE_NAME
public static final String EXPIRY_ROUTE_NAME
The "Expiry" route name.- See Also:
- Constant Field Values
-
NEXT_STEP_PREVOUS_STEP
public static final String NEXT_STEP_PREVOUS_STEP
nextStep special field value: previous step- See Also:
- Constant Field Values
-
TYPE_START
public static final String TYPE_START
the step type start attribute value- See Also:
- Constant Field Values
-
TYPE_ENDPOINT
public static final String TYPE_ENDPOINT
the step type endpoint attribute value- 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
- 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
-
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
-
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.
-
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)
-
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
-
-