Command Line Deployment Example

<< Click to Display Table of Contents >>

Navigation:  Bizagi Engine > Bizagi system administration > Deployment of processes and new versions > Command Line Deployment >

Command Line Deployment Example

Overview

Bizagi presents the Command Line as an alternative to the One-click Deployment in Bizagi Studio, to perform Deployments of Processes in specific scenarios having sophisticated requirements.

For more information about the One-click Deployment which assists this process (automatically deploying process packages), refer to Deploying your processes.

For more information about its description and user interface, refer to the Advanced Deployment.

 

In this section we illustrate an example of the Command Line deployment used to deploy your Bizagi processes into a production environment.

The example will deploy the Help Desk process available from our Process Xchange using a SQL Server database.

 

Setting up the Command Line Deployment

To set up the Deployment, note that it provides 3 different executable files (1 of them is to be used in the Development environment, and the other 2 in a machine where there is access to the target environment's Database (i.e a machine with access to a Production environment, which may not be within the Development environment's network).

 

To set it up, carry out these steps:

 

1. Make sure you locate the Deployment executable files.

The Deployment executable files are located at the Management Console folder (at Bizagi's default installation path, which is usually at C:\Program Files\Bizagi\Bizagi Studio\MC).

 

2. Make sure you copy this folder whole content in a machine which has network access to your target environment database (where you will deploy).

There are no further installation steps required.

Notice that this means you will likely create a duplicate of this folder in a machine that has access to your Production database (in case that you don't have a common machine that has network access to both Development and Production).

 

3. Configure the CreateDatabase.exe only for your initial deployment.

 

note_pin

Only in case you are performing a first Deployment to your Test or Production environment (the target Database does not exist), then you will need to run an additional executable file in this folder called CreateDatabase.exe.

To do this, configure the CreateDatabase.exe.config with the connection detail of the Database you wish to create.

This Database will be created as a blank Bizagi project, and set to be a Test or Production Database.

 

Keep in mind that:

If the new Database is in SQL Server, your instance should have an explicit predefined TCP/IP port.

For more information about SQL Server requirements and configuration, refer to SQL Server Configuration.

If the new Database is in Oracle, you need to have previously created the BizagiAdmon user and consider that the password you set for your new Database, must be the same one used by the BizagiAdmon user.

For more information about Oracle requirements and preconfiguration, refer to Creating a project using Oracle.

 

Preparation for the Command Line Deployment

Creating the Export package (.bex file) is always the first step in using the Command Line Deployment, as this file will contain the changes we want to take from a Development environment and into our target environment.

 

Therefore, before you begin the exportation of the Processes and their objects, ensure that these conditions are met so that the file contains the proper information:

 

1. All changes in the development environment must have been saved. At this point, you should know which Processes (and Sub-Processes) you want to deploy, and any team members working in Bizagi Studio must ensure that they have checked in these Processes.

 

2. Data and configuration managed directly in the Production environment should be taken into account.

For data, it is really important to handle the Parameter entities values, so that you can review and tell which Parameter entities values should be updated into the target environment.

In addition to this and in general, it is strongly recommended to be completely sure about what will be included in the Deployment (including: security settings, interfaces and external systems configuration, environment parameters, etc).

 

For more information about these subjects, refer to the Previous considerations and requirements for a Deployment.

 

Using the Command Line Deployment

Using the Command Line Deployment is divided into 2 major tasks: First running the Export utility to generate the package with the information to be deployed, and then using the other utilities at the target environment (Test, Production) to apply the deployment package.

 

As explained before in Command Line Deployment, for sending the parameters to the executable files, you may choose to configure a configuration file or you may send each parameter separately. For the example of this article, we will use the configuration file for the Export procedure and we will send parameters for the Import procedure. Disregard the option you want to use, you may use .bat files in order to automate the procedure, for more examples of these .bat files, refer to Export configuration templates.

 

Using the Export at the Development environment

1. Configure the file Export.exe.config  with the connection detail of your development's database, locate the DSNDB and the PROVIDERTYPE key as described at Advanced Deployment.

 

2. Run Export.exe.

Its window will show the following options:

 

Export01

 

Option- number in the image above

Description

1

Shows the Project's Database name and its Database Server.

This should refer to your Development environment.

2

Lists the applications in our project.

3

Lists the Processes (and Sub-Processes) per application which can be selected.

4

Shows the versions of our Processes which can be selected for export. By right-clicking a version, the option to manually include dependencies appears.

5

Sets the project to use Advanced Deployment Tools only. Please, be aware of using this option, this can not be undone.

6

Allows to configure the exportation options.

7

Creates the export file (.bex).

8

Allows you to relate Experience objects such as searches, relevant options, actions, triggers and contexts defined for any entities.

9

Presents revision of the information contained in the export file.

10

Load bex file

Shows the content of a previously created export file.

Save edited package

Saves the changes in a previously created export file.

11

Save

Exports the information configured in a JSON file. This option ease the creation of the configuration file for Export procedure.

Load

Imports the information configured in a JSON file.

 

2. Mark the Processes, Sub-Processes and experience components you wish to deploy.

Notice there is a special option at the version's right-click if you with to include parameter entities, master entities, query forms and business rules; in order to force some objects into the Deployment package.

To view more information about how this option works, refer to Relate objects.

 

Export02

 

 

If you have defined experience components select the Experience tab and make sure all components are related.

In this case, consider we only want to deploy all experience components for the Stakeholder called Call Center Agent and the actions associated to the Ticket Activities entity from the Help Desk process.

 

experience_components6

 

Each item listed will require the following components to be deployed:

Relevant to me options: Update Customer information and Register New Ticket.

 

advanced_components_3

 

Relevant to me options are process shortcuts. Therefore the process it launches must be related individually when deploying.

 

experience_components2

 

experience_components7

 

Since the shortcut is dependent from a context, make sure it is selected for deployment as well.

 

experience_components8

 

Search: Cases

 

experience_components9

 

This is a search, thus we need to take into account the stakeholder entity from which the search is available, the entity to perform the search and the contexts where it is available.

 

experience_components10

 

oThe search form is automatically deployed along with the searched entity.

oThe stakeholder from which the search is available is automatically considered when the search is selected.

oThe context related had been selected previously.

 

experience_components11

 

Actions: Register Activity / Solve ticket and Escalate Ticket

 

experience_components12

 

Depending on the sort of action, different components and objects are related, in this case Register Activity / Solve ticket and Escalate Ticket are form actions. Therefore, the related objects are:

 

oThe entity where the action is defined, this will also deploy the related form. Since we are ticking the activity, this will automatically deploy the entity associated.

 

experience_components13

 

oEvery related context. In this case, the action Register Activity / Solve ticket is always available for the Help Desk Agent stakeholder, and is only available under the Not Last Service Level context of the Help Desk Agent stakeholder.

 

experience_components14

 

oThe processes where the action can be launched from.

 

experience_components15

 

This way all experience components of the Call Center Agent are now ready to be deployed. For further information about relating objects and experience components, please review Relate Objects article.

 

Once selected, click Set Advanced Import - Export in order to specify that this project is now an advanced deployment only project. A warning message will make you aware of this action as this can not be undone.

 

Export04

 

3. Export the configuration options by clicking the Save option located in the Settings menu.

 

experience_components16

 

4. Select the path where you want to save the JSON file; for example purposes, the file will be saved at Management Console folder.

 

experience_components17

 

5. Edit the configuration file using the text editor of your choice and add the connection detail of your development's database at the begging of the file as explained in Command Line Deployment.

 

CLD_config

 

6. Open a Command Prompt window en navigate to Bizagi's default installation path, which is usually at C:\Program Files\Bizagi\Bizagi Studio\MC.

 

7. As mentioned before, the configuration file was saved in this folder named as ExportSettings.json. Run the Export,exe file using the following command:

 

Export.exe --Outputfile "Export1.bex" --Config "ExportSettings.json" --Log "log.txt" --ErrorLogger "Errors.txt"

 

Deployment12_ExportCL

 

8. Once the log shows that the file was exported, close the Command Prompt window.

 

Deployment13_ExportCL

 

note_pin

You may add the command explained here using a .bat file in order to enable the execution by running the given file. This will let you run the Export process easier. Review an example in Export configuration templates.

It is strongly recommended to encrypt the Database password using Password Encryption feature from the Work Portal or from the Deployment Miscellaneous.

If any error is shown, you will need to adjust it in your source environment (Development), and repeat the export until it is successful.

 

 

Using the Import utilities at the target environment

Before running the Import utilities, make sure that your target Database exists.

If this is a first Deployment to the Test environment, or the first one to the Production environment, use the CreateDatabase.exe utility to create a new and blank Bizagi Database for that environment.

Once you have ensured this, remember to take backups of your target environment, and proceed with these steps:

 

As mentioned before, we are running the CreateImport.exe by sending all their parameters.

 

1.  Open a Command Prompt window en navigate to Bizagi's default installation path, which is usually at C:\Program Files\Bizagi\Bizagi Studio\MC.

 

2. As mentioned before, this example will deploy the Help Desk process using a SQL Server database. Run the CreateImport.exe file using the following command:

 

CreateImport.exe --DSNDB "Persist Security Info=True;User ID=[DBUser];Password=sa;Data Source=[DBServer];Initial Catalog=[DBName];" --Provider MSSqlClient --FilePath Export1.bex --Log logImport.txt --ErrorLogger ErrorImport.txt

 

Deployment14_ImportCL

 

3. Once the log shows that the file was imported, close the Command Prompt window.

 

Deployment15_ImportCL

 

note_pin

If your process uses Oracle Database, perform the according changes.

You may add the command explained here using a .bat file in order to enable the execution by running the given file. This will let you run the Import process easier. Review an example in Export configuration templates.

It is strongly recommended to encrypt the Database password using Password Encryption feature from the Work Portal or from the Deployment Miscellaneous.

If any error is shown, you will need to adjust it in your source environment (Development), and repeat the import until it is successful.

 

What is next?

After you have deployed your Processes into a test or production database, make sure you reload changes in Bizagi.

When having processes run in a .NET platform, this means restarting the services of your IIS so that the Work Portal is reloaded with the changes.