How to Prevent Infinite Loop in Two-Way Synchronization Between Two Applications?

I’m currently working on establishing a two-way connection between two applications in Creatio for adding and modifying records.
 

  1. One-Way Connection: I successfully created two business processes that allow for one-way synchronization of records.
  2. Two-Way Connection Issue: However, when I attempt to set up the two-way synchronization, it leads to the creation of multiple records in an infinite loop instead of just one record being created or updated.

 

Could anyone provide guidance on how to avoid this infinite loop in a two-way connection? Any insights on best practices for implementing two-way synchronization in Creatio would also be greatly appreciated.
 

I can provide screenshots of my setup for further clarification if needed. I followed the same process for the one-way connection as shown in the attached business process screenshot.

Like 0

Like

1 comments

Good day,

The issue you're encountering is related to the number of records being passed to the subprocess. Here are some suggestions for resolving this situation:

1. Add or adjust recursion trigger conditions:
   - For instance, if the trigger is based on changes to the `Contact.Age` field, consider adding a condition to ensure the age is not empty before initiating recursion.

2. Redesign the process to avoid recursion:
   - Replace recursion with iteration: Instead of processing records one by one with recursion, you can read and process multiple records in a sequential manner, ensuring that you do not handle a new record until the current one is fully processed.
   - Consolidate changes into a single process: Rather than reacting to various changes across different processes, use one process to handle all necessary changes at once. For example, initiate triggers in a single business process (BP) with all modifications related to a specific entity, which helps in minimizing and managing recursion more effectively.

It is crucial to first review the process logic with the above suggestions, as increasing the `MaximumBackgroundRecursionDepth` parameter could lead to application performance issues, such as slowing down or exhausting server memory, which might result in application restarts or stops.

In your system, the `MaximumBackgroundRecursionDepth` parameter is currently set to 100 (default is 100). The issue arises when the number of subprocess calls exceeds this value.

To address this problem, you may need to increase the `MaximumBackgroundRecursionDepth` parameter to accommodate all records, rather than only the initial 100.

Regards,
Orkhan

Show all comments