de.msponer.android.yac.model
Class MobileWorkItem

java.lang.Object
  extended by de.msponer.android.yac.model.MobileWorkItem
All Implemented Interfaces:
Serializable, Comparable<MobileWorkItem>

public class MobileWorkItem
extends Object
implements Comparable<MobileWorkItem>, Serializable

Model-Class for mobile work items. Corresponding YAWl class is org.yawlfoundation.yawl.engine.interfce.WorkItemRecord. Extension added to support special mobile functionalities (current position, distances, etc.)

Author:
msponer
See Also:
Serialized Form

Field Summary
static String STATUS_COMPLETE
          Constant for status complete.
static String STATUS_ENABLED
          Constant for status enabled.
static String STATUS_EXECUTING
          Constant for status executing.
static String STATUS_RESOURCE_ALLOCATED
          Constant for resource status allocated.
static String STATUS_RESOURCE_OFFERED
          Constant for resource status offered.
static String STATUS_RESOURCE_STARTED
          Constant for resource status started.
static String STATUS_RESOURCE_SUSPENDED
          Constant for resource status suspended.
static String STATUS_RESOURCE_UNOFFERED
          Constant for resource status unoffered.
static String STATUS_RESOURCE_UNRESOURCED
          Constant for resource status unresourced.
static String STATUS_SUSPENDED
          Constant for status suspended.
 
Constructor Summary
MobileWorkItem()
          Instantiates a new mobile work item.
MobileWorkItem(String caseID, String taskID, String specURI, String enablementTime, String status)
          Instantiates a new mobile work item.
MobileWorkItem(org.yawlfoundation.yawl.engine.interfce.WorkItemRecord wir)
          Instantiates a new mobile work item.
 
Method Summary
 void appendSyncAction(String actionString)
          Append sync action.
 int compareTo(MobileWorkItem another)
           
 org.jdom.Element getCaseData()
          Returns the case data.
 String getCaseDataString()
          Returns the case data string.
 String getCaseID()
          Returns the case id.
 org.jdom.Element getDataList()
          Returns the data list.
 String getDataListString()
          Returns the data list string.
 org.jdom.Element getDataSchema()
          Returns the data schema.
 String getDataSchemaString()
          Returns the data schema string.
 float getDistanceToPosition()
          Returns the distance to position.
 Date getEnablementDate()
          Returns the enablement date.
 String getEnablementTimeMs()
          Returns the enablement time ms.
 String getEnablementTimeString()
          Returns the enablement time string.
 String getID()
          Returns the iD.
 String getIDForDisplay()
          Returns the iD for display.
 String getLatitude()
          Returns the latitude.
 String getLongitude()
          Returns the longitude.
 int getPrimaryKey()
          Returns the primary key.
 String getResourceStatus()
          Returns the resource status.
 String getRootCaseID()
          Returns the root case id.
 String getSpecIdentifier()
          Returns the spec identifier.
 String getSpecURI()
          Returns the spec uri.
 String getSpecVersion()
          Returns the spec version.
 State getState()
          Returns the state.
 String getStatus()
          Returns the status.
 String getSyncQueue()
          Returns the sync queue.
 String getTaskID()
          Returns the task id.
 String getTaskName()
          Returns the task name.
 org.jdom.Element getUpdatedData()
          Returns the updated data.
 String getUpdatedDataString()
          Returns the updated data string.
 org.yawlfoundation.yawl.engine.interfce.WorkItemRecord getWIR()
          Returns the wIR.
 boolean hasLiveStatus()
          Checks for live status.
 boolean hasResourceStatus(String status)
          Checks for resource status.
 boolean hasStatus(String status)
          Checks for status.
 void removeSyncAction(String actionString)
          Removes the sync action.
 void restoreDataList()
          Restores the data list.
 void setCaseData(org.jdom.Element caseData)
          Sets the case data.
 void setCaseDataString(String caseDataString)
          Sets the case data string.
 void setCaseID(String caseID)
          Sets the case id.
 void setDataList(org.jdom.Element dataList)
          Sets the data list.
 void setDataListString(String dataStr)
          Sets the data list string.
 void setDataSchema(org.jdom.Element dataSchema)
          Sets the data schema.
 void setDataSchemaString(String dataSchemaString)
          Sets the data schema string.
 void setDistanceToPosition(float distanceToPosition)
          Sets the distance to position.
 void setEnablementDate(Date enablementDate)
          Sets the enablement date.
 void setEnablementTimeMs(String time)
          Sets the enablement time ms.
 void setEnablementTimeString(String time)
          Sets the enablement time string.
 void setLatitude(String latitude)
          Sets the latitude.
 void setLongitude(String longitude)
          Sets the longitude.
 void setPrimaryKey(int primaryKey)
          Sets the primary key.
 void setResourceStatus(String status)
          Sets the resource status.
 void setSpecIdentifier(String id)
          Sets the spec identifier.
 void setSpecURI(String uri)
          Sets the spec uri.
 void setSpecVersion(String version)
          Sets the spec version.
 void setState(State state)
          Sets the state.
 void setStatus(String status)
          Sets the status.
 void setSyncQueue(String syncQueue)
          Sets the sync queue.
 void setTaskID(String taskID)
          Sets the task id.
 void setTaskName(String name)
          Sets the task name.
 void setUpdatedData(org.jdom.Element dataListUpdated)
          Sets the updated data.
 void setUpdatedDataListString(String updatedDataStr)
          Sets the updated data list string.
 String toXML()
          To xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_ENABLED

