de.esprit.netsuite.client.workflow

## Class AbstractEventDrivenWFT<C extends ClientContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.appsuite.task.AbstractAsyncExecutable<C>
      - - de.esprit.appsuite.task.AbstractAsyncTask<C>
        - - de.esprit.appsuite.gui.task.AbstractSwingTask<C>
          - - de.esprit.appsuite.workflow.wft.AbstractWFT<C>
            - - de.esprit.netsuite.client.workflow.AbstractClientWFT<C>
              - - de.esprit.netsuite.client.workflow.AbstractEventDrivenWFT<C>

- All Implemented Interfaces:
    ApplicationObject<C>, AsyncExecutable<C>, AsyncTask<C>, CancellableTask, LocalCancellableTask, TaskMonitorSupport, TaskEvent.Source, TaskIdHolder, WorkflowTask<C>, ErrorHandlerSupport, Renderable, SimpleLogSupport, Dumpable, Executable, ClientObject<C>, RemoteTaskEventReceiver<C>, java.lang.Runnable

      public abstract class AbstractEventDrivenWFT<C extends ClientContext>
      extends AbstractClientWFT<C>
      implements RemoteTaskEventReceiver<C>

  This workflow-task is supposed to run a remote task on the server. It is being notified about the remote tasks progress via `RemoteTaskEvent`s.
  Author:
    Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `childTaskRef, isTestMode, monitorController, resultRef, stateFlag`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractEventDrivenWFT(AbstractWorkflow<C> workflow)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()` Cancels the remote counterpart task running on the server using a `RemoteTaskCancelAgent`.
    `void` | `enterTask(WorkflowTask previousTask)` Runs in the ET before the task starts to run async
    `void` | `executeAsyncImpl()` This method is executed asynchronously
    `protected RemoteTaskCreator` | `getRemoteTaskCreator()` Should be overridden if a `RemoteTaskCreator` is being used to instantiate the remote task.
    `void` | `receivedTaskEvent(RemoteTaskEvent event)` Is called whenever this task has received a `RemoteTaskEvent` from the remotely running task.

    - ### Methods inherited from class de.esprit.netsuite.client.workflow.AbstractClientWFT

      `getClientConfig, getClientContext, getWorkspaceDir`

    - ### Methods inherited from class de.esprit.appsuite.workflow.wft.AbstractWFT

      `executeAsync, exitTask, getTaskIndex, getWorkflow, getWorkingDir, isDeciderTask, isTaskRepeating, setName, setTaskIndex, updateTaskName`

    - ### Methods inherited from class de.esprit.appsuite.gui.task.AbstractSwingTask

      `addMonitor, addTaskListener, awaitEventsDone, doneChildFinished, doneChildStarted, doneTaskCancelled, doneTaskFailed, doneTaskFinished, doneTaskProceeded, doneTaskStarted, doneTaskStateChanged, doneTaskSucceeded, getActionCancel, getRenderColor, getRenderIcon, getRenderText, getSwingTaskMonitor, isRegisterInTaskList, removeTaskListener, showError, showError, showError, showInfo, showInfo, showWarning, showWarning`

    - ### Methods inherited from class de.esprit.appsuite.task.AbstractAsyncTask

      `awaitFinished, awaitFinished, awaitStarted, 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, submit, submitInternal, toString, wasSucceeded`

    - ### Methods inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `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, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface de.esprit.appsuite.task.AsyncTask

      `awaitFinished, awaitFinished, awaitStarted, executeChildTask, executeChildTask, getError, getProcessingDuration, hasError, isRegisterForCancel, isRunning, releaseStart, setName, setReleaseTimeout, submit, submit`

    - ### Methods inherited from interface de.esprit.appsuite.task.AsyncExecutable

      `checkCancelled, checkForErrorAndRethrow, executeAsync, executeSubTask, getName, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, isCancellable, notifyProceeded, setCancellable, setName, setResult, setRunStateFlag, sleepChecked`

    - ### Methods inherited from interface de.esprit.appsuite.launch.ApplicationObject

      `getApplicationContext`

    - ### Methods inherited from interface de.esprit.common.type.Executable

      `execute`

    - ### Methods inherited from interface de.esprit.appsuite.task.monitor.TaskMonitorSupport

      `addMonitor, clearMonitors, getMonitorCount, getMonitors, hasMonitor, removeMonitor`

    - ### Methods inherited from interface de.esprit.common.log.SimpleLogSupport

      `getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from interface java.lang.Runnable

      `run`

    - ### Methods inherited from interface de.esprit.appsuite.task.CancellableTask

      `wasCancelled`

    - ### Methods inherited from interface de.esprit.appsuite.task.TaskIdHolder

      `getTaskId`

    - ### Methods inherited from interface de.esprit.common.type.Dumpable

      `toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from interface de.esprit.netsuite.client.ClientObject

      `getClientContext`

- - ### Constructor Detail

    - #### AbstractEventDrivenWFT

          public AbstractEventDrivenWFT(AbstractWorkflow<C> workflow)

  - ### Method Detail

    - #### enterTask

          public void enterTask(WorkflowTask previousTask)
                         throws java.lang.Exception

      Description copied from interface: `WorkflowTask`
      Runs in the ET before the task starts to run async
      Specified by:
        `enterTask` in interface `WorkflowTask<C extends ClientContext>`
      Overrides:
        `enterTask` in class `AbstractWFT<C extends ClientContext>`
      Throws:
        `java.lang.Exception`

    - #### executeAsyncImpl

          public final void executeAsyncImpl()
                                      throws java.lang.Exception

      Description copied from interface: `WorkflowTask`
      This method is executed asynchronously
      Specified by:
        `executeAsyncImpl` in interface `WorkflowTask<C extends ClientContext>`
      Overrides:
        `executeAsyncImpl` in class `AbstractWFT<C extends ClientContext>`
      Throws:
        `java.lang.Exception`

    - #### getRemoteTaskCreator

          protected RemoteTaskCreator getRemoteTaskCreator()

      Should be overridden if a `RemoteTaskCreator` is being used to instantiate the remote task.

    - #### cancel

          public final void cancel()

      Cancels the remote counterpart task running on the server using a `RemoteTaskCancelAgent`.
      Specified by:
        `cancel` in interface `LocalCancellableTask`
      Overrides:
        `cancel` in class `AbstractAsyncTask<C extends ClientContext>`

    - #### receivedTaskEvent

          public void receivedTaskEvent(RemoteTaskEvent event)

      Is called whenever this task has received a `RemoteTaskEvent` from the remotely running task. Within this method we may investigate the event type and perform an appropriate reaction. Note that any RuntimeException thrown here will not break the event iteration.
      Specified by:
        `receivedTaskEvent` in interface `RemoteTaskEventReceiver<C extends ClientContext>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.