Cyclic connection chains in package hierarchy

All Creatio products

A new customization approach was implemented and a new app level was introduced in Creatio version 8.0 Atlas. Apps are function blocks that solve business problems. Apps are now the main unit of no-code development. For example, an app can be a set of tools for employee request management. An app can consist of one or more content packages. A package is a collection of configuration elements that implements a particular block of functionality. You can transfer packages between environments (export them or deploy to other Creatio instances) and share them with other users on Creatio Marketplace. Learn more in the developer documentation: Packages basics.

A package where Creatio saves new functionality is added automatically when you create an app. Creatio adds the required dependencies automatically for elements created in the No-Code Designer, Freedom UI Designer, Business Process Designer, and Case Designer.

Note. If you go back to editing the app after a while since you created it, make sure to set the package of the app to current in the “Current package” (“CurrentPackageId” code) system setting before you begin. Otherwise, Creatio will save the improvements to a different package, which causes errors when saving and transferring changes.

A dependency chain where elements or data of a package depend on the current package directly or via a hierarchical chain is a cyclic chain. Cyclic dependency chains lead to app runtime errors.

Consider an app with A, B, and C packages where the B package depends on the A package, and the C package depends on the B package. Using an element of the C package in the A or B package requires that the C package is their dependency. Creatio will not execute an operation with such a requirement since it will cause a cyclic chain. (Fig. 1).

Fig. 1 A cyclic chain

Using apps with cyclic dependencies can cause Creatio runtime issues. As such, Creatio checks the configuration elements used and dependencies configured while saving the app changes. If cyclic dependency chains are detected as part of the check-up, Creatio saves the changes, but drops the package dependencies. You will receive a notification that recommends that you check and fix the dependencies configured. The notification will contain more information about the error as well (Fig. 2):

  • Source is the part of the schema with the element that causes the error.
  • Reference is the name of the element that causes the error.
  • Package is the name of the package that contains the element.
Fig. 2 An error message for a cyclic dependency

We recommend fixing cyclic dependencies before you configure the app further to ensure its operability.

Cyclic chain examples 

This section covers several example solutions that cause cyclic chain errors.

Example 1. If you use an existing configuration element from the Custom package (Fig. 3) in the “UserApplication” custom app, this will cause a cyclic chain error. Cause: the Custom package depends on every configuration package by default, including the “UserApplication” package. However, the “UserApplication” package must depend on the Custom package to access its elements.

Fig. 3 Package hierarchy

Example 2. You have created “Application1” and “Application2” apps. If you use “Application1” elements in “Application2”, Creatio adds “Application1” to “Application2” as a dependency automatically. If you use the functionality of the “Application2” app in the “Application1” app to improve the latter, this will cause a cyclic chain error.

Prevent cyclic chains 

To avoid cyclic chains, we recommend the following:

  • If you configure an app using elements from another app, mind the app's resulting dependencies. To ensure the app operates as intended in a different environment, transfer both of the apps.
  • Only save the improvements that the app uses to the app's package. After creating an app but before setting it up, find its package and change the default package. To do this:
  1. Find the app package in the Advanced settings section of the No-Code Designer.
  2. Click btn_system_designer.png in the top right → System settings.
  3. Select the “Current package” (“CurrentPackageId” code) system setting.
  4. Make sure that the package you found on step 1 is specified in the Default value field. If a different package is specified, change it to the app package and save the changes.

Resolve the cyclic chain issue 

You can eliminate cyclic chains in several ways:

  • If you use the wrong elements by mistake, which caused a cyclic chain, you can delete them or replace them with new elements that do not cause a cyclic chain. After that, save the changes to readd the dependencies.

    Example. The Read data business process element reads a redundant column or uses it in the filtering conditions. To eliminate the cyclic chain, simply delete the column and save the business process.

    Note. Objects or business processes that use methods and Script task elements cannot be published before you eliminate the cyclic chain issue.

  • If the elements that cause a cyclic chain are not critical to the operation of the app or you made the changes by mistake, simply revert the changes to eliminate all newly introduced cyclic chains.

    Example. You replaced the UsrObject object both in the “UserApplication” app package and the Custom package. The Column object column created in the Custom package has a different Name property in the “UserApplication” package. Since you made the changes in the dependent package, this caused a cyclic chain. To eliminate it, simply return the property to its original state and save the updated object.

  • If you cannot edit or delete the elements that caused a cyclic chain, move them:
    • to the package that contains the parent schemas of the elements
    • to the package from which the package with the schemas inherits

    Example. A cyclic chain was made when you used the UsrLookup lookup of the Custom package in the “UserApplication” app. The lookup is the data source for the UsrEntity object’s lookup column. To fix the error, move the UsrLookup lookup to the “UserApplication” app package.

    To move the functionality between packages:

  1. Find the app package in the Advanced settings section of the No-Code Designer.
  2. Click btn_system_designer.png in the top right → Advanced settings.
  3. 3. Select the needed package from the package list.
  4. 4. Find the schema that causes the cyclic chain in the package contents.
  5. Click btn_multiple.png.
  6. Select “Move to another package.” This opens a box.
  7. Select the package that you found on step 1 in the box and save the changes.

Attention. Do not replace a single object in a single package more than once. If the cyclic chain is caused by two replacements of a single object in two different packages, move the schema that causes the cyclic chain to a third package. The package where you configure the app must inherit from the package to which you moved the schema.