BusinessProcessor

Overview

When a Data Abstract service UpdateData method is called, each of the deltas sent by the client are handed to a specific Business Processor (either auto created or explicitly dropped on the service at design time), which executes the appropriate INSERT, DELETE and UPDATE SQL commands for each of the changes related to one data table.

You can specify which data table a Business Processor refers to by setting the property ReferencedDataTable.

Business Processors can either auto generate the SQL used by such commands (see properties AutoGenerateInsert , AutoGenerateDelete and AutoGenerateUpdate) or reference commands you define in a Schema (see properties InsertCommandName, DeleteCommandName and UpdateCommandName).

Once a delta change has been processed, the contents of the row can be re-read through the use of a query identified by the RefreshDataTableName. This is useful whenever a trigger modifies the record in the background and you want to avoid a second round trip to the server to get an exact snapshot of the data. The values returned by the refresh query are merged in the delta and sent back to the client during the same UpdateData call.

In order to control what happens before and after the processing of each delta or their changes, use the many events provided by the Business Processor class.

In summary, it allows you to define the business logic surrounding the processing of delta changes, before and after they get applied to the database.

Location


 

constructor

Creates a new instance of the BusinessProcessor class.

 

constructor

 

BusinessProcessor()

 

Sub New()

constructor (IContainer)

Creates a new instance of the BusinessProcessor class and adds it to the provided components container.

 

constructor(container: IContainer)

 

BusinessProcessor(IContainer container)

 

Sub New(container As IContainer)

Parameters:

  • container: Components container

add_AfterExecuteCommand

 

method add_AfterExecuteCommand(value: ExecuteCommandHandler)

 

void add_AfterExecuteCommand(ExecuteCommandHandler value)

 

Sub add_AfterExecuteCommand(value As ExecuteCommandHandler)

Parameters:

  • value:

add_AfterProcessChange

 

method add_AfterProcessChange(value: DeltaChangeEventHandler)

 

void add_AfterProcessChange(DeltaChangeEventHandler value)

 

Sub add_AfterProcessChange(value As DeltaChangeEventHandler)

Parameters:

  • value:

add_AfterProcessDelta

 

method add_AfterProcessDelta(value: DeltaEventHandler)

 

void add_AfterProcessDelta(DeltaEventHandler value)

 

Sub add_AfterProcessDelta(value As DeltaEventHandler)

Parameters:

  • value:

add_AfterSqlGeneration

 

method add_AfterSqlGeneration(value: SqlGenerationEventHandler)

 

void add_AfterSqlGeneration(SqlGenerationEventHandler value)

 

Sub add_AfterSqlGeneration(value As SqlGenerationEventHandler)

Parameters:

  • value:

add_BeforeExecuteCommand

 

method add_BeforeExecuteCommand(value: ExecuteCommandHandler)

 

void add_BeforeExecuteCommand(ExecuteCommandHandler value)

 

Sub add_BeforeExecuteCommand(value As ExecuteCommandHandler)

Parameters:

  • value:

add_BeforeGetTableData

 

method add_BeforeGetTableData(value: BeforeGetTableDataEventHandler)

 

void add_BeforeGetTableData(BeforeGetTableDataEventHandler value)

 

Sub add_BeforeGetTableData(value As BeforeGetTableDataEventHandler)

Parameters:

  • value:

add_BeforeProcessChange

 

method add_BeforeProcessChange(value: DeltaChangeEventHandler)

 

void add_BeforeProcessChange(DeltaChangeEventHandler value)

 

Sub add_BeforeProcessChange(value As DeltaChangeEventHandler)

Parameters:

  • value:

add_BeforeProcessDelta

 

method add_BeforeProcessDelta(value: DeltaEventHandler)

 

void add_BeforeProcessDelta(DeltaEventHandler value)

 

Sub add_BeforeProcessDelta(value As DeltaEventHandler)

Parameters:

  • value:

add_ProcessError

 

method add_ProcessError(value: DeltaChangeErrorEventHandler)

 

void add_ProcessError(DeltaChangeErrorEventHandler value)

 

Sub add_ProcessError(value As DeltaChangeErrorEventHandler)

Parameters:

  • value:

AfterExecuteCommand

Fires after a command was executed.

 

event AfterExecuteCommand: ExecuteCommandHandler;
delegate: method AfterExecuteCommand(sender: BusinessProcessor; e: ExecuteCommandArgs)

 

delegate ExecuteCommandHandler AfterExecuteCommand()
delegate: void AfterExecuteCommand(BusinessProcessor sender, ExecuteCommandArgs e)

 

Event AfterExecuteCommand As ExecuteCommandHandler
delegate: Sub AfterExecuteCommand(sender As BusinessProcessor, e As ExecuteCommandArgs)

AfterProcessChange

Occurs after a delta change has been successfully processed. A common use of this event could be to store information about the updates in a log table.

 

event AfterProcessChange: DeltaChangeEventHandler;
delegate: method AfterProcessChange(sender: BusinessProcessor; e: DeltaChangeEventArgs)

 

delegate DeltaChangeEventHandler AfterProcessChange()
delegate: void AfterProcessChange(BusinessProcessor sender, DeltaChangeEventArgs e)

 

Event AfterProcessChange As DeltaChangeEventHandler
delegate: Sub AfterProcessChange(sender As BusinessProcessor, e As DeltaChangeEventArgs)

AfterProcessDelta

Occurs after a complete delta has been processed. A common use of this event could be to store information about the updates in a log table.

 

