Class WorkItem
java.lang.Object
org.tasktide.core.model.workitem.WorkItem
- All Implemented Interfaces:
TaskTideModel<WorkItem>
TaskTideModel class for Work Items
-
Constructor Summary
ConstructorsConstructorDescriptionWorkItem()Null constructorWorkItem(String id, String itemName, ItemType itemType, ItemState itemState, String lockId, long lockDate, long doneDate, int taskCount, int taskDone, Workload workload, String stepName) Construct with fieldsWorkItem(String id, String itemName, ItemType itemType, ItemState itemState, String lockId, long lockDate, long doneDate, int taskCount, int taskDone, Workload workload, String stepName, String stepId, String jobEnvId, CustomAnnotation anno) Constructor for JSON Deserialization -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd taskvoidadjustTaskState(ItemTask task) Used by engine to adjust a task without changing work item statebooleanDrop taskGet annotationsGet steplongGet done dategetId()Get work item IdGet item nameGet item stateGet item typeGet job environment IdlongGet lock dateGet lock IdgetState()Return current of modelGet the parentStepIdGet step nameintGet total task countintGet task done countgetValueFromField(String field) Return value of field.Get workloadintGet workload sizevoidReset modelvoidUnlockItemTaskassociated with provided IdvoidSet annotation providedvoidsetDoneDate(long doneDate) Set done datevoidSet work item idvoidsetItemName(String itemName) Set item namevoidsetItemState(ItemState itemState) Set item statevoidsetItemType(ItemType itemType) Set item typevoidsetJobEnvId(String jobEnvId) Sets job environment IdvoidsetLockDate(long lockDate) Set lock datevoidSet lock IdvoidSet the parentStepIdvoidsetStepName(String stepName) Set step namevoidSet task count from workload sizevoidsetTaskCount(int taskCount) Set total task countvoidSet task count fieldsvoidSet task done count from summaryvoidsetTaskDone(int taskDone) Set task done countvoidsetWorkload(Workload workload) Set workloadtoJson()Represent as JSON docSerialize to a human readable formatted JSON stringSerialize to JSON stringtoString()Represent as string
-
Constructor Details
-
WorkItem
public WorkItem()Null constructor -
WorkItem
public WorkItem(String id, String itemName, ItemType itemType, ItemState itemState, String lockId, long lockDate, long doneDate, int taskCount, int taskDone, Workload workload, String stepName) Construct with fields- Parameters:
id-itemName-itemType-itemState-lockId-lockDate-doneDate-taskCount-taskDone-workload-stepName-
-
WorkItem
public WorkItem(String id, String itemName, ItemType itemType, ItemState itemState, String lockId, long lockDate, long doneDate, int taskCount, int taskDone, Workload workload, String stepName, String stepId, String jobEnvId, CustomAnnotation anno) Constructor for JSON Deserialization- Parameters:
id-itemName-itemType-itemState-lockId-lockDate-doneDate-taskCount-taskDone-workload-stepName-stepId-jobEnvId-anno-
-
-
Method Details
-
resetModel
-
resetTask
-
adjustTaskState
Used by engine to adjust a task without changing work item state- Parameters:
task-
-
addTask
-
dropTask
-
getWorkloadSize
public int getWorkloadSize()Get workload size- Returns:
- int
-
summarizeByState
-
fetchByStates
-
setTaskCounts
public void setTaskCounts()Set task count fields -
getId
Get work item Id- Specified by:
getIdin interfaceTaskTideModel<WorkItem>- Returns:
- String
-
setId
-
getJobEnvId
-
setJobEnvId
-
getItemName
-
setItemName
-
getAnnotations
Get annotations- Specified by:
getAnnotationsin interfaceTaskTideModel<WorkItem>- Returns:
CustomAnnotation
-
setAnnotations
Set annotation provided- Specified by:
setAnnotationsin interfaceTaskTideModel<WorkItem>- Parameters:
anno-
-
getItemType
-
setItemType
-
getItemState
-
setItemState
-
getLockId
-
setLockId
-
getLockDate
public long getLockDate()Get lock date- Returns:
- long
-
setLockDate
public void setLockDate(long lockDate) Set lock date- Parameters:
lockDate-
-
getDoneDate
public long getDoneDate()Get done date- Returns:
- long
-
setDoneDate
public void setDoneDate(long doneDate) Set done date- Parameters:
doneDate-
-
getTaskCount
public int getTaskCount()Get total task count- Returns:
- int
-
setTaskCount
public void setTaskCount(int taskCount) Set total task count- Parameters:
taskCount-
-
setTaskCount
public void setTaskCount()Set task count from workload size -
getTaskDone
public int getTaskDone()Get task done count- Returns:
- int
-
setTaskDone
public void setTaskDone(int taskDone) Set task done count- Parameters:
taskDone-
-
setTaskDone
public void setTaskDone()Set task done count from summary -
getWorkload
-
setWorkload
-
getStepName
-
setStepName
-
setStepId
-
getStepId
-
toJsonString
-
toJsonDoc
Serialize to a human readable formatted JSON string- Specified by:
toJsonDocin interfaceTaskTideModel<WorkItem>- Returns:
- String
-
getCollection
Get step- Specified by:
getCollectionin interfaceTaskTideModel<WorkItem>- Returns:
-
toString
-
getState
Description copied from interface:TaskTideModelReturn current of model- Specified by:
getStatein interfaceTaskTideModel<WorkItem>- Returns:
- String
-
toJson
Represent as JSON doc- Specified by:
toJsonin interfaceTaskTideModel<WorkItem>- Returns:
- String
-
getValueFromField
Return value of field. Must match toString() names- Specified by:
getValueFromFieldin interfaceTaskTideModel<WorkItem>- Parameters:
field-- Returns:
- Object
-