<< Click to Display Table of Contents >> Data Synchronization Using Deployment by Commands
|
Overview
In previous articles, it was explained how to export and import data in Bizagi Studio using the Management Console. This section covers the necessary configuration and the steps required to do it through deployment by commands.
Parameters
The parameter values needed for data synchronization using deployment by commands can be assigned by console or by means of a configuration file. These parameters are described below:
•Runtype: Feature that is automated.
•Log: Path of the text file that logs the execution messages.
•ErrorLogger: Path of the text file that records the error details.
•DSNDB: DB connection where the command is applied. For Export it is the source DB and for Import it is the destination DB.
•Provider: DB connection provider (Oracle/MSSQLClient).
•FilePath: Name of the .bdex file to import. It applies only for the ImportSyncData.
•outputPath: Path and name of the file .bdex that is generated. It applies only for the ExportSyncData.
•overrideTargetResources (true/false): It indicates if the resources must be overwritten in the database where the import is made. It applies only for the ImportSyncData.
•replaceUsers (true/false): It indicates if the users should be overwritten in the database where the import is done. It applies only for the ImportSyncData.
•entityTables: Entity tables exported.
•tableName: Name of the Entity.
•displayName: Visual name of the entity.
•selected (true/false): Flag that indicates if the entity is selected or not for the export.
•entityKeysSource: Object that contains information about the columns/attributes of the entity.
•columnName: Name of the column/attribute.
•displayName: Display name of the attribute.
•selected (true/false): Flag that indicates if the attribute is selected or not to export.
•isBusinessKey (true/false): The user must indicate if this attribute belongs to any BusinessKey configured for the entity.
•isDisplayAttrib (true/false): The user must indicate if the attribute is the visual attribute of the entity.
•userTables: Tables related to the WFUSER entity to be imported. It applies only for the ExportSyncData.
•tableName: The name of the related entity if the relationship is many-to-many (BAUSERGROUPUSER,USERORG,USERPOSITION,USERROLE,USERSKILL) or the name of the related field if the relationship is a related attribute (idArea, idTimeZone, language, idLocation, idWorkingTimeSchema).
•displayName: Display name of the entity or attribute.
•selected (true/false): The user must indicate if the attribute is selected or not to export.
•isTable (true/false): It is true if the relationship with the WFUSER entity is many-to-many (BAUSERGROUPUSER,USERORG,USERPOSITION,USERROLE,USERSKILL) or false if the relationship is a related attribute (idArea, idTimeZone, language, idLocation, idWorkingTimeSchema).
Export Data
From Deployment by Commands, you can run the ExportSyncData function using the Management Console. This generates a .bdex package that exports the data.
For this method, the parameter values can be assigned by console or by means of a configuration file (config.json), so that they are equivalent, as shown in the following example:
*BizagiAutomation.exe –runtype ExportSyncData –DSNDB “Persist Security Info=True;User ID=user;Password=pass;Data Source=SERVER;Initial Catalog=initialCatalog;” –Provider “MSSqlClient” –outputPath “pathtofile” –entityTables “jsonEntityTables” –Log log.txt –ErrorLogger error.txt
ó
BizagiAutomation.exe –runtype ExportSyncData –config config.json
Config.json content
{
"runtype": "ImportSyncData",
"DSNDB": "Persist Security Info=True;User ID=sa;Password=sa;Data Source=localhost\\sqlexpress;Initial Catalog=databaseName;",
"Provider": "MSSqlClient",
"Environment": "Test",
"FilePath": "file.bdex",
"Log": "log.txt",
"ErrorLogger": "error.txt",
"overrideTargetResources": false,
"replaceUsers": true,
"entityTables": [
{
"tableName": "Entity Name 1",
"displayName": "Entity display Name 1",
"entityKeysSource": [
{
"columnName": "Column Name 1",
"displayName": "Column Display Name 1",
"selected": true,
"isBusinessKey": false,
"isDisplayAttrib": true
},
{
"columnName": "Columns Name 2",
"displayName": "Columns Display Name 2",
"selected": false,
"isBusinessKey": false,
"isDisplayAttrib": false
}
],
"selected": true,
"isTable": true,
"isInTarget": true,
"selectedUI": false
},
{
"displayName": "Entity Display Name 2 ",
"selected": true,
"selectedUI": true,
"tableName": "Entity Name 2"
}
]
}
Import Data
From Deployment by Commands, you can run the ImportSyncData function using the Management Console. This generates a .bdex package that imports the data.
For this method, the parameter values can be assigned by console or by means of a configuration file (config.json), so that they are equivalent, as shown in the following example:
*BizagiAutomation.exe –runtype ImportSyncData –DSNDB “Persist Security Info=True;User ID=user;Password=pass;Data Source=SERVER;Initial Catalog=initialCatalog;” –Provider “MSSqlClient” –FilePath “pathtofile” –entityTables “jsonEntityTables” –userTables “jsonUserTables” –overrideTargetResources “true” –replaceUsers “true” –Log log.txt –ErrorLogger error.txt
ó
BizagiAutomation.exe –runtype ImportSyncData –config config.json
Config.json content
{
"runtype": "ImportSyncData",
"DSNDB": "Persist Security Info=True;User ID=sa;Password=sa;Data Source=localhost\\sqlexpress;Initial Catalog=databaseName;",
"Provider": "MSSqlClient",
"Environment": "Test",
"FilePath": "file.bdex",
"Log": "log.txt",
"ErrorLogger": "error.txt",
"overrideTargetResources": false,
"replaceUsers": true,
"entityTables": [
{
"tableName": "Entity Name 1",
"displayName": "Entity display Name 1",
"entityKeysSource": [
{
"columnName": "Column Name 1",
"displayName": "Column Display Name 1",
"selected": true,
"isBusinessKey": false,
"isDisplayAttrib": true
},
{
"columnName": "Columns Name 2",
"displayName": "Columns Display Name 2",
"selected": false,
"isBusinessKey": false,
"isDisplayAttrib": false
}
],
"selected": true,
"isTable": true,
"isInTarget": true,
"selectedUI": false
},
{
"displayName": "Entity Display Name 2 ",
"selected": true,
"selectedUI": true,
"tableName": "Entity Name 2"
}
]
}