event AfterProcessDelta: DeltaEventHandler;
delegate: method AfterProcessDelta(sender: BusinessProcessor; e: DeltaEventArgs)

 

delegate DeltaEventHandler AfterProcessDelta()
delegate: void AfterProcessDelta(BusinessProcessor sender, DeltaEventArgs e)

 

Event AfterProcessDelta As DeltaEventHandler
delegate: Sub AfterProcessDelta(sender As BusinessProcessor, e As DeltaEventArgs)

AfterSqlGeneration

Occurs after the business processor auto generates the SQL text used to process a specific type of change (insert, delete or update). The parameters in the event arguments provide you with all the information you need to understand what type of SQL is being generated and, by modifying the SQLStatement property, allow you to replace the auto generated SQL. A common use of this event could be to track the SQL being executed and log it in a text file for debugging purposes.

 

event AfterSqlGeneration: SqlGenerationEventHandler;
delegate: method AfterSqlGeneration(sender: BusinessProcessor; e: SqlGenerationEventArgs)

 

delegate SqlGenerationEventHandler AfterSqlGeneration()
delegate: void AfterSqlGeneration(BusinessProcessor sender, SqlGenerationEventArgs e)

 

Event AfterSqlGeneration As SqlGenerationEventHandler
delegate: Sub AfterSqlGeneration(sender As BusinessProcessor, e As SqlGenerationEventArgs)

AssignChangeValuesToCommand  protected

Sets the command parameters values. Source values are taken from the provided DeltaChange instance.

 

method AssignChangeValuesToCommand(connection: IAbstractConnection; command: IDbCommand; mappings: ParamMappingCollection; delta: DeltaChange)

 

void AssignChangeValuesToCommand(IAbstractConnection connection, IDbCommand command, ParamMappingCollection mappings, DeltaChange delta)

 

Sub AssignChangeValuesToCommand(connection As IAbstractConnection, command As IDbCommand, mappings As ParamMappingCollection, delta As DeltaChange)

Parameters:

  • connection: Database connection
  • command: Database command
  • mappings: Parameter mapping
  • delta: DeltaChange instance that will provide parameter values

AutoGenerateDelete

Indicates if the SQL text for the delete command should be auto generated. If you want to use a specific SQL command defined in a Schema instead, set the DeleteCommandName property.

 

property AutoGenerateDelete: Boolean read write;

 

Boolean AutoGenerateDelete { get; set; }

 

Property AutoGenerateDelete() As Boolean

AutoGenerateInsert

Indicates if the SQL text for the insert command should be auto generated. If you want to use a specific SQL command defined in a Schema instead, set the InsertCommandName property.

 

property AutoGenerateInsert: Boolean read write;

 

Boolean AutoGenerateInsert { get; set; }

 

Property AutoGenerateInsert() As Boolean

AutoGenerateRefresh

Indicates if the SQL text for the refresh data table should be auto generated. If you want to use a specific data table defined in a Schema instead, set the RefreshDataTableName property.

 

property AutoGenerateRefresh: Boolean read write;

 

Boolean AutoGenerateRefresh { get; set; }

 

Property AutoGenerateRefresh() As Boolean

AutoGenerateUpdate

Indicates if the SQL text for the update command should be auto generated. If you want to use a specific SQL command defined in a Schema instead, set the UpdateCommandName property.

 

property AutoGenerateUpdate: Boolean read write;

 

Boolean AutoGenerateUpdate { get; set; }

 

Property AutoGenerateUpdate() As Boolean

BeforeExecuteCommand

 

event BeforeExecuteCommand: ExecuteCommandHandler;
delegate: method BeforeExecuteCommand(sender: BusinessProcessor; e: ExecuteCommandArgs)

 

delegate ExecuteCommandHandler BeforeExecuteCommand()
delegate: void BeforeExecuteCommand(BusinessProcessor sender, ExecuteCommandArgs e)

 

Event BeforeExecuteCommand As ExecuteCommandHandler
delegate: Sub BeforeExecuteCommand(sender As BusinessProcessor, e As ExecuteCommandArgs)

BeforeGetTableData

 

event BeforeGetTableData: BeforeGetTableDataEventHandler;
delegate: method BeforeGetTableData(sender: BusinessProcessor; e: BeforeGetTableDataEventArgs)

 

delegate BeforeGetTableDataEventHandler BeforeGetTableData()
delegate: void BeforeGetTableData(BusinessProcessor sender, BeforeGetTableDataEventArgs e)

 

Event BeforeGetTableData As BeforeGetTableDataEventHandler
delegate: Sub BeforeGetTableData(sender As BusinessProcessor, e As BeforeGetTableDataEventArgs)

BeforeProcessChange

Occurs before a delta change is about to be processed. A common use of this event could be to abort an update if the user sending the delta doesn't have enough privileges to do so. To abort the processing of a delta change, simply fire an exception in this event handler.

 

event BeforeProcessChange: DeltaChangeEventHandler;
delegate: method BeforeProcessChange(sender: BusinessProcessor; e: DeltaChangeEventArgs)

 

delegate DeltaChangeEventHandler BeforeProcessChange()
delegate: void BeforeProcessChange(BusinessProcessor sender, DeltaChangeEventArgs e)

 

Event BeforeProcessChange As DeltaChangeEventHandler
delegate: Sub BeforeProcessChange(sender As BusinessProcessor, e As DeltaChangeEventArgs)

BeforeProcessDelta

Occurs before a delta is about to be processed. A common use of this event could be to log information about the delta in a log table or to forbid a specific user to modify the data table referenced by the ReferencedDataTable property.

 

