All product information in wiki.bizagi.com is only valid for Bizagi BPM Suite 9.1.X.
For newer Bizagi BPM Suite versions (10.X and up) please visit the User Guide.
 

How to Create a Custom Virtualization Library

From Business Process Management, BPM and Workflow Automation Wiki | BizAgi BPMS

Jump to: navigation, search

<keywords content="keywords"> virtual library, entity library </keywords>

Applies to ENTERPRISE .NET EDITION

Contents

How to Create a Custom Virtualization Library

To virtualize data sources other than MSSQL or Oracle, it is necessary to write an assembly that implements the IProviderVirtualDA and IEntityVirtualDA interfaces. Bizagi separates the operations for connection, disconnection and transactional management from the operations to insert, update and query the data sources in the Provider and Entity interfaces.

Provider Interface IProviderVirtualDA

The class that implements this interface must contain the following methods:

Image:Bulletrojo.gif void Init (HybridDictionary htMetadata): In charge of taking the data supplied in the system configuration, such as server name, database name, user, password, etc. It receives a HybridDictionary object that contains the data configured as system metadata.


Image:Bulletrojo.gif void OpenConnection(): This method is used to make the connection with the external system. In the case of a database, this is where you build the connection links and open a connection with the repository.


Image:Bulletrojo.gif void CloseConnection(): In charge of closing the connection with the external system.


Image:Bulletrojo.gif void BeginTransaction(): In charge of initiating a new transaction for the current operation in the system.


Image:Bulletrojo.gif void Commit(): Commits the current transaction in the reference system.


Image:Bulletrojo.gif void Rollback(): Carries out rollback of the current transaction in the reference system.

Entity Interface IEntityVirtualDA

The class that implements this interface must contain the logic necessary to manipulate the virtualized data, such as inserting a new record, consulting within a group of records and updating and deleting a registry. The methods that the class must contain are listed below:

Image:Bulletrojo.gif void Init(IProviderVirtualDA objProvider, HybridDictionary htMetadata): Initializes the connection with the system. The parameters required to establish the connection with the system are carried on in this method.

PARAMETERS

Image:Bulletazul.gif objProvider: Allows the conversion toward the object that implements the IProviderVirtualDA interface.

Image:Bulletazul.gif htMetadata: Contains the information required as metadata to establish the connection with the configured system.


Image:Bulletrojo.gif DataSet GetEntityInstance(string sEntSource, string[] arrsKeyColumns, object[] arroKeyValues, string[] arrsColList): Takes data from entity instances (values) from the corresponding table for a specific ID.

PARAMETERS

Image:Bulletazul.gif sEntSource: Table where the entity is implemented

Image:Bulletazul.gif arrsKeyColumns: An array that contains the names of the columns used to filter the record.

Image:Bulletazul.gif arroKeyValues: Array that contains the values to be used as a filter for a search of the record.

Image:Bulletazul.gif arrsColList: Array that contains the name of the columns to be consulted.

RETURNS - DataSet with the values of the entity.


Image:Bulletrojo.gif DataSet GetEntityInstancesTable(string sEntSource, string[] arrsKeyColumns, string[] arrsColList, string sFilterText, bool bFillSchema, int iTopReturnRows)

PARAMETERS

Image:Bulletazul.gif sEntSource: Table where the entity is located.

Image:Bulletazul.gif arrsKeyColumns: Array of columns used as keys.

Image:Bulletazul.gif arrsColList: Columns to be included on the list.

Image:Bulletazul.gif sFilterText: Filter to be applied in search of entities in the WHERE clause.

Image:Bulletazul.gif bFillSchema: True if the information from the schema is to be returned from the database, False otherwise.

Image:Bulletazul.gif iTopReturnRows: Number of registers to be returned.

RETURNS - DataSet with the values of the entity.


Image:Bulletrojo.gif object GetAttributeValue(string sEntSource, string[] arrsKeyColumns, object[] arroKeyValues, string sAttrSource)

PARAMETERS

Image:Bulletazul.gif sEntSource: Table where the entity is implemented.

Image:Bulletazul.gif arrsKeyColumns: Array of columns used as keys.

Image:Bulletazul.gif arroKeyValues: Values of the columns used as keys.

Image:Bulletazul.gif sAttrSource: Column of values to return.

RETURNS - Value of the attribute.


Image:Bulletrojo.gif bool ExistsEntityInstance(string sEntSource, string[] arrsKeyColumns, object[] arroKeyValues)

PARAMETERS

Image:Bulletazul.gif sEntSource: Table where the entity is implemented.

Image:Bulletazul.gif arrsKeyColumns: Array of columns used as key.

Image:Bulletazul.gif arroKeyValues: Value of columns used as key.

RETURNS - True if the instance was found, False otherwise.


Image:Bulletrojo.gif int ExistsEntityInstance(string sEntSource, string sColumn, object oValue, string[] arrsKeyColumns, object[] arroKeyValues)

PARAMETERS

Image:Bulletazul.gif sEntSource: Table where the entity is implemented.

Image:Bulletazul.gif sColumn: Column used to find the instance.

Image:Bulletazul.gif oValue: Value used to find the instance.

Image:Bulletazul.gif arrsKeyColumns: Array of columns used as key.

Image:Bulletazul.gif arroKeyValues: Array of values used as key.

RETURNS - 1 if the instance was found, 0 if not.


Image:Bulletrojo.gif Hashtable AddEntity(string sEntSource, Hashtable htAddCols, string[] arrsKeyColumns, object[] arroKeyValues, string[] arrsAutoColumns): Adds a new instance (values) to the database

PARAMETERS

Image:Bulletazul.gif sEntSource: Table where the entity is implemented.

Image:Bulletazul.gif htAddCols: List of columns to add to values.

Image:Bulletazul.gif arrsKeyColumns: Array of columns used as keys.

Image:Bulletazul.gif arroKeyValues: Array of values used as keys.

Image:Bulletazul.gif arrsAutoColumns: Array of auto-numeric columns.

RETURNS - a HashTable that contains the name of the column and the value that was inserted.


Image:Bulletrojo.gif Hashtable UpdateEntity(string sEntSource, string[] arrsKeyColumns, object[] arroKeyValues, Hashtable htUpdateCols, string[] arrsAutoColumns): Updates the data of an instance of the entity (values) in the database and records the update.

PARAMETERS

Image:Bulletazul.gif sEntSource: Table where the entity is implemented.

Image:Bulletazul.gif arrsKeyColumns: Array of columns used as key.

Image:Bulletazul.gif arroKeyValues: Value of columns used as key.

Image:Bulletazul.gif htUpdateCols: List of columns to be updated, with values.

Image:Bulletazul.gif arrsAutoColumns: Array of auto-numeric columns.

RETURNS - HashTable that contains the name of the column and the value that was inserted.


Image:Bulletrojo.gif bool DeleteEntity(string sEntSource, string[] arrsKeyColumns, object[] arroKeyValues): Deletes a record from the database.

PARAMETERS

Image:Bulletazul.gif sEntSource: Table where the entity is implemented.

Image:Bulletazul.gif arrsKeyColumns: Array of columns used as key.

Image:Bulletazul.gif arroKeyValues: Value of columns used as key.

RETURNS - True if the record was deleted, False otherwise.


Examples

<comments />