Copying an Existing Template to Another Database
Workflow Manager 2020
If you want to copy an existing template to another instance of Workflow Manager, you can export the template to an external SQL Server script file, and then run that script against the other Workflow Manager database.
Tip:Another reason to export a workflow template to an external script file is to make a back-up copy of it, so that if it is accidentally deleted or modified, you would be able to quickly restore it.
Exporting a Template to an SQL Server Script
To export a workflow template to an SQL Server script, so that it can be copied to a different Workflow Manager database, perform the following steps:
To export an existing template to an external script:
|
1.
|
In the navigation bar, click Templates in the Administration menu. The Template Administration page opens. |
|
2.
|
Click Copy to open the Copy Template page. |
|
3.
|
Select the template you want to replicate from the Copy from list. |
|
4.
|
In the Copy to field, enter a name to uniquely identify the new template. |
|
5.
|
Select the SQL Script option from the Target field. The Enter the Filename text field is displayed. |
|
6.
|
Enter a name for the SQL script file you are exporting to in the Enter the Filename text field, without specifying an extension. Script files will always be saved with an .sql extension. |
|
7.
|
Because you are copying this workflow template to another database, it is recommended that you clear the selection of the Copy role permissions and Copy notifications options. When these options are not selected, the default permission settings of the Workflow Manager database that you are copying the workflow template to will be assigned. |
|
8.
|
Click Copy. Your browser will prompt you to open or save the script file. Save your script file to an appropriate location on your local machine. |
|
9.
|
When the file download is complete, click Cancel on the Copy Template page to return to the Template Administration page. |
Running a Template Script Against a Database
To copy an exported template to a different Workflow Manager database (or to recreate the template in the original database, if it got modified or removed accidentally), do the following:
To run a template script against a Workflow Manager database:
|
2.
|
Copy the script file to a location accessible to the Workflow Manager database that you want to copy the template into. |
|
3.
|
If you are running the script file against a different instance of Workflow Manager than the one it was exported from, perform the following steps: |
|
a.
|
Open the script file in a text editor. |
|
b.
|
Locate the @updatedBy parameter, which identifies the person that created the workflow. It will appear in a line similar to the following: |
set @updatedBy = '7b31351c-f90c-4966-a61b-4d4626d86037'
|
c.
|
Replace the identifier with the PersonID value from the AMS_Person table which represents your account (or the account of the person who you want to be registered as the creator of the template). |
|
d.
|
Locate the @servicerCompanyID parameter, which identifies the workflow administrator company that you want this template to be associated with. It will appear in a line similar to the following: |
set @servicerCompanyID = '7fa01539-9fb6-4a68-a749-f71f92276869'
|
e.
|
Replace the identifier with the servicerCompanyID of the desired workflow administrator company from the AMS_Company table. |
CautionIf you do not update these parameters, you will receive an error message when you run the script and the import will fail.
|
4.
|
Use an appropriate database utility to run the script against the Workflow Manager database. |
|
5.
|
When you open Workflow Manager, the imported template will be listed on the Template Administration page. |
See Also
Copying an Existing Template
Copying a Template