public abstract class AbstractWorkflow<C extends ApplicationContext> extends AbstractSwingTask<C>
WorkflowTask
s run as child-tasks within the main
workflow-task. WorkflowTask
s are being observed by the WorkflowMonitorDialog
which is GUI dialog visualizing the progress with check-labels. It is popped up when the workflow
starts or finishes.childTaskRef, isTestMode, monitorController, resultRef, stateFlag
Constructor and Description |
---|
AbstractWorkflow(C ctx) |
AbstractWorkflow(C ctx,
NlsKey title) |
Modifier and Type | Method and Description |
---|---|
void |
addTask(WorkflowTask task) |
protected LogChannel |
createLogChannel() |
protected WorkflowMonitorDialog |
createWorkflowMonitor()
Creates the
WorkflowMonitorDialog for visualizing the progress of this workflow. |
protected void |
doneTaskCancelled(TaskEvent e) |
protected void |
doneTaskFinished(TaskEvent e) |
protected void |
doneTaskStarted(TaskEvent e) |
protected void |
doneTaskStateChanged(TaskEvent e) |
boolean |
equals(java.lang.Object obj) |
void |
executeAsync()
Must be overridden to perform the async part.
|
int |
getCurrentTaskIndex() |
java.util.List<WorkflowTask> |
getTaskList() |
java.lang.String |
getTitleDetailText() |
IconKey |
getTitleIcon() |
java.lang.String |
getTitleText() |
WorkflowMonitorDialog |
getWorkflowMonitor() |
java.io.File |
getWorkingDir() |
void |
handleDecision(CheckOption option) |
int |
hashCode() |
void |
insertTask(WorkflowTask task) |
static boolean |
isAutoClose(java.lang.String workflowName) |
boolean |
isCloseMonitorOnCancel() |
boolean |
isMonitored()
Tells whether a
WorkflowMonitorDialog exists for this workflow |
void |
setAutoCloseWhenFinished(boolean isAutoClose) |
void |
setCloseMonitorOnCancel(boolean isCloseMonitorOnCancel)
Tells whether the monitor dialog should be closed on cancel.
|
void |
setFinalTask(WorkflowTask finalTask)
Sets a final task which will be executed in any case at the very end of the workflow.
|
void |
setTitleDetailText(NlsKey detailsKey,
java.lang.Object... args) |
void |
setTitleDetailText(java.lang.String titleDetailText)
This text is displayed as a second header line in the
WorkflowMonitorDialog |
void |
setTitleIcon(IconKey iconKey)
This icon is displayed in the
WorkflowMonitorDialog . |
void |
setTitleText(NlsKey titleKey,
java.lang.Object... args) |
void |
setTitleText(java.lang.String titleText)
This text is displayed as the main header line in the
WorkflowMonitorDialog . |
void |
setWorkingDir(java.io.File workingDir) |
void |
skipAllTasks()
Skips all remaining tasks
|
void |
skipCurrentTask()
This call stops the current task immediately and marks it as skipped
|
void |
skipNextTask()
Ensures that the next task is skipped
|
void |
skipNextTasks(int count)
Ensures that the next n task are being skipped
|
static void |
storeAutoClose(java.lang.String workflowName,
boolean isAutoClose) |
TaskId |
submit(java.util.concurrent.ExecutorService pool)
Submits this task for execution to the given thread pool
|
addMonitor, addTaskListener, awaitEventsDone, doneChildFinished, doneChildStarted, doneTaskFailed, doneTaskProceeded, doneTaskSucceeded, getActionCancel, getRenderColor, getRenderIcon, getRenderText, getSwingTaskMonitor, isRegisterInTaskList, removeTaskListener, showError, showError, showError, showInfo, showInfo, showWarning, showWarning
awaitFinished, awaitFinished, awaitStarted, cancel, createTaskId, deregisterTask, doOnFinish, doOnStart, doOnSuccess, executeChildTask, executeChildTask, getCurrentFuture, getMaxChildTasks, getPriority, getProcessingDuration, getStartTime, getStopWatch, handleFinish, handleStart, handleSuccess, isRegisterForCancel, isRunning, notifyProceeded, registerTask, releaseStart, run, setCurrentFuture, setMaxChildTasks, setPriority, setRegisterForCancel, setReleaseTimeout, submit, submitInternal, toString, wasSucceeded
checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnCancel, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, hasError, hasMonitor, isCancellable, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
checkCancelled, checkForErrorAndRethrow, executeSubTask, getName, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, isCancellable, setCancellable, setName, setResult, setRunStateFlag, sleepChecked
getApplicationContext
execute
clearMonitors, getMonitorCount, getMonitors, hasMonitor, removeMonitor
getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
wasCancelled
getTaskId
toDumpString, toDumpString, toString
public AbstractWorkflow(C ctx)
public static void storeAutoClose(java.lang.String workflowName, boolean isAutoClose)
public static boolean isAutoClose(java.lang.String workflowName)
public final void setTitleText(java.lang.String titleText)
WorkflowMonitorDialog
.
Is also used as the taskName.public final void setTitleText(NlsKey titleKey, java.lang.Object... args)
public final java.lang.String getTitleText()
public final boolean isCloseMonitorOnCancel()
setCloseMonitorOnCancel(boolean)
public void setCloseMonitorOnCancel(boolean isCloseMonitorOnCancel)
isCloseMonitorOnCancel
- default is trueisCloseMonitorOnCancel()
public final void setTitleDetailText(java.lang.String titleDetailText)
WorkflowMonitorDialog
public final void setTitleDetailText(NlsKey detailsKey, java.lang.Object... args)
public final java.lang.String getTitleDetailText()
public final void setTitleIcon(IconKey iconKey)
WorkflowMonitorDialog
.public final IconKey getTitleIcon()
public void setFinalTask(WorkflowTask finalTask)
public TaskId submit(java.util.concurrent.ExecutorService pool) throws java.lang.Exception
AsyncTask
submit
in interface AsyncTask<C extends ApplicationContext>
submit
in class AbstractAsyncTask<C extends ApplicationContext>
java.lang.Exception
- if the pool is busyprotected LogChannel createLogChannel()
public java.io.File getWorkingDir()
public void setWorkingDir(java.io.File workingDir)
public void setAutoCloseWhenFinished(boolean isAutoClose)
public java.util.List<WorkflowTask> getTaskList()
public void addTask(WorkflowTask task)
public void insertTask(WorkflowTask task)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public WorkflowMonitorDialog getWorkflowMonitor()
public boolean isMonitored()
WorkflowMonitorDialog
exists for this workflowprotected WorkflowMonitorDialog createWorkflowMonitor()
WorkflowMonitorDialog
for visualizing the progress of this workflow. You
may return null if no GUI monitoring is desired.public int getCurrentTaskIndex()
public void skipCurrentTask()
public void skipNextTask()
public void skipNextTasks(int count)
public void skipAllTasks()
public final void executeAsync() throws java.lang.Exception
AbstractAsyncTask
AbstractAsyncTask.notifyProceeded(Object, int, int, String)
in order to notify
about task progress. Note: the running task should periodically call
AbstractAsyncExecutable.checkCancelled()
in order to detect cancellation.executeAsync
in interface AsyncExecutable<C extends ApplicationContext>
executeAsync
in class AbstractAsyncTask<C extends ApplicationContext>
java.lang.Exception
for synchronous execution
protected void doneTaskStateChanged(TaskEvent e)
doneTaskStateChanged
in class AbstractSwingTask<C extends ApplicationContext>
protected void doneTaskStarted(TaskEvent e)
doneTaskStarted
in class AbstractSwingTask<C extends ApplicationContext>
protected void doneTaskFinished(TaskEvent e)
doneTaskFinished
in class AbstractSwingTask<C extends ApplicationContext>
protected void doneTaskCancelled(TaskEvent e)
doneTaskCancelled
in class AbstractSwingTask<C extends ApplicationContext>
public void handleDecision(CheckOption option)
Copyright © 2014 EsprIT-Systems. All Rights Reserved.