[Glass] Simple Rc Collection question

BrunoBB via Glass glass at lists.gemtalksystems.com
Mon Jul 13 12:52:28 PDT 2015


Hi Mariano,

That is my case also, i have Dictionaries where the key is a field name and
the value is a Rc collection with all field's form (of some kind of
process).

ProcessDefinition - has a collection of FormDefinition, each FormDefinition
has a collection of FieldDefinition.
Each Process Instance has a definition and a collection of FormInstance and
each FormInstance has a collection of FieldValue. So...

ProcessDefinition has a Dictionary where the key is a field name and the
value is a Rc collection with ALL fields values (FieldValue) for that field
name (in this type of process).  The Rc collection is a RcIdentityBag. 
But since a form field can be edited and field's values can be
added/changed/removed i need a Rc that not allow the same object twice. 
This is because the field of a form can be "repetable" which means that
field named "language" can have multiple values (let say english, spanish,
freach). Then before confirming the transition (from one form to another)
the form can be edited a now "language" field has the following values
(english, italian, spanish2, portuguese). 
When editing i have 3 scenarios (for a field that is "repetable"):
1- same quanity of fields --> no problem just change values and the index
will be recalculated.
2- fields removed --> i have to remove some elements from
ProcessDefinition.RcIdentityBag
3- fields added --> i have to add some elements in
ProcessDefinition.RcIdentityBag
(to be short i omitted some model details)

In the beginning i really need a RcSet but now is not neccesary i have
created an intermediate class FieldValueHolder (fieldName currentValues
toAdd toRemove) that do the job. It basically match the process described
above. -currentValues (first values of the field) -toAdd (if newones are
added) -toRemove (if an existing one is removed)

Regards,
Bruno
PS: i have to do this because a Rest Service from a Java App send an XML of
the form each time is edited. In order to perform a correct search i have to
track changes in fields values from the XML.




--
View this message in context: http://forum.world.st/Simple-Rc-Collection-question-tp4837044p4837377.html
Sent from the GLASS mailing list archive at Nabble.com.


More information about the Glass mailing list