public static final String STATUS_ENABLED
Constant for status enabled.

See Also:
Constant Field Values

STATUS_EXECUTING

public static final String STATUS_EXECUTING
Constant for status executing.

See Also:
Constant Field Values

STATUS_COMPLETE

public static final String STATUS_COMPLETE
Constant for status complete.

See Also:
Constant Field Values

STATUS_SUSPENDED

public static final String STATUS_SUSPENDED
Constant for status suspended.

See Also:
Constant Field Values

STATUS_RESOURCE_OFFERED

public static final String STATUS_RESOURCE_OFFERED
Constant for resource status offered.

See Also:
Constant Field Values

STATUS_RESOURCE_ALLOCATED

public static final String STATUS_RESOURCE_ALLOCATED
Constant for resource status allocated.

See Also:
Constant Field Values

STATUS_RESOURCE_STARTED

public static final String STATUS_RESOURCE_STARTED
Constant for resource status started.

See Also:
Constant Field Values

STATUS_RESOURCE_SUSPENDED

public static final String STATUS_RESOURCE_SUSPENDED
Constant for resource status suspended.

See Also:
Constant Field Values

STATUS_RESOURCE_UNOFFERED

public static final String STATUS_RESOURCE_UNOFFERED
Constant for resource status unoffered.

See Also:
Constant Field Values

STATUS_RESOURCE_UNRESOURCED

public static final String STATUS_RESOURCE_UNRESOURCED
Constant for resource status unresourced.

See Also:
Constant Field Values
Constructor Detail

MobileWorkItem

public MobileWorkItem()
Instantiates a new mobile work item.


MobileWorkItem

public MobileWorkItem(String caseID,
                      String taskID,
                      String specURI,
                      String enablementTime,
                      String status)
Instantiates a new mobile work item.

Parameters:
caseID - the case id
taskID - the task id
specURI - the spec uri
enablementTime - the enablement time
status - the status

MobileWorkItem

public MobileWorkItem(org.yawlfoundation.yawl.engine.interfce.WorkItemRecord wir)
Instantiates a new mobile work item.

Parameters:
wir - the work item record
Method Detail

restoreDataList

public void restoreDataList()
Restores the data list.


setSpecIdentifier

public void setSpecIdentifier(String id)
Sets the spec identifier.

Parameters:
id - the new spec identifier

setSpecVersion

public void setSpecVersion(String version)
Sets the spec version.

Parameters:
version - the new spec version

setSpecURI

public void setSpecURI(String uri)
Sets the spec uri.

Parameters:
uri - the new spec uri

setCaseID

public void setCaseID(String caseID)
Sets the case id.

Parameters:
caseID - the new case id

setTaskID

public void setTaskID(String taskID)
Sets the task id.

Parameters:
taskID - the new task id

setTaskName

public void setTaskName(String name)
Sets the task name.

Parameters:
name - the new task name

setEnablementTimeString

public void setEnablementTimeString(String time)
Sets the enablement time string.

Parameters:
time - the new enablement time string

setEnablementTimeMs

public void setEnablementTimeMs(String time)
Sets the enablement time ms.

Parameters:
time - the new enablement time ms

setStatus

public void setStatus(String status)
Sets the status.

Parameters:
status - the new status

setResourceStatus

public void setResourceStatus(String status)
Sets the resource status.

Parameters:
status - the new resource status

setDataList

public void setDataList(org.jdom.Element dataList)
Sets the data list.

Parameters:
dataList - the new data list

setDataListString

public void setDataListString(String dataStr)
Sets the data list string.

Parameters:
dataStr - the new data list string

setUpdatedData

public void setUpdatedData(org.jdom.Element dataListUpdated)
Sets the updated data.

Parameters:
dataListUpdated - the new updated data

setUpdatedDataListString

public void setUpdatedDataListString(String updatedDataStr)
Sets the updated data list string.

Parameters:
updatedDataStr - the new updated data list string

setDataSchema

public void setDataSchema(org.jdom.Element dataSchema)
Sets the data schema.

Parameters:
dataSchema - the new data schema

setDataSchemaString

public void setDataSchemaString(String dataSchemaString)
Sets the data schema string.