event BeforeProcessDelta: DeltaEventHandler;
delegate: method BeforeProcessDelta(sender: BusinessProcessor; e: DeltaEventArgs)

 

delegate DeltaEventHandler BeforeProcessDelta()
delegate: void BeforeProcessDelta(BusinessProcessor sender, DeltaEventArgs e)

 

Event BeforeProcessDelta As DeltaEventHandler
delegate: Sub BeforeProcessDelta(sender As BusinessProcessor, e As DeltaEventArgs)

CreateParameterMappings  protected

 

method CreateParameterMappings(connection: IAbstractConnection; table: SchemaDataTable; command: IDbCommand; parameters: SchemaParameterCollection; delta: Delta; fields: SchemaColumnMappingCollection): ParamMappingCollection

 

ParamMappingCollection CreateParameterMappings(IAbstractConnection connection, SchemaDataTable table, IDbCommand command, SchemaParameterCollection parameters, Delta delta, SchemaColumnMappingCollection fields)

 

Function CreateParameterMappings(connection As IAbstractConnection, table As SchemaDataTable, command As IDbCommand, parameters As SchemaParameterCollection, delta As Delta, fields As SchemaColumnMappingCollection) As ParamMappingCollection

Parameters:

  • connection:
  • table:
  • command:
  • parameters:
  • delta:
  • fields:

CreateRefreshCommand  protected

 

method CreateRefreshCommand(connection: IAbstractConnection; table: SchemaDataTable; updateMode: UpdateMode; fields: array of String; out parameters: SchemaParameterCollection): IDbCommand

 

IDbCommand CreateRefreshCommand(IAbstractConnection connection, SchemaDataTable table, UpdateMode updateMode, String[] fields, out SchemaParameterCollection parameters)

 

Function CreateRefreshCommand(connection As IAbstractConnection, table As SchemaDataTable, updateMode As UpdateMode, fields As String(), <OutAttribute> ByRef parameters As SchemaParameterCollection) As IDbCommand

Parameters:

  • connection:
  • table:
  • updateMode:
  • fields:
  • parameters:

CreateUpdateCommand  protected

 

method CreateUpdateCommand(connection: IAbstractConnection; table: SchemaDataTable; changeType: ChangeType; change: DeltaChange; updateMode: UpdateMode; columnMapping: SchemaColumnMappingCollection; out parameters: SchemaParameterCollection): IDbCommand

 

IDbCommand CreateUpdateCommand(IAbstractConnection connection, SchemaDataTable table, ChangeType changeType, DeltaChange change, UpdateMode updateMode, SchemaColumnMappingCollection columnMapping, out SchemaParameterCollection parameters)

 

Function CreateUpdateCommand(connection As IAbstractConnection, table As SchemaDataTable, changeType As ChangeType, change As DeltaChange, updateMode As UpdateMode, columnMapping As SchemaColumnMappingCollection, <OutAttribute> ByRef parameters As SchemaParameterCollection) As IDbCommand

Parameters:

  • connection:
  • table:
  • changeType:
  • change:
  • updateMode:
  • columnMapping:
  • parameters:

DeleteCommandName

Identifies the name of the Schema command to be be executed when applying the deletes of a delta.

 

property DeleteCommandName: String read write;

 

String DeleteCommandName { get; set; }

 

Property DeleteCommandName() As String

IgnoreAffectedRows

 

property IgnoreAffectedRows: Boolean read write;

 

Boolean IgnoreAffectedRows { get; set; }

 

Property IgnoreAffectedRows() As Boolean

InsertCommandName

Identifies the name of the schema command to be be executed when applying the inserts of a delta.

 

property InsertCommandName: String read write;

 

String InsertCommandName { get; set; }

 

Property InsertCommandName() As String

PrepareCommands

Indicates if the commands executed when processing delta changes should be prepared before being executed.

 

property PrepareCommands: Boolean read write;

 

Boolean PrepareCommands { get; set; }

 

Property PrepareCommands() As Boolean

ProcessDelta

 

method ProcessDelta(connection: IAbstractConnection; schema: ServiceSchema; delta: Delta; processInsert: Boolean; processUpdate: Boolean; processDelete: Boolean)

 

void ProcessDelta(IAbstractConnection connection, ServiceSchema schema, Delta delta, Boolean processInsert, Boolean processUpdate, Boolean processDelete)

 

Sub ProcessDelta(connection As IAbstractConnection, schema As ServiceSchema, delta As Delta, processInsert As Boolean, processUpdate As Boolean, processDelete As Boolean)

Parameters:

  • connection:
  • schema:
  • delta:
  • processInsert:
  • processUpdate:
  • processDelete:

ProcessError

Occurs anytime a delta change processing fails. The event arguments of this event contain information about the exception being raised and provide the opportunity to halt the whole delta processing or ignore it and continue.

 

event ProcessError: DeltaChangeErrorEventHandler;
delegate: method ProcessError(sender: Object; e: DeltaChangeErrorEventArgs)

 

delegate DeltaChangeErrorEventHandler ProcessError()
delegate: void ProcessError(Object sender, DeltaChangeErrorEventArgs e)

 

Event ProcessError As DeltaChangeErrorEventHandler
delegate: Sub ProcessError(sender As Object, e As DeltaChangeErrorEventArgs)

ReferencedDataTable

 

property ReferencedDataTable: String read write;

 

String ReferencedDataTable { get; set; }

 

Property ReferencedDataTable() As String

RefreshDataTableName

Identifies the name of the Schema data table to be used to re-read the values of a row after it has been inserted or updated.

 

