Synchronizing by using Ant tasks

You can use a Decision Center Ant task to synchronize your projects.

With Ant tasks, you can automate the publishing and updating of projects.

Use the following code to synchronize with Ant tasks:


ant synchronize -Ddata=<C:/workspace> -DprojectName=<Project name> -Daction=<publish|retrieve|disconnect>
[-Doverride=true|false] [-Dselector=query] [-Dbranch=branch]

The following example shows how to publish a branch (MyBranch) in a project (MyProject) from your workspace by using Ant:


ant synchronize -Ddata=C:/workspace -DprojectName=MyProject -Daction=publish
-Doverride=true -Dbranch=MyBranch

MyProject must be contained in a folder with the same name within the workspace.

The following example shows how to publish a branch (MyRelease) in a decision service (main project = MyService) from your workspace by using Ant:

ant synchronize -Ddata=C:/workspace -DprojectName=MyService -Daction=publish
-Doverride=true -Dbranch=MyRelease -DuseDgf=true

MyService is the main project of your decision service.

Note: You cannot use this Ant task to publish a new standard project to Decision Center. You can only do this operation in Rule Designer.

The following table describes the parameters that you can specify.

Table shows parameters for Ant synchronization.
Parameter Description
useDgf Specifies whether to publish a project using the decision governance framework. The default value is false.
data [workspace location] Specifies the workspace location
project [projectName] Name of the project to synchronize. The project must be contained in a folder with the same name within the workspace location.
action Synchronize by publishing to Decision Center, retrieving from Decision Center, or disconnecting from Decision Center. Use only one of the following actions for each command:
  • publish
  • retrieve
  • disconnect
override (Optional) Specifies whether the publish or retrieve action overrides existing conflicts between Decision Center and Decision Server. The default value is false.

Synchronization that uses Ant tasks does not override potential conflicts unless you set the -Doverride option.

overrideAll (Optional) Specifies whether the publish or retrieve action overrides all the changes. After the publish or retrieve action, when the overrideAll parameter is used, the content of the target matches the content of the source. The default value is false.
selector [query] (Optional) BQL query to select rules to be synchronized.
Note: You cannot use queries for Event projects.
branch (Optional) The branch of the project. If this parameter is left empty, the main branch (sometimes called the current branch) is synchronized. (Optional)
Tip:

If you encounter problems, or need more details about the Ant task being run, try running the task with the option -v or -verbose. For full details, add the option -d or -debug. For more information about available options, see the Apache Ant External link opens a new window or tab user manual.