comment 32001 posted by zur003 on 2010-08-13 12:46 PM, 24 days ago | forward
|
| I've made changes to pass values as arrays of strings, which fixes the described problem, but there is still certainly scope for improving the way "variants" are handled.
|
|
comment 31230 posted by guest on 2009-12-18 4:17 PM, 262 days ago | forward
|
| I think I see a way around this. If the paramn_value field are declared as arrays of strings, rather than merely as strings, it is fairly easy to pass values in a CMP standard-compliant way. The chief "cost" is that numeric values must first be converted to string representations, but it is easy to pass scalars as arrays of length 1. Both the APSIM and AusFarm engines seem to be content with such an arrangement.
|
|
comment 31226 posted by guest on 2009-12-11 1:08 PM, 269 days ago | forward
|
Most (all?) components using "variant" types to describe the data associated with events describe that data with the following DDML:
<type>
<field name="param1_name" kind="string" />
<field name="param1_numbytes" kind="integer4" />
<field name="param1_code" kind="integer4" />
<field name="param1_isarray" kind="boolean" />
<field name="param1_value" kind="string" />
<field name="param2_name" kind="string" />
<field name="param2_numbytes" kind="integer4" />
<field name="param2_code" kind="integer4" />
<field name="param2_isarray" kind="boolean" />
<field name="param2_value" kind="string" />
<field name="param3_name" kind="string" />
<field name="param3_numbytes" kind="integer4" />
<field name="param3_code" kind="integer4" />
<field name="param3_isarray" kind="boolean" />
<field name="param3_value" kind="string" />
<field name="param4_name" kind="string" />
<field name="param4_numbytes" kind="integer4" />
<field name="param4_code" kind="integer4" />
<field name="param4_isarray" kind="boolean" />
<field name="param4_value" kind="string" />
<field name="param5_name" kind="string" />
<field name="param5_numbytes" kind="integer4" />
<field name="param5_code" kind="integer4" />
<field name="param5_isarray" kind="boolean" />
<field name="param5_value" kind="string" />
<field name="param6_name" kind="string" />
<field name="param6_numbytes" kind="integer4" />
<field name="param6_code" kind="integer4" />
<field name="param6_isarray" kind="boolean" />
<field name="param6_value" kind="string" />
<field name="param7_name" kind="string" />
<field name="param7_numbytes" kind="integer4" />
<field name="param7_code" kind="integer4" />
<field name="param7_isarray" kind="boolean" />
<field name="param7_value" kind="string" />
</type>
This doesn't work well with the PI (AusFarm) protocol implementation, as it expects the DDML to accurately indicate the data layout (indeed, that is precisely what the DDML is for). That's not currently happening. All the declared fields are not necessarily present in the passed data. More problematically, the paramn_value fields are always declared as being of kind="string", but their actual content may differ from this. Hence an attempt to parse the passed data based on its DDML declaration fails.
This "non-specific" declaration of "variant" types also makes these components largely unusable with the AusFarm manager which, when sending an event, needs to know the correct structure for the data to be sent with that event. The currenly provided declaration makes that impossible.
This is a very serious problem from the AusFarm perspective, with no obvious "work-around" available.
|
|