◷ Reading Time: 10 minutes
Introduction
Publishing allows you to bundle your logic documents for deployment as a set of files and folders or as a single zip package. Decision Modules are bundles of your business logic that are used to publish a set of logic. A Decision Module contains all of the logic required to support a specific scenario:
- Flow
- Procedure
- Validation
- Decision Table
- Natural Language
- Decision Graph (i.e. Decision model and Notation, DRD)
To add a new profile to publish,
Document Types --> Utilities --> Publish Profile

Once you add a document, this will be the window.

Publish Profile Properties
When the Profile node is selected in the tree, you can see the following in the Properties window

- Display Title: Each Decision Module may have a display title that can be set using this property.
- Name: This is the actual name of the published decision module. This name cannot be changed and is the identifier of the decision to be executed.
- Destination: This is the address to which the linked files and areas will be pushed.
- Entry Uri: Name of the file that should run first (If there are multiple files, this is the main flow file).
- Base: The base folder, which is where your rule project files are located.
- Type:
- ZipPackage: Create a package zipped in one package file
- Directory: Create separate folders inside given Destination
- Inclusions: File types to be added. Add multiple extensions separated by commas
,
- Exclusions: File types to be removed from the package. Add multiple extensions separated by commas
,
- Version: Package and service versions
- Identifier: Package name
Toolbox
The toolbox has the following items.

Top Menu
At the top menu, you can see the following items.

- Move down the selected node: Move a node
- Move up the selected node: Move a node up
- Delete selected node: Delete a node
- Show properties of node: Show properties of a node
- Expand tree: Show more of a tree node
- Collapse tree: Show less of a tree node
Node Properties
If you click on a node, its property window will appear. The properties vary depending on the node type.

Create and Publish a Publish Profile
Create a Publish Profile
To create a tree, drag and drop Area and Files from the Toolbox or Rule Project explorer.

1. Select the command (Area) from the toolbox

2. Drag the Area under the publish node

3. Drop the Area (release your mouse button)
And then you can do the same for “File” and set the “Source” property of the file. Or you can simply drag and drop from your rule project explorer.

1. Select the file from the project explorer

2. Drag it under the appropriate Area node

3. Drop the file (release your mouse button)
When you are linking a logic file (file in your project explorer) using the drag and drop technique, it automatically creates a File node under the Area. You don’t need to add File from the toolbox first.
Publish Mode
You have the option to deploy the profile as:
- Hierarchically nested folder structure
- The single decision module file
Check the Type property of your profile to set this behavior.
Adding Assemblies
Assemblies should reside the root of the package when a package is built. Therefore, Name
property of assemblies should address 2 levels up
.
Assemblies can be added to the publish profile as below.

Create an Area for bin folder and add the assemblies there
Also, make sure the assemblies extensions *.dll
are added as part of the inclusion list.

Add *.dll
as an inclusion of the profile to include the assemblies
Validation
Before you publish, you need to validate your package model. This validation identifies issues with your package model. Validating a package model is no different than validating other models in your FlexRule Designer (Click on Validate button ).
Publish a Publish Profile
When you have built the structure of your Decision Module and you are ready to publish it (either to a file/folder structure of a single package file), you need to go to Tools->Publisher and select “Publish a Profile” from the menu as is shown below:

Srettings for FlexRule Server
This section explains how the properties of the publish profile maps with the service URL and the FlexRuler Server package properties.
Properties of a sample profile are as follows.

This is the service URL with the above properties.
http://<server address>//api/services/execute/testProfile/2/Profile
- Name: Service name is Profile
http://<server address>//api/services/execute/testProfile/2/Profile - Destination: This package will be saved in D:\Projects\MyProject
- Entry Uri: The package execution will start with devidedbyzero.xml file
- Type: It will created a ZipPackage called Profile.frd
- Inclusions: This will include XML and DLL files
- Exclusions: This will not include files with the extension help.xml
- Version: Package and service version is 2
http://<server address>//api/services/execute/testProfile/2/Profile - Identifier: Package name will be testProfile
http:////api/services/execute/testProfile/2/Profile
Once you create the file, they are reflected on the server as below.

Identifier as Package name, and Version as Version

Name as Service name

Other properties are reflected under service –> Edit
Create a Package Using Command Line
It is possible to execute an existing package profile via the command line. FlexRule Designer accepts some parameters and can build your package from the console command line.
FlexRule.Designer.exe [Project File] -plugin FlexRule.Designer.Deployment.dll -run "build package" -profile [Profile file path] -includeAssemblies -version [Package version] -identifier [Package identifier] -output [Package location to save]
Parameters:
- plugin: This parameter must remain as above FlexRule.Designer.Deployment.dll as we are targeting the publisher plugin.
- run: This parameter is the command that is defined within the plugin. It should remain the same as the above build package
- profile: Defines a Decision Module file relative to the location of your rule project. If multiple Decision Module needs to be added, multiple profile parameters can be used.
- includeAssemblies: ensures all the assemblies in the project will be included in the package.
- version: Defines the package version
- identifier: Defines the package identifier
- output: This is the full path to which the package is saved.
Example
Below command creates a package for our sample XBRL project:
FlexRule.Designer.exe "D:\XBRL Rules\XBRL.frpj" -plugin FlexRule.Designer.Deployment.dll -run "build package" -profile "Publish\XBRL Package.xml" -includeAssemblies -version 1 -identifier "XBRL Validation Rules" -output "d:\XBRL Validation Package.frdp"
The package will be stored at d:\XBRL validation package.frdp

Video Tutorial
Sample Project
Download the sample profile (Sample-public-profile.zip) using the attachment at the end of the page.