com.groiss.wf.batch
Class BatchJob

java.lang.Object
  extended by com.groiss.store.PersistentObject
      extended by com.groiss.wf.batch.BatchJob
All Implemented Interfaces:
KeyValuePair<java.lang.Object,java.lang.Object>, Persistent, java.io.Serializable, java.lang.Cloneable

public class BatchJob
extends PersistentObject

Captures state information about batch Jobs. Each batchjob is in one of four normal lifecycle states or one of two error states. First it is CREATED, then it is STARTED, then it is FINISHED and afterwards it is COMPLETED. It may also be manually ABORTED.

See Also:
Serialized Form

Field Summary
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.
static int FINISHERRORHANDLING
          error handling for batchjobs which couln't be finished is currently active
static int FINISHERRORHANDLINGFAILED
          error handling is definied for this batchjob, but it did fail to start
static int FINISHERRORHANDLINGPENDING
          error handling for batchjobs which couln'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 definied for this batchjob, but it did fail to start
static int STARTERRORHANDLINGPENDING
          error handling for batchjobs which couln't be started will be started soon
 
Fields inherited from class com.groiss.store.PersistentObject
filled, oid
 
Constructor Summary
  BatchJob()
          Create an empty BatchJob instance.
protected BatchJob(java.lang.String jobtype, int jobstate, ActivityInstance context, java.lang.String params)
          Create a BatchJob instance.
 
Method Summary
 java.util.Date getCompletiontime()
          Get the time the instance was completed.
 ActivityInstance getContext()
          The process context in which the instance was submitted.
 java.util.Date getCreationtime()
          Get the time the instance was created.
 java.util.Date getFinishtime()
          Get the time the instance was finished.
 int getJobstate()
          The state of the instance.
 java.lang.String getJobtype()
          The jobtype of the instance.
 java.lang.String getParams()
          Get the parameters for the job execution.
 int getResultcode()
          Get the resultcode of the instance.
 java.lang.String getResultvalues()
          Get the resultvalues of the instance.
 java.util.Date getStarttime()
          Get the time the instance was started or is about to be started.
 java.lang.String getStateName()
           
 java.lang.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.
 boolean isGoBackOnError()
          Determine whether an error during start of the instance will force the engine to go back to the latest interactive step.
 boolean isNewthread()
          Determine whether the instance is to be started in a new thread.
 boolean isStartnow()
          Determine whether the instance is to be started immediately.
 void setAutofinish(boolean autofinish)
          Set the autofinish property of the instance.
 void setCompletiontime(java.util.Date completiontime)
           
 void setContext(ActivityInstance context)
           
 void setCreationtime(java.util.Date creationtime)
           
 void setFinishtime(java.util.Date finishtime)
           
 void setGoBackOnError(boolean gobackonerror)
          Set the gobackonerror property of the instance.
 void setJobstate(int jobstate)
           
 void setJobtype(java.lang.String jobtype)
           
 void setNewthread(boolean newthread)
          Set the newthread property of the instance.
 void setParams(java.lang.String params)
          Set the params field of the instance.
 void setResultcode(int resultcode)
          Set the resultcode of the instance.
 void setResultvalues(java.lang.String resultvalues)
          Set the resultvalues.
 void setStartnow(boolean startnow)
          Set the startnow property of the instance.
 void setStarttime(java.util.Date starttime)
          Set the time the instance shoud be started.
 java.lang.String toString()
           
 
Methods inherited from class com.groiss.store.PersistentObject
clone, dbFields, equals, getKey, getOid, getStore, getValue, hashCode, isFilled, onDelete, onInsert, onRead, onUpdate, setFilled, setOid, setStore
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATED

public static final int CREATED
Initial state for the instance. Immediately after it is created. External execution context do not yet know about batchjobs in this state. The BatchManager periodically looks for jobs in this state and starts them.

See Also:
Constant Field Values

STARTED

public static final int STARTED
State for started instances. The batchJob is in the external execution context. The workflow engine does nothing with jobs in this state.

See Also:
Constant Field Values

FINISHED

public static final int FINISHED
State for finished instances. The batchJob was finished in the external execution context. The BatchManager periodically checks for jobs in this state and completes them. Especially, the originating task of the BatchJob is finished.

See Also:
Constant Field Values

COMPLETED

public static final int COMPLETED
State for completed instances. The batchJob was completed by the BatchManager. The workflow engine does nothing with jobs in this state.

See Also:
Constant Field Values

ABORTED

public static final int ABORTED
State for aborted instances. The cancellation was issued manually. The workflow engine does nothing with jobs in this state.

See Also:
Constant Field Values

STARTERROR

public static final int STARTERROR
State for instances which could not be started. E.g. where doStart of the BatchAdapter threw an Exception. The workflow engine does nothing with jobs in this state.

See Also:
Constant Field Values

FINISHERROR

public static final int FINISHERROR
State for instances which could not be finished by the BatchManager. E.g. where beforeCompletion of the BatchAdapter threw an Exception. The workflow engine does nothing with jobs in this state.

See Also:
Constant Field Values

STARTERRORHANDLING

public static final int STARTERRORHANDLING
error handling for batchjobs which couln't be started is currently active

See Also:
Constant Field Values