property RefreshDataTableName: String read write;

 

String RefreshDataTableName { get; set; }

 

Property RefreshDataTableName() As String

remove_AfterExecuteCommand

 

method remove_AfterExecuteCommand(value: ExecuteCommandHandler)

 

void remove_AfterExecuteCommand(ExecuteCommandHandler value)

 

Sub remove_AfterExecuteCommand(value As ExecuteCommandHandler)

Parameters:

  • value:

remove_AfterProcessChange

 

method remove_AfterProcessChange(value: DeltaChangeEventHandler)

 

void remove_AfterProcessChange(DeltaChangeEventHandler value)

 

Sub remove_AfterProcessChange(value As DeltaChangeEventHandler)

Parameters:

  • value:

remove_AfterProcessDelta

 

method remove_AfterProcessDelta(value: DeltaEventHandler)

 

void remove_AfterProcessDelta(DeltaEventHandler value)

 

Sub remove_AfterProcessDelta(value As DeltaEventHandler)

Parameters:

  • value:

remove_AfterSqlGeneration

 

method remove_AfterSqlGeneration(value: SqlGenerationEventHandler)

 

void remove_AfterSqlGeneration(SqlGenerationEventHandler value)

 

Sub remove_AfterSqlGeneration(value As SqlGenerationEventHandler)

Parameters:

  • value:

remove_BeforeExecuteCommand

 

method remove_BeforeExecuteCommand(value: ExecuteCommandHandler)

 

void remove_BeforeExecuteCommand(ExecuteCommandHandler value)

 

Sub remove_BeforeExecuteCommand(value As ExecuteCommandHandler)

Parameters:

  • value:

remove_BeforeGetTableData

 

method remove_BeforeGetTableData(value: BeforeGetTableDataEventHandler)

 

void remove_BeforeGetTableData(BeforeGetTableDataEventHandler value)

 

Sub remove_BeforeGetTableData(value As BeforeGetTableDataEventHandler)

Parameters:

  • value:

remove_BeforeProcessChange

 

method remove_BeforeProcessChange(value: DeltaChangeEventHandler)

 

void remove_BeforeProcessChange(DeltaChangeEventHandler value)

 

Sub remove_BeforeProcessChange(value As DeltaChangeEventHandler)

Parameters:

  • value:

remove_BeforeProcessDelta

 

method remove_BeforeProcessDelta(value: DeltaEventHandler)

 

void remove_BeforeProcessDelta(DeltaEventHandler value)

 

Sub remove_BeforeProcessDelta(value As DeltaEventHandler)

Parameters:

  • value:

remove_ProcessError

 

method remove_ProcessError(value: DeltaChangeErrorEventHandler)

 

void remove_ProcessError(DeltaChangeErrorEventHandler value)

 

Sub remove_ProcessError(value As DeltaChangeErrorEventHandler)

Parameters:

  • value:

ServiceEvents

 

property ServiceEvents: IDataAbstractServiceEvents read write;

 

IDataAbstractServiceEvents ServiceEvents { get; set; }

 

Property ServiceEvents() As IDataAbstractServiceEvents

TriggerAfterExecuteCommand  protected

 

method TriggerAfterExecuteCommand(e: ExecuteCommandArgs)

 

void TriggerAfterExecuteCommand(ExecuteCommandArgs e)

 

Sub TriggerAfterExecuteCommand(e As ExecuteCommandArgs)

Parameters:

  • e:

TriggerAfterProcessChange  protected

 

method TriggerAfterProcessChange(e: DeltaChangeEventArgs)

 

void TriggerAfterProcessChange(DeltaChangeEventArgs e)

 

Sub TriggerAfterProcessChange(e As DeltaChangeEventArgs)

Parameters:

  • e:

TriggerAfterProcessDelta  protected

 

method TriggerAfterProcessDelta(e: DeltaEventArgs)

 

void TriggerAfterProcessDelta(DeltaEventArgs e)

 

Sub TriggerAfterProcessDelta(e As DeltaEventArgs)

Parameters:

  • e:

TriggerAfterSqlGeneration  protected

 

method TriggerAfterSqlGeneration(e: SqlGenerationEventArgs)

 

void TriggerAfterSqlGeneration(SqlGenerationEventArgs e)

 

Sub TriggerAfterSqlGeneration(e As SqlGenerationEventArgs)

Parameters:

  • e:

TriggerBeforeExecuteCommand  protected

 

method TriggerBeforeExecuteCommand(e: ExecuteCommandArgs)

 

void TriggerBeforeExecuteCommand(ExecuteCommandArgs e)

 

Sub TriggerBeforeExecuteCommand(e As ExecuteCommandArgs)

Parameters:

  • e:

TriggerBeforeProcessChange  protected

 

method TriggerBeforeProcessChange(e: DeltaChangeEventArgs)

 

void TriggerBeforeProcessChange(DeltaChangeEventArgs e)

 

Sub TriggerBeforeProcessChange(e As DeltaChangeEventArgs)

Parameters:

  • e:

TriggerBeforeProcessDelta  protected

 

method TriggerBeforeProcessDelta(e: DeltaEventArgs)

 

void TriggerBeforeProcessDelta(DeltaEventArgs e)

 

Sub TriggerBeforeProcessDelta(e As DeltaEventArgs)

Parameters:

  • e:

TriggerProcessError  protected

 

method TriggerProcessError(e: DeltaChangeErrorEventArgs)

 

void TriggerProcessError(DeltaChangeErrorEventArgs e)

 

