public class ProcessActivity extends Object implements Comparable<ProcessActivity>
Modifier and Type | Field and Description |
---|---|
static byte |
ENABLED
Indicates event has been enabled
|
static byte |
FINISHED
Indicates event has been completed
|
static byte |
STARTED
Indicates event has been started
|
static byte |
TERMINATED
Indicates event has been terminated without completion
|
Constructor and Description |
---|
ProcessActivity(ProcessInstance processInstance,
Activity activity,
long sequence)
Default constructor associated process instance and element in the model
|
Modifier and Type | Method and Description |
---|---|
void |
addEnabledInterval(Date from,
Date to) |
void |
addWorkInterval(Date from,
Date to) |
int |
compareTo(ProcessActivity o) |
Activity |
getActivity()
Gets associated activity in a process model.
|
TaskResource |
getAssignedResource()
Returns assigned resource for the activity
|
Date |
getCompletionTime()
Returns time when this element will be completed
|
Date |
getCompletionTimeStamp()
Gets the either the completion or withdrawal timestamp.
|
double |
getCost()
Gets total cost of activity.
|
double |
getDuration()
Gets duration.
|
double |
getEnabledIdleTime()
Gets resource idle time between enabled and started states
|
ArrayList<Date> |
getEnabledIntervals() |
ProcessInstance |
getHandlingProcessInstance()
Returns handling sub-process instance for sub-process container activities.
|
String |
getId()
Gets unique id containing process id and element index
|
static String |
getInstanceId(int processId,
int activityIndex)
Returns an unique id per process instance and activity index.
|
TaskResource |
getLastAssignedResource()
Returns last assigned resource for the activity
|
ProcessActivity |
getParentActivity()
Gets the parent activity for boundary events.
|
ProcessInstance |
getProcessInstance()
Gets associated process instance
|
ProcessActivity[] |
getRescindableActivities()
Gets array of rescindable events to be rescinded on completion
|
Date |
getTimeStamp(byte action)
Returns timestamp for given action
|
double |
getWorkDuration()
Returns the duration of a resource working on the activity until it got
finished or terminated half way through.
|
double |
getWorkingIdleTime()
Returns the time period in seconds that the task has been waiting for the
resource after it has been has been started to start working according to the
work schedule (e.g.
|
ArrayList<Date> |
getWorkIntervals() |
boolean |
isCompleted()
Returns whether activity has been completed
|
boolean |
isRescinded()
Returns if this element is rescinded (e.g.
|
boolean |
isTerminated()
Returns whether activity has been completed
|
void |
notifyActivityTerminated(Date timestamp)
Notifies that activity was terminated.
|
void |
notifyRescinded()
Notifies that the activity has been rescinded and won't be handled.
|
void |
setActivity(Activity activity) |
void |
setAssignedResource(TaskResource assignedResource)
Assigns a resource to the activity
|
void |
setCompletionTime(Date completionTime)
Sets the target completion time for the activity
|
void |
setEnabledIdleTime(double enabledIdleTime)
Sets the time in seconds of the period that the resources were not working
and resource was not assigned
|
void |
setHandlingProcessInstance(ProcessInstance handlingProcessInstance)
For activities representing a sub-process, define a process instance handling
the sub-procedure.
|
void |
setParentActivity(ProcessActivity parentActivity)
Sets the parent activity for boundary events
|
void |
setProcessInstance(ProcessInstance processInstance) |
void |
setRescindableActivities(ProcessActivity[] rescindableActivities)
Sets an array of rescindable events to be rescinded on completion
|
void |
stamp(byte action,
Date timestamp)
Timestamps the event.
|
String |
toString() |
public static final byte ENABLED
public static final byte STARTED
public static final byte FINISHED
public static final byte TERMINATED
public ProcessActivity(ProcessInstance processInstance, Activity activity, long sequence)
processInstance
- instance of a process to which this activity belongsactivity
- corresponding activity in a process modelsequence
- unique sequence number of the activitypublic Activity getActivity()
public void setActivity(Activity activity)
public ProcessInstance getProcessInstance()
public void setProcessInstance(ProcessInstance processInstance)
public int compareTo(ProcessActivity o)
compareTo
in interface Comparable<ProcessActivity>
public Date getCompletionTime()
public void setCompletionTime(Date completionTime)
completionTime
- public boolean isCompleted()
public boolean isTerminated()
public Date getCompletionTimeStamp()
public ProcessActivity getParentActivity()
public void setParentActivity(ProcessActivity parentActivity)
parentActivity
- public boolean isRescinded()
public void notifyRescinded()
public void notifyActivityTerminated(Date timestamp)
timestamp
- when it was terminated (could be in the past)public String getId()
public double getDuration() throws ProcessValidationException
ProcessValidationException
public void setRescindableActivities(ProcessActivity[] rescindableActivities)
rescindableActivities
- array of timer eventspublic ProcessActivity[] getRescindableActivities()
public void setHandlingProcessInstance(ProcessInstance handlingProcessInstance)
handlingProcessInstance
- public ProcessInstance getHandlingProcessInstance()
public void stamp(byte action, Date timestamp)
action
- 0 if enabled, 1 if started, 2 if completedtimestamp
- timestamp actionpublic Date getTimeStamp(byte action)
action
- 0 if enabled, 1 if started, 2 if completed, 3 if terminatedpublic static String getInstanceId(int processId, int activityIndex)
processId
- process idactivityIndex
- activity indexpublic double getWorkingIdleTime()
public void setEnabledIdleTime(double enabledIdleTime)
enabledIdleTime
- the enabledIdleTime to setpublic double getEnabledIdleTime()
public double getCost()
public void setAssignedResource(TaskResource assignedResource)
assignedResource
- resource (worker) for the taskpublic TaskResource getAssignedResource()
public TaskResource getLastAssignedResource()
public double getWorkDuration()
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.