public class BatchJob extends PersistentObject
The specific life cycle may be much more complex, according to behavioral modification flags and timer interaction.
Please note that setting properties of the BatchJob should be achieved via the mark* methods of BatchManager
.
When updates on a BatchJob instance via its setters need to be made, the following pattern is recommended in order to account for concurrent modifications by other threads:
doStart(BatchJob job) {
...
job = BatchManager.getFreshBatchJob(job);
job.setResultValues("my results");
store.update(job);
}
Modifier and Type | Field and Description |
---|---|
static int |
ABORTED
State for aborted instances.
|
static int |
COMPLETED
State for completed instances.
|
static int |
COMPLETEDERRORHANDLING
error handling has been completed
|
static int |
CREATED
Initial state for the instance.
|
static int |
FINISHED
State for finished instances.
|
static int |
FINISHERROR
State for instances which could not be finished by the BatchManager or the corresponding executor.
|
static int |
FINISHERRORHANDLING
error handling for batchjobs which couln't be finished is currently active
|
static int |
FINISHERRORHANDLINGFAILED
error handling is defined for this batchjob, but it did fail to start
|
static int |
FINISHERRORHANDLINGPENDING
error handling for batchjobs which couldn't be finished will be started soon
|
static int |
STARTED
State for started instances.
|
static int |
STARTERROR
State for instances which could not be started.
|
static int |
STARTERRORHANDLING
error handling for batchjobs which couln't be started is currently active
|
static int |
STARTERRORHANDLINGFAILED
error handling is defined for this batchjob, but it did fail to start
|
static int |
STARTERRORHANDLINGPENDING
error handling for batchjobs which couldn't be started will be started soon
|
filled, oid
emptyKeys
Modifier | Constructor and Description |
---|---|
|
BatchJob()
Create an empty BatchJob instance.
|
protected |
BatchJob(String jobtype,
int jobstate,
ActivityInstance context,
String params)
Create a BatchJob instance.
|
Modifier and Type | Method and Description |
---|---|
Date |
getAborttime()
Get the time the instance was aborted.
|
Date |
getCompletiontime()
Get the time the instance was completed.
|
ActivityInstance |
getContext()
The process context in which the instance was submitted.
|
Date |
getCreationtime()
Get the time the instance was created.
|
String |
getExecutor() |
Date |
getFinishtime()
Get the time the instance was finished.
|
int |
getJobstate()
The state of the instance.
|
String |
getJobtype()
The jobtype of the instance.
|
Date |
getLastpolltime() |
Date |
getLastStartTryTime()
Get the time of the last start attempt.
|
String |
getParams()
Get the parameters for the job execution.
|
int |
getPollAttemptCount()
Gets the number of poll attempts to far.
|
long |
getPollInterval()
Gets the poll interval.
|
int |
getResultcode()
Get the resultcode of the instance.
|
String |
getResultvalues()
Get the resultvalues of the instance.
|
int |
getStartAttemptCount()
Gets the number of start attempts to far.
|
long |
getStartInterval()
Gets the start interval.
|
Date |
getStarttime()
Get the time the instance was started or is about to be started.
|
String |
getStateName() |
static String |
getStateName(int state) |
String |
getTableName()
This method must return the table name of the database table in which
this persistent object is stored.
|
boolean |
isAutofinish()
Determine whether the instance is to be finished automatically ('autofinish' in WDL).
|
boolean |
isGoBackOnError()
Determine whether an error during start or poll of the instance will force the engine to go back to
the latest interactive step ('gobackonerror' in WDL).
|
boolean |
isNewthread()
Determine whether the instance start and poll attempts are to be made in a new thread ('newthread' in WDL).
|
boolean |
isPollFinish()
Determine whether a job should be polled for being finished ('pollfinish' in WDL) by the BatchManager or a corresponding executor.
|
boolean |
isResumable()
Determines if the batch job is resumable.
|
boolean |
isRetryStart()
Determine whether erroneous starts will be retried later on ('retrystart' in WDL) by the BatchManager or a corresponding executor.
|
boolean |
isStartnow()
Determine whether the instance is to be started immediately ('startnow' in WDL).
|
boolean |
isSuspendable()
Determine if the batch job is suspendable.
|
void |
setAborttime(Date aborttime) |
void |
setAutofinish(boolean autofinish)
Set the autofinish property of the instance.
|
void |
setCompletiontime(Date completiontime) |
void |
setContext(ActivityInstance context) |
void |
setCreationtime(Date creationtime) |
void |
setExecutor(String executor)
Set the executor of the instance.
|
void |
setFinishtime(Date finishtime) |
void |
setGoBackOnError(boolean gobackonerror)
Set the gobackonerror property of the instance.
|
void |
setJobstate(int jobstate) |
void |
setJobtype(String jobtype) |
protected void |
setLastPollTime(Date lastpolltime) |
protected void |
setLastStartTryTime(Date laststarttrytime) |
void |
setNewthread(boolean newthread)
Set the newthread property of the instance.
|
void |
setParams(String params)
Set the params field of the instance.
|
protected void |
setPollAttemptCount(int pollattemptcount) |
void |
setPollFinish(boolean pollfinish)
Set the pollfinish property of the instance.
|
void |
setPollInterval(long pollinterval)
Set the poll interval of an instance.
|
void |
setResultcode(int resultcode)
Set the resultcode of the instance.
|
void |
setResultvalues(String resultvalues)
Set the resultvalues.
|
void |
setRetryStart(boolean retrystart)
Set the retrystart property of the instance.
|
protected void |
setStartAttemptCount(int startattemptcount) |
void |
setStartInterval(long startinterval)
Set the start interval of an instance.
|
void |
setStartnow(boolean startnow)
Set the startnow property of the instance.
|
void |
setStarttime(Date starttime)
Set the time the instance should be started.
|
String |
toString() |
afterDelete, afterInsert, afterRead, afterUpdate, beforeDelete, beforeInsert, beforeUpdate, clone, dbFields, equals, getKey, getKeys, getLocalClassName, getLocalObjectName, getOid, getStore, getValue, hashCode, isFilled, isValid, onDelete, onInsert, onRead, onUpdate, setFilled, setOid, setOid, setStore, toListString
public static final int CREATED
public static final int STARTED
BatchAdapter.doPoll(BatchJob)
.public static final int FINISHED
public static final int COMPLETED
public static final int ABORTED
public static final int STARTERROR
public static final int FINISHERROR
public static final int STARTERRORHANDLING
public static final int FINISHERRORHANDLING
public static final int COMPLETEDERRORHANDLING
public static final int STARTERRORHANDLINGPENDING
public static final int FINISHERRORHANDLINGPENDING
public static final int STARTERRORHANDLINGFAILED
public static final int FINISHERRORHANDLINGFAILED
protected BatchJob(String jobtype, int jobstate, ActivityInstance context, String params)
jobtype
- a Stringjobstate
- an intcontext
- a ActivityInstanceparams
- a Stringpublic BatchJob()
public String getTableName()
Persistent
public void setStartnow(boolean startnow)
public boolean isStartnow()
public void setAutofinish(boolean autofinish)
public boolean isAutofinish()
public void setNewthread(boolean newthread)
public boolean isNewthread()
public void setGoBackOnError(boolean gobackonerror)
public boolean isGoBackOnError()
public void setRetryStart(boolean retrystart)
public boolean isRetryStart()
public void setPollFinish(boolean pollfinish)
public boolean isPollFinish()
public void setJobtype(String jobtype)
public String getJobtype()
public String getExecutor()
public void setExecutor(String executor)
executor
- the id of the timer to use as the executor of this instance.public void setJobstate(int jobstate)
public int getJobstate()
public void setContext(ActivityInstance context)
public ActivityInstance getContext()
public void setParams(String params)
public String getParams()
public void setResultvalues(String resultvalues)
resultvalues
- a Stringpublic String getResultvalues()
public void setResultcode(int resultcode)
resultcode
- an int representing a coded result of the instances executionpublic int getResultcode()
public void setCreationtime(Date creationtime)
public Date getCreationtime()
public void setStarttime(Date starttime)
public Date getStarttime()
public void setFinishtime(Date finishtime)
public Date getFinishtime()
public void setCompletiontime(Date completiontime)
public Date getCompletiontime()
public Date getLastStartTryTime()
public Date getAborttime()
public void setAborttime(Date aborttime)
protected void setLastStartTryTime(Date laststarttrytime)
public int getStartAttemptCount()
protected void setStartAttemptCount(int startattemptcount)
public long getStartInterval()
public void setStartInterval(long startinterval)
startinterval
- the interval to use (seconds)public Date getLastpolltime()
protected void setLastPollTime(Date lastpolltime)
public int getPollAttemptCount()
protected void setPollAttemptCount(int pollattemptcount)
public long getPollInterval()
public void setPollInterval(long pollinterval)
pollinterval
- the interval to use (seconds)public boolean isSuspendable()
public boolean isResumable()
public String getStateName()
public static String getStateName(int state)
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.