Sub TriggerProcessError(e As DeltaChangeErrorEventArgs)

Parameters:

  • e:

UpdateCommandName

Identifies the name of the Schema command to be be executed when applying the updates of a delta.

 

property UpdateCommandName: String read write;

 

String UpdateCommandName { get; set; }

 

Property UpdateCommandName() As String

UpdateMode

Specifies how to locate records that are going to be affected by a delta change.

 

property UpdateMode: UpdateMode read write;

 

UpdateMode UpdateMode { get; set; }

 

Property UpdateMode() As UpdateMode

 

AutoGenerateDelete

Indicates if the SQL text for the delete command should be auto generated. If you want to use a specific SQL command defined in a Schema instead, set the DeleteCommandName property.

 

property AutoGenerateDelete: Boolean read write;

 

Boolean AutoGenerateDelete { get; set; }

 

Property AutoGenerateDelete() As Boolean

AutoGenerateInsert

Indicates if the SQL text for the insert command should be auto generated. If you want to use a specific SQL command defined in a Schema instead, set the InsertCommandName property.

 

property AutoGenerateInsert: Boolean read write;

 

Boolean AutoGenerateInsert { get; set; }

 

Property AutoGenerateInsert() As Boolean

AutoGenerateRefresh

Indicates if the SQL text for the refresh data table should be auto generated. If you want to use a specific data table defined in a Schema instead, set the RefreshDataTableName property.

 

property AutoGenerateRefresh: Boolean read write;

 

Boolean AutoGenerateRefresh { get; set; }

 

Property AutoGenerateRefresh() As Boolean

AutoGenerateUpdate

Indicates if the SQL text for the update command should be auto generated. If you want to use a specific SQL command defined in a Schema instead, set the UpdateCommandName property.

 

property AutoGenerateUpdate: Boolean read write;

 

Boolean AutoGenerateUpdate { get; set; }

 

Property AutoGenerateUpdate() As Boolean

DeleteCommandName

Identifies the name of the Schema command to be be executed when applying the deletes of a delta.

 

property DeleteCommandName: String read write;

 

String DeleteCommandName { get; set; }

 

Property DeleteCommandName() As String

IgnoreAffectedRows

 

property IgnoreAffectedRows: Boolean read write;

 

Boolean IgnoreAffectedRows { get; set; }

 

Property IgnoreAffectedRows() As Boolean

InsertCommandName

Identifies the name of the schema command to be be executed when applying the inserts of a delta.

 

property InsertCommandName: String read write;

 

String InsertCommandName { get; set; }

 

Property InsertCommandName() As String

PrepareCommands

Indicates if the commands executed when processing delta changes should be prepared before being executed.

 

property PrepareCommands: Boolean read write;

 

Boolean PrepareCommands { get; set; }

 

Property PrepareCommands() As Boolean

ReferencedDataTable

 

property ReferencedDataTable: String read write;

 

String ReferencedDataTable { get; set; }

 

Property ReferencedDataTable() As String

RefreshDataTableName

Identifies the name of the Schema data table to be used to re-read the values of a row after it has been inserted or updated.

 

property RefreshDataTableName: String read write;

 

String RefreshDataTableName { get; set; }

 

Property RefreshDataTableName() As String

ServiceEvents

 

property ServiceEvents: IDataAbstractServiceEvents read write;

 

IDataAbstractServiceEvents ServiceEvents { get; set; }

 

Property ServiceEvents() As IDataAbstractServiceEvents

UpdateCommandName

Identifies the name of the Schema command to be be executed when applying the updates of a delta.

 

property UpdateCommandName: String read write;

 

String UpdateCommandName { get; set; }

 

Property UpdateCommandName() As String

UpdateMode

Specifies how to locate records that are going to be affected by a delta change.

 

property UpdateMode: UpdateMode read write;

 

UpdateMode UpdateMode { get; set; }

 

Property UpdateMode() As UpdateMode

 

constructor

Creates a new instance of the BusinessProcessor class.

 

constructor

 

BusinessProcessor()

 

Sub New()

constructor (IContainer)

Creates a new instance of the BusinessProcessor class and adds it to the provided components container.

 

constructor(container: IContainer)

 

BusinessProcessor(IContainer container)

 

Sub New(container As IContainer)

Parameters:

  • container: Components container

add_AfterExecuteCommand

 

method add_AfterExecuteCommand(value: ExecuteCommandHandler)

 

void add_AfterExecuteCommand(ExecuteCommandHandler value)

 

Sub add_AfterExecuteCommand(value As ExecuteCommandHandler)

Parameters:

  • value:

add_AfterProcessChange

 

method add_AfterProcessChange(value: DeltaChangeEventHandler)

 

void add_AfterProcessChange(DeltaChangeEventHandler value)

 

Sub add_AfterProcessChange(value As DeltaChangeEventHandler)

Parameters:

  • value:

add_AfterProcessDelta

 

method add_AfterProcessDelta(value: DeltaEventHandler)

 

void add_AfterProcessDelta(DeltaEventHandler value)

 

Sub add_AfterProcessDelta(value As DeltaEventHandler)

Parameters:

  • value:

add_AfterSqlGeneration

 

method add_AfterSqlGeneration(value: SqlGenerationEventHandler)

 

void add_AfterSqlGeneration(SqlGenerationEventHandler value)

 

Sub add_AfterSqlGeneration(value As SqlGenerationEventHandler)

Parameters:

  • value:

add_BeforeExecuteCommand

 

method add_BeforeExecuteCommand(value: ExecuteCommandHandler)

 