FINISHERRORHANDLING

public static final int FINISHERRORHANDLING
error handling for batchjobs which couln't be finished is currently active

See Also:
Constant Field Values

COMPLETEDERRORHANDLING

public static final int COMPLETEDERRORHANDLING
error handling has been completed

See Also:
Constant Field Values

STARTERRORHANDLINGPENDING

public static final int STARTERRORHANDLINGPENDING
error handling for batchjobs which couln't be started will be started soon

See Also:
Constant Field Values

FINISHERRORHANDLINGPENDING

public static final int FINISHERRORHANDLINGPENDING
error handling for batchjobs which couln't be finished will be started soon

See Also:
Constant Field Values

STARTERRORHANDLINGFAILED

public static final int STARTERRORHANDLINGFAILED
error handling is definied for this batchjob, but it did fail to start

See Also:
Constant Field Values

FINISHERRORHANDLINGFAILED

public static final int FINISHERRORHANDLINGFAILED
error handling is definied for this batchjob, but it did fail to start

See Also:
Constant Field Values
Constructor Detail

BatchJob

protected BatchJob(java.lang.String jobtype,
                   int jobstate,
                   ActivityInstance context,
                   java.lang.String params)
Create a BatchJob instance.

Parameters:
jobtype - a String
jobstate - an int
context - a ActivityInstance
params - a String

BatchJob

public BatchJob()
Create an empty BatchJob instance.

Method Detail

getTableName

public java.lang.String getTableName()
Description copied from interface: Persistent
This method must return the table name of the database table in which this persistent object is stored.

Returns:
The table name of the database table in which this persistent object is stored.

setStartnow

public void setStartnow(boolean startnow)
Set the startnow property of the instance.


isStartnow

public boolean isStartnow()
Determine whether the instance is to be started immediately. If true, the BatchManager is not involved with the start of the job, it is started immediately after creation.


setAutofinish

public void setAutofinish(boolean autofinish)
Set the autofinish property of the instance.


isAutofinish

public boolean isAutofinish()
Determine whether the instance is to be finished automatically. If true, the job is marked as finished as soon as the doStart method of the specified BatchAdapter terminates.

See Also:
BatchAdapter.doStart(com.groiss.wf.batch.BatchJob)

setNewthread

public void setNewthread(boolean newthread)
Set the newthread property of the instance.


isNewthread

public boolean isNewthread()
Determine whether the instance is to be started in a new thread. If true, a new thread is created immediately after job creation. The start of the batchjob (and its further handling if autofinish is set) takes place in this thread.


setGoBackOnError

public void setGoBackOnError(boolean gobackonerror)
Set the gobackonerror property of the instance.


isGoBackOnError

public boolean isGoBackOnError()
Determine whether an error during start of the instance will force the engine to go back to the latest interactive step. If false, the process will remain at this step.


setJobtype

public void setJobtype(java.lang.String jobtype)

getJobtype

public java.lang.String getJobtype()
The jobtype of the instance.

Returns:
a Classname of a BatchAdapter which is responsible for event handling for this instance.

setJobstate

public void setJobstate(int jobstate)

getJobstate

public int getJobstate()
The state of the instance.

Returns:
an int representing the execution state of the instance.

setContext

public void setContext(ActivityInstance context)

getContext

public ActivityInstance getContext()
The process context in which the instance was submitted.

Returns:
a ActivityInstance which represents the TASK where the instance was submitted.

setParams

public void setParams(java.lang.String params)
Set the params field of the instance.


getParams

public java.lang.String getParams()
Get the parameters for the job execution. Must be interpreted by the BatchAdapter.

Returns:
a String containing parameters for execution.

setResultvalues

public void setResultvalues(java.lang.String resultvalues)
Set the resultvalues. Not interpreted by the BatchManager.

Parameters:
resultvalues - a String

getResultvalues

public java.lang.String getResultvalues()
Get the resultvalues of the instance.

Returns:
a String representing some result of the instances execution.

setResultcode

public void setResultcode(int resultcode)
Set the resultcode of the instance. Not interpreted by the BatchManager.

Parameters:
resultcode - an int representing a coded result of the instances execution

getResultcode

public int getResultcode()
Get the resultcode of the instance.

Returns:
an int with the coded result of the execution of the instance.

setCreationtime

public void setCreationtime(java.util.Date creationtime)

getCreationtime

public java.util.Date getCreationtime()
Get the time the instance was created.

Returns:
a Date

setStarttime

public void setStarttime(java.util.Date starttime)
Set the time the instance shoud be started. If null, then it is started at the next run of the BatchManager. Otherwise it is started in the first run of the BatchManager which takes place after the starttime.


getStarttime

public java.util.Date getStarttime()
Get the time the instance was started or is about to be started. If null

Returns:
a Date

setFinishtime

public void setFinishtime(java.util.Date finishtime)

getFinishtime

public java.util.Date getFinishtime()
Get the time the instance was finished.

Returns:
a Date

setCompletiontime

public void setCompletiontime(java.util.Date completiontime)

getCompletiontime

public java.util.Date getCompletiontime()
Get the time the instance was completed.

Returns:
a Date

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getStateName

public java.lang.String getStateName()


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.