persistence manager
2 answers
Thanks Lio,
Originally i wanted to add an item to a container in connector out. The item is set in an activity, the activity can loop so the connector check if the item already exist in the container and if not add it. I understood that bo can only manipulate at init or in operations (operations are performed in a transaction), so i used a work around : i add all item to the container at init.
Regards
Comments
Hi,
You can manipulate the BO in a connector as well, just make sure you return the updated bo and replace the current one in the last screen of the connector "Output operations".
Cheers
Hi Lio,
I don't think so, to manipulate you must be in transaction and only operations are executed in transaction. We I try to execute the code below in connector I have the following exception.
Caused by: java.lang.IllegalStateException: org.bonitasoft.engine.transaction.STransactionNotFoundException: No active transaction.
at org.bonitasoft.engine.business.data.impl.JPABusinessDataRepositoryImpl.getEntityManager(JPABusinessDataRepositoryImpl.java:174)
at
Code :
if (currentContratReview.getItemLst().contains(currentContratReviewControlFactory)==false)
currentContratReview.getItemLst().add(currentContratReviewControlFactory);
return currentContratReview;
and result is affect to currentContratReview