void add_BeforeExecuteCommand(ExecuteCommandHandler value)

 

Sub add_BeforeExecuteCommand(value As ExecuteCommandHandler)

Parameters:

  • value:

add_BeforeGetTableData

 

method add_BeforeGetTableData(value: BeforeGetTableDataEventHandler)

 

void add_BeforeGetTableData(BeforeGetTableDataEventHandler value)

 

Sub add_BeforeGetTableData(value As BeforeGetTableDataEventHandler)

Parameters:

  • value:

add_BeforeProcessChange

 

method add_BeforeProcessChange(value: DeltaChangeEventHandler)

 

void add_BeforeProcessChange(DeltaChangeEventHandler value)

 

Sub add_BeforeProcessChange(value As DeltaChangeEventHandler)

Parameters:

  • value:

add_BeforeProcessDelta

 

method add_BeforeProcessDelta(value: DeltaEventHandler)

 

void add_BeforeProcessDelta(DeltaEventHandler value)

 

Sub add_BeforeProcessDelta(value As DeltaEventHandler)

Parameters:

  • value:

add_ProcessError

 

method add_ProcessError(value: DeltaChangeErrorEventHandler)

 

void add_ProcessError(DeltaChangeErrorEventHandler value)

 

Sub add_ProcessError(value As DeltaChangeErrorEventHandler)

Parameters:

  • value:

AssignChangeValuesToCommand  protected

Sets the command parameters values. Source values are taken from the provided DeltaChange instance.

 

method AssignChangeValuesToCommand(connection: IAbstractConnection; command: IDbCommand; mappings: ParamMappingCollection; delta: DeltaChange)

 

void AssignChangeValuesToCommand(IAbstractConnection connection, IDbCommand command, ParamMappingCollection mappings, DeltaChange delta)

 

Sub AssignChangeValuesToCommand(connection As IAbstractConnection, command As IDbCommand, mappings As ParamMappingCollection, delta As DeltaChange)

Parameters:

  • connection: Database connection
  • command: Database command
  • mappings: Parameter mapping
  • delta: DeltaChange instance that will provide parameter values

CreateParameterMappings  protected

 

method CreateParameterMappings(connection: IAbstractConnection; table: SchemaDataTable; command: IDbCommand; parameters: SchemaParameterCollection; delta: Delta; fields: SchemaColumnMappingCollection): ParamMappingCollection

 

ParamMappingCollection CreateParameterMappings(IAbstractConnection connection, SchemaDataTable table, IDbCommand command, SchemaParameterCollection parameters, Delta delta, SchemaColumnMappingCollection fields)

 

Function CreateParameterMappings(connection As IAbstractConnection, table As SchemaDataTable, command As IDbCommand, parameters As SchemaParameterCollection, delta As Delta, fields As SchemaColumnMappingCollection) As ParamMappingCollection

Parameters:

  • connection:
  • table:
  • command:
  • parameters:
  • delta:
  • fields:

CreateRefreshCommand  protected

 

method CreateRefreshCommand(connection: IAbstractConnection; table: SchemaDataTable; updateMode: UpdateMode; fields: array of String; out parameters: SchemaParameterCollection): IDbCommand

 

IDbCommand CreateRefreshCommand(IAbstractConnection connection, SchemaDataTable table, UpdateMode updateMode, String[] fields, out SchemaParameterCollection parameters)

 

Function CreateRefreshCommand(connection As IAbstractConnection, table As SchemaDataTable, updateMode As UpdateMode, fields As String(), <OutAttribute> ByRef parameters As SchemaParameterCollection) As IDbCommand

Parameters:

  • connection:
  • table:
  • updateMode:
  • fields:
  • parameters:

CreateUpdateCommand  protected

 

method CreateUpdateCommand(connection: IAbstractConnection; table: SchemaDataTable; changeType: ChangeType; change: DeltaChange; updateMode: UpdateMode; columnMapping: SchemaColumnMappingCollection; out parameters: SchemaParameterCollection): IDbCommand

 

IDbCommand CreateUpdateCommand(IAbstractConnection connection, SchemaDataTable table, ChangeType changeType, DeltaChange change, UpdateMode updateMode, SchemaColumnMappingCollection columnMapping, out SchemaParameterCollection parameters)

 

Function CreateUpdateCommand(connection As IAbstractConnection, table As SchemaDataTable, changeType As ChangeType, change As DeltaChange, updateMode As UpdateMode, columnMapping As SchemaColumnMappingCollection, <OutAttribute> ByRef parameters As SchemaParameterCollection) As IDbCommand

Parameters:

  • connection:
  • table:
  • changeType:
  • change:
  • updateMode:
  • columnMapping:
  • parameters:

ProcessDelta

 

method ProcessDelta(connection: IAbstractConnection; schema: ServiceSchema; delta: Delta; processInsert: Boolean; processUpdate: Boolean; processDelete: Boolean)

 

void ProcessDelta(IAbstractConnection connection, ServiceSchema schema, Delta delta, Boolean processInsert, Boolean processUpdate, Boolean processDelete)

 

Sub ProcessDelta(connection As IAbstractConnection, schema As ServiceSchema, delta As Delta, processInsert As Boolean, processUpdate As Boolean, processDelete As Boolean)

Parameters:

  • connection:
  • schema:
  • delta:
  • processInsert:
  • processUpdate:
  • processDelete:

remove_AfterExecuteCommand

 

method remove_AfterExecuteCommand(value: ExecuteCommandHandler)

 

