Can not retrieve information from previows process, log: "Can not set java.lang.Long"

1
0
-1

Hello community, please I need your help.

My project has 3 step step process: InsertStep in form (start process), ReviewStep (to indicate if data is correct or note) and CorrectionStep (where user make corrections to data), the last one step occurs only when exists some error to be corrected from the review step; so when the data is fine, the "correct data" step is not necessary and the process ends.

5 hosted at ImgBB — ImgBB (ibb.co)

Everything went fine until I add a new object called "RevisProcesContratacion" whit 6 new fields, this new object is an array[] inside the parent object "CompraPorSubasta", like that:

VW0Y8Df2 hosted at ImgBB — ImgBB (ibb.co)

The bom.xml is (delete some unnecesary fields):
11 hosted at ImgBB — ImgBB (ibb.co)

At the moment when I submit formData from ReviewStep to the CorrectionStep the process ends with the next message in log: 2024-02-02T14:41:53,663-0500 | DESKTOP-4VPD52G | WARN | [Bonita-Worker-1-02|167] o.b.e.w.RetryingWorkExecutorService - Work ExecuteFlowNodeWork: flowNodeInstanceId: 300032 (4, true, false, false) failed because of java.lang.IllegalArgumentException: Can not set java.lang.Long field ec.edu.ucuenca.model.RevisProcesContratacion.persistenceId to java.util.HashMap. It will be retried. Attempt 1 of 10 with a delay of 1884 ms

9 hosted at ImgBB — ImgBB (ibb.co)

As I said, everything was fine until this new object to manage a table:

10 hosted at ImgBB — ImgBB (ibb.co)

Please help me, what could be wrong? Aditional images:

Diagram: 1 hosted at ImgBB — ImgBB (ibb.co)

formOutput variable from CorrectionStep 3 hosted at ImgBB — ImgBB (ibb.co)

formInput variable in ReviewStep 4 hosted at ImgBB — ImgBB (ibb.co)

Contrato in Review Step 5 hosted at ImgBB — ImgBB (ibb.co)

Contrato in Correction Step 6 hosted at ImgBB — ImgBB (ibb.co)

Operation with RevisProcesContratacion variable in CorrectionStep 7 hosted at ImgBB — ImgBB (ibb.co)

Recovery array data in RevisProcesContratacion 8 hosted at ImgBB — ImgBB (ibb.co)

Please helpme with any clue about my error.

Kind regrds,

Mauricio

3 answers

1
0
-1

Hey mauricio.brito,

Linked to what Pablo and Vicent said, check your script at the "ReviewStep", if you have defined a contract on that task that modifies the instantiated object, you should see a persitanceId and you should have a script at the operations level. Maybe there's something wrong if you modified the script manually. Also, check your form at UIDesigner you should be receiving a map on your formOutput and I'm not sure I see it, something like:

if( $data.compraSubasta ){<br />
return {<br />
//map conversa variable to expected task contract input<br />
compraSubastaInput: {<br />
compObject: $data.compraSubasta.compObject.map( it => ({<br />
persistenceId_string: it.persistenceId_string !== undefined ? it.persistenceId_string : null, attribute: it.attribute !== undefined ? it.attribute : null }))<br />
}<br />
} }

Finally, try creating a simpler and smaller project to reproduce the issue: a simpler object with less attributes that still uses the composition with eager pattern as you wish.

Hope this helps,
-Thalía

1
0
-1

Hi Mauricio,

I do not have access to the files, sounds like the links have expired.
My blind guess is that you had defined RevisProcesContratacion relation to his parent as aggregation. This implies when you initialize/update your parent CompraPorSubasta with a list of RevisProcesContratacion those object has to be created previously.
An example is an invoice that links to a customer (agregation). This customer has to exist before the creation of the invoice and then link it to it.

This is the reason why it is waiting for a persistenceId.

The contract generation from data in the task and its update scripts will expect to have this persitenceId

Hope it helps

1
0
-1

java.lang.IllegalArgumentException: Can not set java.lang.Long field ec.edu.ucuenca.model.RevisProcesContratacion.persistenceId to java.util.HashMap

This error usually appear when you have a script that tries and affects a value to a field with the wrong data type.

Do you have any script in your process which affects the persistenceId value ? (triple check them to make sure they don't return a Map)

Have you tried to clean and deploy your BusinessDataModel after the changes ? (in the bom.xml editor, second button with the wastebin icon)

Notifications