Parameters:
dataSchemaString - the new data schema string

getSpecIdentifier

public String getSpecIdentifier()
Returns the spec identifier.

Returns:
the spec identifier

getSpecVersion

public String getSpecVersion()
Returns the spec version.

Returns:
the spec version

getSpecURI

public String getSpecURI()
Returns the spec uri.

Returns:
the spec uri

getCaseID

public String getCaseID()
Returns the case id.

Returns:
the case id

getTaskID

public String getTaskID()
Returns the task id.

Returns:
the task id

getID

public String getID()
Returns the iD.

Returns:
the iD

getEnablementTimeString

public String getEnablementTimeString()
Returns the enablement time string.

Returns:
the enablement time string

getEnablementTimeMs

public String getEnablementTimeMs()
Returns the enablement time ms.

Returns:
the enablement time ms

getStatus

public String getStatus()
Returns the status.

Returns:
the status

getResourceStatus

public String getResourceStatus()
Returns the resource status.

Returns:
the resource status

getDataList

public org.jdom.Element getDataList()
Returns the data list.

Returns:
the data list

getDataListString

public String getDataListString()
Returns the data list string.

Returns:
the data list string

getUpdatedData

public org.jdom.Element getUpdatedData()
Returns the updated data.

Returns:
the updated data

getUpdatedDataString

public String getUpdatedDataString()
Returns the updated data string.

Returns:
the updated data string

getIDForDisplay

public String getIDForDisplay()
Returns the iD for display.

Returns:
the iD for display

getTaskName

public String getTaskName()
Returns the task name.

Returns:
the task name

getRootCaseID

public String getRootCaseID()
Returns the root case id.

Returns:
the root case id

hasLiveStatus

public boolean hasLiveStatus()
Checks for live status.

Returns:
true, if successful

hasStatus

public boolean hasStatus(String status)
Checks for status.

Parameters:
status - the status
Returns:
true, if successful

hasResourceStatus

public boolean hasResourceStatus(String status)
Checks for resource status.

Parameters:
status - the status
Returns:
true, if successful

getDataSchema

public org.jdom.Element getDataSchema()
Returns the data schema.

Returns:
the data schema

getDataSchemaString

public String getDataSchemaString()
Returns the data schema string.

Returns:
the data schema string

toXML

public String toXML()
To xml.

Returns:
the string

getPrimaryKey

public int getPrimaryKey()
Returns the primary key.

Returns:
the primary key

setPrimaryKey

public void setPrimaryKey(int primaryKey)
Sets the primary key.

Parameters:
primaryKey - the new primary key

setState

public void setState(State state)
Sets the state.

Parameters:
state - the new state

getState

public State getState()
Returns the state.

Returns:
the state

setSyncQueue

public void setSyncQueue(String syncQueue)
Sets the sync queue.

Parameters:
syncQueue - the new sync queue

getSyncQueue

public String getSyncQueue()
Returns the sync queue.

Returns:
the sync queue

appendSyncAction

public void appendSyncAction(String actionString)
Append sync action.

Parameters:
actionString - the action string

removeSyncAction

public void removeSyncAction(String actionString)
Removes the sync action.

Parameters:
actionString - the action string

getWIR

public org.yawlfoundation.yawl.engine.interfce.WorkItemRecord getWIR()
Returns the wIR.

Returns:
the wIR

compareTo

public int compareTo(MobileWorkItem another)
Specified by:
compareTo in interface Comparable<MobileWorkItem>

setEnablementDate

public void setEnablementDate(Date enablementDate)
Sets the enablement date.

Parameters:
enablementDate - the new enablement date

getEnablementDate

public Date getEnablementDate()
Returns the enablement date.

Returns:
the enablement date

setLongitude

public void setLongitude(String longitude)
Sets the longitude.

Parameters:
longitude - the new longitude

getLongitude

public String getLongitude()
Returns the longitude.

Returns:
the longitude

setLatitude

public void setLatitude(String latitude)
Sets the latitude.

Parameters:
latitude - the new latitude

getLatitude

public String getLatitude()
Returns the latitude.

Returns:
the latitude

setDistanceToPosition

public void setDistanceToPosition(float distanceToPosition)
Sets the distance to position.

Parameters:
distanceToPosition - the new distance to position

getDistanceToPosition

public float getDistanceToPosition()
Returns the distance to position.

Returns:
the distance to position

setCaseData

public void setCaseData(org.jdom.Element caseData)
Sets the case data.

Parameters:
caseData - the new case data

getCaseData

public org.jdom.Element getCaseData()
Returns the case data.

Returns:
the case data

setCaseDataString

public void setCaseDataString(String caseDataString)
Sets the case data string.

Parameters:
caseDataString - the new case data string

getCaseDataString

public String getCaseDataString()
Returns the case data string.

Returns:
the case data string