void remove_AfterExecuteCommand(ExecuteCommandHandler value)

 

Sub remove_AfterExecuteCommand(value As ExecuteCommandHandler)

Parameters:

  • value:

remove_AfterProcessChange

 

method remove_AfterProcessChange(value: DeltaChangeEventHandler)

 

void remove_AfterProcessChange(DeltaChangeEventHandler value)

 

Sub remove_AfterProcessChange(value As DeltaChangeEventHandler)

Parameters:

  • value:

remove_AfterProcessDelta

 

method remove_AfterProcessDelta(value: DeltaEventHandler)

 

void remove_AfterProcessDelta(DeltaEventHandler value)

 

Sub remove_AfterProcessDelta(value As DeltaEventHandler)

Parameters:

  • value:

remove_AfterSqlGeneration

 

method remove_AfterSqlGeneration(value: SqlGenerationEventHandler)

 

void remove_AfterSqlGeneration(SqlGenerationEventHandler value)

 

Sub remove_AfterSqlGeneration(value As SqlGenerationEventHandler)

Parameters:

  • value:

remove_BeforeExecuteCommand

 

method remove_BeforeExecuteCommand(value: ExecuteCommandHandler)

 

void remove_BeforeExecuteCommand(ExecuteCommandHandler value)

 

Sub remove_BeforeExecuteCommand(value As ExecuteCommandHandler)

Parameters:

  • value:

remove_BeforeGetTableData

 

method remove_BeforeGetTableData(value: BeforeGetTableDataEventHandler)

 

void remove_BeforeGetTableData(BeforeGetTableDataEventHandler value)

 

Sub remove_BeforeGetTableData(value As BeforeGetTableDataEventHandler)

Parameters:

  • value:

remove_BeforeProcessChange

 

method remove_BeforeProcessChange(value: DeltaChangeEventHandler)

 

void remove_BeforeProcessChange(DeltaChangeEventHandler value)

 

Sub remove_BeforeProcessChange(value As DeltaChangeEventHandler)

Parameters:

  • value:

remove_BeforeProcessDelta

 

method remove_BeforeProcessDelta(value: DeltaEventHandler)

 

void remove_BeforeProcessDelta(DeltaEventHandler value)

 

Sub remove_BeforeProcessDelta(value As DeltaEventHandler)

Parameters:

  • value:

remove_ProcessError

 

method remove_ProcessError(value: DeltaChangeErrorEventHandler)

 

void remove_ProcessError(DeltaChangeErrorEventHandler value)

 

Sub remove_ProcessError(value As DeltaChangeErrorEventHandler)

Parameters:

  • value:

TriggerAfterExecuteCommand  protected

 

method TriggerAfterExecuteCommand(e: ExecuteCommandArgs)

 

void TriggerAfterExecuteCommand(ExecuteCommandArgs e)

 

Sub TriggerAfterExecuteCommand(e As ExecuteCommandArgs)

Parameters:

  • e:

TriggerAfterProcessChange  protected

 

method TriggerAfterProcessChange(e: DeltaChangeEventArgs)

 

void TriggerAfterProcessChange(DeltaChangeEventArgs e)

 

Sub TriggerAfterProcessChange(e As DeltaChangeEventArgs)

Parameters:

  • e:

TriggerAfterProcessDelta  protected

 

method TriggerAfterProcessDelta(e: DeltaEventArgs)

 

void TriggerAfterProcessDelta(DeltaEventArgs e)

 

Sub TriggerAfterProcessDelta(e As DeltaEventArgs)

Parameters:

  • e:

TriggerAfterSqlGeneration  protected

 

method TriggerAfterSqlGeneration(e: SqlGenerationEventArgs)

 

void TriggerAfterSqlGeneration(SqlGenerationEventArgs e)

 

Sub TriggerAfterSqlGeneration(e As SqlGenerationEventArgs)

Parameters:

  • e:

TriggerBeforeExecuteCommand  protected

 

method TriggerBeforeExecuteCommand(e: ExecuteCommandArgs)

 

void TriggerBeforeExecuteCommand(ExecuteCommandArgs e)

 

Sub TriggerBeforeExecuteCommand(e As ExecuteCommandArgs)

Parameters:

  • e:

TriggerBeforeProcessChange  protected

 

method TriggerBeforeProcessChange(e: DeltaChangeEventArgs)

 

void TriggerBeforeProcessChange(DeltaChangeEventArgs e)

 

Sub TriggerBeforeProcessChange(e As DeltaChangeEventArgs)

Parameters:

  • e:

TriggerBeforeProcessDelta  protected

 

method TriggerBeforeProcessDelta(e: DeltaEventArgs)

 

void TriggerBeforeProcessDelta(DeltaEventArgs e)

 

Sub TriggerBeforeProcessDelta(e As DeltaEventArgs)

Parameters:

  • e:

TriggerProcessError  protected

 

method TriggerProcessError(e: DeltaChangeErrorEventArgs)

 

void TriggerProcessError(DeltaChangeErrorEventArgs e)

 

Sub TriggerProcessError(e As DeltaChangeErrorEventArgs)

Parameters:

  • e:

 

AfterExecuteCommand

Fires after a command was executed.

 

event AfterExecuteCommand: ExecuteCommandHandler;
delegate: method AfterExecuteCommand(sender: BusinessProcessor; e: ExecuteCommandArgs)

 

delegate ExecuteCommandHandler AfterExecuteCommand()
delegate: void AfterExecuteCommand(BusinessProcessor sender, ExecuteCommandArgs e)

 

