Task and TaskReqmt Models

There are 2 models that make up the Task framework: Task and TaskReqmt.

Table 15.1. Task Fields

Field

Required

Description

ID

Required

Unique ID is the sole Natural Key for this Task.

OwningOrg

Required

A model link to an Owning Organization for the Task.

TaskType

Required

Fully-qualified Java class name extending the base class com.onenetwork.platform.common.task.AbstractTaskType, which has callbacks like onStart and onComplete that are called when the task changes state.

State

Required

Holds the state for the Task and is governed by its state machine. Currently, the state machine contains 3 states: Pending, InProgress, and Completed.

ParentTask

Optional

A model link to a parent Task.

Sequence

Required for Tasks with a non-null ParentTask

This should be a unique integer among the direct child Tasks for a parent Task; it dictates the order they appear in the UI.

RequiredForParentCompletion

Optional

If set to true, then this Task must enter the Completed state before its parent Task.

AutocompleteOnChildrenComplete

Optional

If set to true, then this Task will automatically enter the Completed state when the last required child Task is Completed.

ParamsJSON

Optional

This is a CLOB of JSON for holding TaskType-dependent parameters needed at runtime. This will be discussed in more detail later.


Table 15.2. TaskReqmt Fields

Field

Required

Description

RequiringTask

Required

A model link to a Task that has a dependency on another Task.

RequiredTask

Required

A model link to a Task that is needed by the RequiringTask.

RequirementType

Required

There is currently only 1 type: BeforeStart, which dictates that the RequiringTask cannot move from the Pending state to InProgress until RequiredTask has been marked Completed.