Hi,
I m trying to migrate from 6.0.o to 6.2.5.
In 6.0, in a output operation data field i have a process (object) variable modfied through a setter:
p_solicitud.setProyecto(field_proyecto);
return "";
It returns a String to a String process variable. This does works in 6.0 (p_solicitud is actualized).
In 6.2, it doesn t work, p_solicitud isnt actualized.
Re-typing the code doesnt solve the problem,
What do i miss ?
Bes regards
Hi,
In 6.2, you can not modify the process or activity data value directly in a groovy script.
You can use a groovy or custom connector or an operation to modify the value of a process data.
Hope it helps
nsaintaubert,
If dont understand wrong, you want to set the content of one field into a complex java object.
If this is the case, you should do the following
Inside the Groovy script:
p_solicitud.setProyecto(field_proyecto);
return p_solicitud;
And in the output variable you add “p_solicitud”
It helps?
As note, this variable name … Si quieres puedes escribir en español…
Un saludo
Hi yhon,
thanks for answering. Is that a normal (and future) feature or only a bug in 6.2 ? Because it is really confusing amd annoying not having java object support in groovy scripts !!! Process and aplication data model are better reflected by java objects than java primitive or derivates (Float, String…) which are pleasly used in demos but not in real world… Not supporting java object datamodel in groovy is an impotant loss in terms of funccionality (in term of process and aplication desgin); i fear we may not update the bonitasoft and change of BPM engine…
Nicolas
And what if i want to change two process object (p_solicitud and p_sollicidud_desglose) ? cant return the two objects…
Español, Ingles, frances you decide ,-)
If you really want to do that, this is not the case about a form. If you want to update one variable from a operation, a form field, etc you can do as I explain before but in other cases like groovy connectors you can update the value using the API (http://documentation.bonitasoft.com/javadoc/api/6.2/org/bonitasoft/engine/api/ProcessRuntimeAPI.html#updateProcessDataInstances(long, java.util.Map) )
BUT, In which case do you want to update both variables? if it is in one field… may be you should think again about doing that, you are duplicating data in the process…
Groovy connectors do not access the form fields. So i would have to duplicate all the form fields in activity-local variables. Why having 2 objects updated ? The one storing the value and the other infering a different behaviour to a second object (as using factory pattern to instanciate the adecuate class depending on the field value…) used in the process model; a single field may imply more than only a storage operations… so im not currently duplicating any value.