Package org.cristalise.kernel.entity
Class Job
java.lang.Object
org.cristalise.kernel.entity.Job
- All Implemented Interfaces:
C2KLocalObject
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJob()Empty constructor required for CastorMain constructor to create Job during workflow enactmentJob(ItemPath itemPath, String stepName, String stepPath, String stepType, String transition, String roleOverride, CastorHashMap actProps) Constructor for recreating Job from backend -
Method Summary
Modifier and TypeMethodDescriptionbooleangetActProp(String name) getActProp(String name, Object defaultValue) getActProp(BuiltInVertexProperties name, Object defaultValue) getActPropString(String name) Used by castor to marshall to XMLEach C2KLocalObject is stored with a path identifier starting with the ClusterType: DomainPath: /Path/Domain/Name ItemPath: /Path/Item AgentPath: /Path/Agent RolePath: /Path/Role/Name Properties: /Property/Name Workflow: /LifeCycle/workflow Collections: /Collection/Name/Version (default Name='last') Outcomes: /Outcome/SchemaName/SchemaVersion/EventID Viewpoints: /ViewPoint/SchemaName/Name (default Name='last') Events: /AuditTrail/EventID Jobs: /Job/JobIDEach object belongs to a specific type defined inClusterTypeReturns the Outcome instance associated with the 'last' ViewpointReturns the Outcome string associated with the 'last' ViewpointgetName()Gets the name of the C2KLocalObjectReturns the Outcome if exists otherwise tries to read and duplicate the Outcome of 'last' ViewPoint.Retrieve the OutcomeInitiator associated with this Job.Returns the Outcome string.getQuery()intintChecks the value of the 'Viewpoint' ActivityProperty and return 'last' if value is blank or starts with 'xpath:'.inthashCode()booleanbooleanhasQuery()booleanbooleanbooleanmatchActPropNames(String pattern) Searches Activity property names usingString.startsWith(String)methodvoidvoidsetActProp(String name, Object value) voidsetActProp(BuiltInVertexProperties prop, Object value) voidsetAgentUUID(String uuid) Used by castor to unmarshall from XMLvoidvoidsetItemPath(ItemPath path) voidsetItemUUID(String uuid) voidsetKeyValuePairs(KeyValuePair[] pairs) voidSets the name of the C2KLocalObjectvoidsetOutcome(String outcomeData) voidtoString()
-
Field Details
-
ebAddress
- See Also:
-
-
Constructor Details
-
Job
public Job()Empty constructor required for Castor -
Job
public Job(Activity act, ItemPath itemPath, String transition, AgentPath agent, String roleOverride) throws InvalidDataException, ObjectNotFoundException Main constructor to create Job during workflow enactment -
Job
public Job(ItemPath itemPath, String stepName, String stepPath, String stepType, String transition, String roleOverride, CastorHashMap actProps) Constructor for recreating Job from backend
-
-
Method Details
-
setItemPath
-
setItemUUID
- Throws:
InvalidItemPathException
-
getItemUUID
-
getStateMachine
-
getTransition
-
setAgentUUID
Used by castor to unmarshall from XML- Parameters:
uuid- the string representation of UUID
-
getAgentUUID
Used by castor to marshall to XML- Returns:
- The stringified UUID of Agent
-
getAgentName
-
getSchema
-
getSchemaName
-
getSchemaVersion
-
isOutcomeRequired
public boolean isOutcomeRequired() -
getScript
-
getQuery
-
getScriptName
-
getScriptVersion
- Throws:
InvalidDataException
-
getKeyValuePairs
-
setKeyValuePairs
-
getName
Description copied from interface:C2KLocalObjectGets the name of the C2KLocalObject- Specified by:
getNamein interfaceC2KLocalObject- Returns:
- name of the C2KLocalObject
-
setName
Description copied from interface:C2KLocalObjectSets the name of the C2KLocalObject- Specified by:
setNamein interfaceC2KLocalObject- Parameters:
name- Name of the C2KLocalObject
-
getItemProxy
-
getDescription
-
setOutcome
-
setOutcome
-
setError
-
getValidViewpointName
Checks the value of the 'Viewpoint' ActivityProperty and return 'last' if value is blank or starts with 'xpath:'. In all other cases it returns its value.- Returns:
- the 'calculated' Viewpoint name
-
getLastOutcome
Returns the Outcome instance associated with the 'last' Viewpoint- Returns:
- Outcome instance
- Throws:
InvalidDataException- inconsistent data or persistency issueObjectNotFoundException- Schema or Outcome was not found
-
getLastView
Returns the Outcome string associated with the 'last' Viewpoint- Returns:
- XML data of the last version of Outcome
- Throws:
InvalidDataException- inconsistent data or persistency issueObjectNotFoundException- Schema or Outcome was not found
-
getOutcomeInitiator
Retrieve the OutcomeInitiator associated with this Job.- Returns:
- the configured OutcomeInitiator
- Throws:
InvalidDataException- OutcomeInitiator could not be created- See Also:
-
getOutcomeString
Returns the Outcome string. It is based ongetOutcome()- Returns:
- the Outcome xml or null
- Throws:
InvalidDataException- inconsistent dataObjectNotFoundException
-
getOutcome
Returns the Outcome if exists otherwise tries to read and duplicate the Outcome of 'last' ViewPoint. If that does not exists it tries to use an OutcomeInitiator.- Returns:
- the Outcome object or null
- Throws:
InvalidDataException- inconsistent dataObjectNotFoundException- Schema was not found
-
hasOutcome
public boolean hasOutcome() -
hasScript
public boolean hasScript() -
hasQuery
public boolean hasQuery() -
isOutcomeSet
public boolean isOutcomeSet() -
getClusterType
Description copied from interface:C2KLocalObjectEach object belongs to a specific type defined inClusterType- Specified by:
getClusterTypein interfaceC2KLocalObject- Returns:
- string id of the type
-
getClusterPath
Description copied from interface:C2KLocalObjectEach C2KLocalObject is stored with a path identifier starting with the ClusterType:- DomainPath: /Path/Domain/Name
- ItemPath: /Path/Item
- AgentPath: /Path/Agent
- RolePath: /Path/Role/Name
- Properties: /Property/Name
- Workflow: /LifeCycle/workflow
- Collections: /Collection/Name/Version (default Name='last')
- Outcomes: /Outcome/SchemaName/SchemaVersion/EventID
- Viewpoints: /ViewPoint/SchemaName/Name (default Name='last')
- Events: /AuditTrail/EventID
- Jobs: /Job/JobID
- Specified by:
getClusterPathin interfaceC2KLocalObject- Returns:
- The path identifier (i.e. primary key) of the object
-
hashCode
public int hashCode() -
equals
-
getActProp
-
getActProp
-
getActProp
-
getActProp
-
getActPropString
-
setActProp
-
setActProp
-
getActPropString
-
matchActPropNames
Searches Activity property names usingString.startsWith(String)method- Parameters:
pattern- the pattern to be matched- Returns:
- Map of property name and value
-
sendToRoleChannel
public void sendToRoleChannel() -
toString
-