Showing results for 
Show  only  | Search instead for 
Did you mean: 

Initialising A Multiple Value Answer In A Questionnaire

MEGA Partner

Initialising A Multiple Value Answer In A Questionnaire

Hi - I'm trying to initialise a Multiple Value Answer object in a questionnaire. The main characteristics are shown in the image in MultipleValue.png. The collection to initialise this answer contains Risks and uses the macro "Current Project Risks (PPM Bizcon).Collection Implementation".


The macro signature has been created from the Mega code template i.e. it implements 


Sub FillSelectionCollection(mgobjObject as MegaObject, vntSelectorID as Variant, mgcolCollection as MegaCollection)


However, no matter the code inside this macro, the collection in the displayed answer fails to show any content when the questionnaire is displayed (in both the Windows and Web client). The answer behaves correctly otherwise i.e. I can create and attach risks, which are linked to the source project and the correct JSON string is present in the _RefersText attribute in the property valuation.


My questions are:


1. What object (mgobjObject) is passed to this macro? Is it the Assessment Node or the Assessed Object (Project in this case)?

2. What type of collection is passed (group of slave objects or disconnected objects) ? i.e. how is the collection created before it is passed to the filling macro ?

3. Are there any requirements on other settings that need to be in place in order for this to function correctly e.g. permissions on collections, macro execution, user profiles or other environmental factors?


I'm running V1R3 on CP12 


Thanks in advance



1 Reply
MEGA Partner

Well it takes nothing to answer such straightforward questions as I've posed; I can only conclude that either no one on the forum in Mega knows the answers (which I don't believe) or that there is a deep-seated bug tht no one wants to publicise or acknowledge.


In fact it is a bug at the core of Mega as the behaviour is intermittent i.e. sometimes the code (same macro, same repository, same data) works and sometimes it doesn't, ergo it is not the configuration or code that is at fault.  In fact it is the same behaviour seen on report templates created via Report Studio in which a report is sometimes generated correctly and sometimes with an error (which disappears after a refresh), all on the same data and repository.


Decompiling the jar files shows me that core Mega actually creates a scheduled job (presumably in another process)  that does the actual work. I've not looked at this code too closely, but my hypothesis is that the intermittent nature of the behaviour probably points to some kind of race condition between the scheduled job and the callback routine in the core Mega thread, or between the garbage collector and mega processes, meaning that getting a reliable result is in the lap of the JVM scheduler. Might be using a thread-unsafe data structure in a collection too. Again, I might be wrong as I've not looked at the code too closely but it could be a good place to start.


My final question is: to whom do I send my invoice for QA and Test services you seem to have outsourced to the customers?