Show / Hide Table of Contents

Class BatchTaskBase

Base class for tasks to be executed by the BatchTaskFactory.

Inheritance
Object
BatchTaskBase
BulkUpdateBatchPlugin
CSMailMergeBatchPlugin
ErpForceResyncBatchPlugin
ExportSelectionToFileBatchPlugin
FreetextIndexRowsBatchPlugin
FreetextRegenBatchPlugin
ImportBatchPlugin
ImportProductImageBatchPlugin
MailMergeBatchPlugin
MaintenanceBatchPlugin
SaintRegenBatchPlugin
UdefPublishBatchPlugin
TicketBatchPluginBase
Implements
IBatchTask
Namespace: SuperOffice.CRM.BatchProcessing.Tasks
Assembly: SoBatchProcessing.dll
Syntax
public abstract class BatchTaskBase : Object, IBatchTask, IPlugin

Constructors

BatchTaskBase()

Base class for tasks to be executed by the BatchTaskFactory.

Declaration
protected BatchTaskBase()

Fields

_isEnding

Base class for tasks to be executed by the BatchTaskFactory.

Declaration
protected bool _isEnding
Field Value
Type Description
Boolean

_statusUpdateInterval

Base class for tasks to be executed by the BatchTaskFactory.

Declaration
protected long _statusUpdateInterval
Field Value
Type Description
Int64

Properties

BatchTaskInfo

Base class for tasks to be executed by the BatchTaskFactory.

Declaration
protected BatchTaskInfo BatchTaskInfo { get; }
Property Value
Type Description
BatchTaskInfo

Context

Context of the task

Declaration
public string Context { get; }
Property Value
Type Description
String

Id

Base class for tasks to be executed by the BatchTaskFactory.

Declaration
protected int Id { get; }
Property Value
Type Description
Int32

Name

Name of the task.

Declaration
public string Name { get; }
Property Value
Type Description
String

Result

Result of the task.

Declaration
public string Result { get; }
Property Value
Type Description
String

State

State of the executing task.

Declaration
public BatchTaskState State { get; }
Property Value
Type Description
BatchTaskState

Methods

EndTask()

Set a flag to notify the task should be stopped.

Declaration
public void EndTask()

EnsureUdefs()

Base class for tasks to be executed by the BatchTaskFactory.

Declaration
protected void EnsureUdefs()

GetTaskInfo()

Get information about the currently executing task.

Declaration
public BatchTaskInfo GetTaskInfo()
Returns
Type Description
BatchTaskInfo

Information about the currently executing task.

ProgressCallback(Int32, Int32, ref Boolean)

Base class for tasks to be executed by the BatchTaskFactory.

Declaration
protected void ProgressCallback(int total, int current, ref bool cancel)
Parameters
Type Name Description
Int32 total
Int32 current
Boolean cancel

Run(String, String)

Run the task.

Declaration
protected abstract bool Run(string name, string context)
Parameters
Type Name Description
String name

Name of the task.

String context

Context for the task.

Returns
Type Description
Boolean

True if the task succeeded.

Remarks

Call SetResult(String) as needed.

SaveStreamToBlob(Stream, String, String, String)

Base class for tasks to be executed by the BatchTaskFactory.

Declaration
protected int SaveStreamToBlob(Stream stream, string description = null, string extraInfo = null, string linkComment = null)
Parameters
Type Name Description
Stream stream
String description
String extraInfo
String linkComment
Returns
Type Description
Int32

SetResult(String)

Set the result of the task.

Declaration
protected void SetResult(string result)
Parameters
Type Name Description
String result

Result to set on the executing task.

StartTask(BatchTaskInfo, String, BatchTaskStatusChanged)

Start a batch task

Declaration
public BatchTaskInfo StartTask(BatchTaskInfo batchTaskInfo, string context, BatchTaskStatusChanged onBatchTaskStatusChanged)
Parameters
Type Name Description
BatchTaskInfo batchTaskInfo

Information about the task to start.

String context
BatchTaskStatusChanged onBatchTaskStatusChanged

Notify about changes to the batch task state.

Returns
Type Description
BatchTaskInfo

Returns a BatchTaskInfo with information about the started task

StartTask(Int32, String, String, BatchTaskStatusChanged)

Start an already existing batch task

Declaration
public BatchTaskInfo StartTask(int id, string name, string context, BatchTaskStatusChanged onBatchTaskStatusChanged)
Parameters
Type Name Description
Int32 id

Id of the batch task.

String name

Name of the batch task

String context
BatchTaskStatusChanged onBatchTaskStatusChanged

Notify about changes to the batch task state.

Returns
Type Description
BatchTaskInfo

Returns a BatchTaskInfo with information about the started task

Implements

IBatchTask

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top