Home > Forum > Actions > Problem with cyclical action

Problem with cyclical action
0

I have a process that creates 10 reports each month. After creating the initial reports, I would like to clone them automatically at the end of the month, only changing the reporting month. The user (author) updates the data and submits it for verification.

I proposed the following procedure:
1. I created a BPS source that lists all 10 reports from the last month.
2. The BPS data source has columns including: ID, Signature, Author, Company, etc.
3. In the cyclic action, I added automation and the "Execute for everyone" operator, where I indicated the above-mentioned BPS data source.
4. There is automation in the operator that starts a new cycle (Start a subworkflow). I have 4 actions here because when I start a new element, I use 4 different paths. This is due to the fact that sometimes I assign a task to one person, and sometimes to two people per company.
5. In the data tab, I indicate the collection columns on the basis of which I complete some form fields.
6. The technical paths that I indicate in the subworkflow activation action have validation disabled.
7. On each path that I use in the subworkflow action, I have an automation pattern responsible for copying data from item lists, i.e. I take data from the current report and copy it to the next month's report. I base the copying on the _ID of the parent (BPS data source ID column).
8. The cyclic action, when run, returns an error, and even if I turn off all actions on the transition paths, I get the same error. You can see in the log that elements are being created, new signatures are being assigned and there are exactly 10 of them, but at the end an automation error appears:

System.NullReferenceException: Object reference not set to an instance of an object.
at WebCon.WorkFlow.BusinessLogic.Managers.WorkflowManagement.WorkFlowManager.<SaveSubelementsValuesAsync>d__59.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.BusinessLogic.Helpers.WorkFlowManagerProxy.<SaveSubelementsValuesAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.BusinessLogic.Automations.Engine.Evaluators.ForEachEvaluator.<EvaluateAsync>d__10.MoveNext()
-------------------------------------------------------------

Akcja Uruchom podobieg nie została wykonana. (Action ID: 18338)

User Log:

Akcja nie została wykonana - warunek wykonania nie był spełniony.

-------------------------------------------------------------

Akcja P - Uruchom podobieg nie została wykonana. (Action ID: 18343)

User Log:

Akcja nie została wykonana - warunek wykonania nie był spełniony.

-------------------------------------------------------------

Recurent action queue Completed: I - Uruchom podobieg (Action ID: 18341)

Admin Log:

Wystartowano obieg o ID 223789 i sygnaturze CL/RKPO/2024/09/00001.


-------------------------------------------------------------

Akcja W - Uruchom podobieg nie została wykonana. (Action ID: 18342)

User Log:

Akcja nie została wykonana - warunek wykonania nie był spełniony.

-------------------------------------------------------------
[...]

Rollback after an error in automation

--

P.S. I will add that in another case I indicated the source where I had members of the AD group (e-mail as ID and name as Value) and I was to create a blank inventory form for each person. I only set the employee's name and surname there (the only required field) and I also received the error: Object reference not set to an instance of an object.

What could be causing this?
My current BPS version: 2023.1.3.169