Event AfterExecuteCommand As ExecuteCommandHandler
delegate: Sub AfterExecuteCommand(sender As BusinessProcessor, e As ExecuteCommandArgs)

AfterProcessChange

Occurs after a delta change has been successfully processed. A common use of this event could be to store information about the updates in a log table.

 

event AfterProcessChange: DeltaChangeEventHandler;
delegate: method AfterProcessChange(sender: BusinessProcessor; e: DeltaChangeEventArgs)

 

delegate DeltaChangeEventHandler AfterProcessChange()
delegate: void AfterProcessChange(BusinessProcessor sender, DeltaChangeEventArgs e)

 

Event AfterProcessChange As DeltaChangeEventHandler
delegate: Sub AfterProcessChange(sender As BusinessProcessor, e As DeltaChangeEventArgs)

AfterProcessDelta

Occurs after a complete delta has been processed. A common use of this event could be to store information about the updates in a log table.

 

event AfterProcessDelta: DeltaEventHandler;
delegate: method AfterProcessDelta(sender: BusinessProcessor; e: DeltaEventArgs)

 

delegate DeltaEventHandler AfterProcessDelta()
delegate: void AfterProcessDelta(BusinessProcessor sender, DeltaEventArgs e)

 

Event AfterProcessDelta As DeltaEventHandler
delegate: Sub AfterProcessDelta(sender As BusinessProcessor, e As DeltaEventArgs)

AfterSqlGeneration

Occurs after the business processor auto generates the SQL text used to process a specific type of change (insert, delete or update). The parameters in the event arguments provide you with all the information you need to understand what type of SQL is being generated and, by modifying the SQLStatement property, allow you to replace the auto generated SQL. A common use of this event could be to track the SQL being executed and log it in a text file for debugging purposes.

 

event AfterSqlGeneration: SqlGenerationEventHandler;
delegate: method AfterSqlGeneration(sender: BusinessProcessor; e: SqlGenerationEventArgs)

 

delegate SqlGenerationEventHandler AfterSqlGeneration()
delegate: void AfterSqlGeneration(BusinessProcessor sender, SqlGenerationEventArgs e)

 

Event AfterSqlGeneration As SqlGenerationEventHandler
delegate: Sub AfterSqlGeneration(sender As BusinessProcessor, e As SqlGenerationEventArgs)

BeforeExecuteCommand

 

event BeforeExecuteCommand: ExecuteCommandHandler;
delegate: method BeforeExecuteCommand(sender: BusinessProcessor; e: ExecuteCommandArgs)

 

delegate ExecuteCommandHandler BeforeExecuteCommand()
delegate: void BeforeExecuteCommand(BusinessProcessor sender, ExecuteCommandArgs e)

 

Event BeforeExecuteCommand As ExecuteCommandHandler
delegate: Sub BeforeExecuteCommand(sender As BusinessProcessor, e As ExecuteCommandArgs)

BeforeGetTableData

 

event BeforeGetTableData: BeforeGetTableDataEventHandler;
delegate: method BeforeGetTableData(sender: BusinessProcessor; e: BeforeGetTableDataEventArgs)

 

delegate BeforeGetTableDataEventHandler BeforeGetTableData()
delegate: void BeforeGetTableData(BusinessProcessor sender, BeforeGetTableDataEventArgs e)

 

Event BeforeGetTableData As BeforeGetTableDataEventHandler
delegate: Sub BeforeGetTableData(sender As BusinessProcessor, e As BeforeGetTableDataEventArgs)

BeforeProcessChange

Occurs before a delta change is about to be processed. A common use of this event could be to abort an update if the user sending the delta doesn't have enough privileges to do so. To abort the processing of a delta change, simply fire an exception in this event handler.

 

event BeforeProcessChange: DeltaChangeEventHandler;
delegate: method BeforeProcessChange(sender: BusinessProcessor; e: DeltaChangeEventArgs)

 

delegate DeltaChangeEventHandler BeforeProcessChange()
delegate: void BeforeProcessChange(BusinessProcessor sender, DeltaChangeEventArgs e)

 

Event BeforeProcessChange As DeltaChangeEventHandler
delegate: Sub BeforeProcessChange(sender As BusinessProcessor, e As DeltaChangeEventArgs)

BeforeProcessDelta

Occurs before a delta is about to be processed. A common use of this event could be to log information about the delta in a log table or to forbid a specific user to modify the data table referenced by the ReferencedDataTable property.

 

event BeforeProcessDelta: DeltaEventHandler;
delegate: method BeforeProcessDelta(sender: BusinessProcessor; e: DeltaEventArgs)

 

delegate DeltaEventHandler BeforeProcessDelta()
delegate: void BeforeProcessDelta(BusinessProcessor sender, DeltaEventArgs e)

 

Event BeforeProcessDelta As DeltaEventHandler
delegate: Sub BeforeProcessDelta(sender As BusinessProcessor, e As DeltaEventArgs)

ProcessError

Occurs anytime a delta change processing fails. The event arguments of this event contain information about the exception being raised and provide the opportunity to halt the whole delta processing or ignore it and continue.

 

event ProcessError: DeltaChangeErrorEventHandler;
delegate: method ProcessError(sender: Object; e: DeltaChangeErrorEventArgs)

 

delegate DeltaChangeErrorEventHandler ProcessError()
delegate: void ProcessError(Object sender, DeltaChangeErrorEventArgs e)

 

Event ProcessError As DeltaChangeErrorEventHandler
delegate: Sub ProcessError(sender As Object, e As DeltaChangeErrorEventArgs)