06-24-2024 06:05 AM
Hello Community,
I am encountering an issue with a Data Management Sequence consisting of four steps. The first step is not executing as expected. If anyone has insights into potential causes, I would greatly appreciate your assistance.
Details of the sequence are as follows:
Thank you in advance for your help.
Solved! Go to Solution.
06-24-2024 06:44 AM
Assuming you can confirm with your tests that overlapping is the issue here and you cannot reasonably change the setup of your sequences and rules (on which we in the forum have zero visibility), you might want to change your setup as follows.
Only trigger step 1 and in the business rule that runs last, kick off the other three steps from the rule itself. This way you should be able to ensure that step 1 is completed before you kick off any other step.
You can trigger DM sequences by using BRApi.Utilities.StartDataMgmtSequence, BRApi.Utilities.ExecuteDataMgmtSequence, or BRApi.Utilities.QueueDataMgmtSequence.
StartDataMgmtSequence
This starts a DM sequence, i.e. it runs the sequences (possibly) in parallel if you start several at once.
ExecuteDataMgmtSequence
This executes a DM sequence, i.e. it fully executes the first DM sequence, then the next one. etc. This always waits until the previously "executed" DM sequence has been fully completed.
QueueDataMgmtSequence
This behaves like StartDataMgmtSequence, except that this one creates queued tasks that are considered by all DM servers (i.e. you possibly spread the DM sequences across different servers, whereas StartDataMgmtSequence executes DM sequences only on the server the business rule is run that executes the DM sequences).
I hope this helps you getting the execution order right.
06-24-2024 06:13 AM
Hi, what do you mean exactly by "The first step is not executing as expected"? Do you get an error message? Or is the data not calculated as expected (i.e. the result is not correct)?
Also, when the first step depends on the second step to be completed ("The first step is dependent on the successful completion of the second step."), it points towards an error in the execution sequence as the first step should be executed after the second step as it depends on this to be completed first.
If this is a misunderstanding, and the second step is actually dependent on the first one, then my guess is that the rules that are triggered by step 1 have not been completed before step number 2 commences. You can test that by writing into the error log in the separate business rules that are triggered and see if the executions overlap in the error log.
How is this all executed? From the data management page, or does a business rule trigger those steps?
06-24-2024 06:42 AM
Hi,
Actually, In my DM sequence there are 4 steps. the 1st step is not even running, It directly running from the 2nd step to 4th step.
06-24-2024 06:47 AM
Ok, that is a different issue then. I assume step 1 has been added to the sequence steps?
How do you know it is not running? Can you write something into the error log?
06-24-2024 06:55 AM
I've added the 1st step as well in the same sequence. Even though the sequence ignored the 1st step and goes for remaining 2nd, 3rd and 4th step
06-24-2024 07:14 AM
How do you know that the 1st step is not executed exactly? It probably is executed, but does not do what you expect it to do. I am not aware of steps not being executed when they are run via a sequence.
First you need to investigate where / when the rule is no longer runs as expected. As step 1 runs a "Business Rule (BR) that includes an Extensibility Rule", you can use api.LogMessage() or BRApi.ErrorLog.LogMessage() in your code to write into the error log and then pin down the exact row of code where it likely goes wrong. First start by writing pointers into the error log (1, 2, 3, etc.) and when you know the WHERE (in the code), you can start writing parameters and variables into the error log if needed to see what might need fixing.
06-24-2024 06:44 AM
Assuming you can confirm with your tests that overlapping is the issue here and you cannot reasonably change the setup of your sequences and rules (on which we in the forum have zero visibility), you might want to change your setup as follows.
Only trigger step 1 and in the business rule that runs last, kick off the other three steps from the rule itself. This way you should be able to ensure that step 1 is completed before you kick off any other step.
You can trigger DM sequences by using BRApi.Utilities.StartDataMgmtSequence, BRApi.Utilities.ExecuteDataMgmtSequence, or BRApi.Utilities.QueueDataMgmtSequence.
StartDataMgmtSequence
This starts a DM sequence, i.e. it runs the sequences (possibly) in parallel if you start several at once.
ExecuteDataMgmtSequence
This executes a DM sequence, i.e. it fully executes the first DM sequence, then the next one. etc. This always waits until the previously "executed" DM sequence has been fully completed.
QueueDataMgmtSequence
This behaves like StartDataMgmtSequence, except that this one creates queued tasks that are considered by all DM servers (i.e. you possibly spread the DM sequences across different servers, whereas StartDataMgmtSequence executes DM sequences only on the server the business rule is run that executes the DM sequences).
I hope this helps you getting the execution order right.
06-24-2024 06:41 AM - edited 06-24-2024 06:42 AM