陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Quintiq file version 2.0
#parent: #root
Method ExportObjectToNVT (
  output NamedValueTree basenvt,
  structured_Object objects,
  Type conversiontype
)
{
  TextBody:
  [*
    if( objects.Size() > 0 )
    {
      fromtype := typeofexpression( objects.Element( 0 ) ).Name();
      totype := ifexpr( not isnull( conversiontype ), conversiontype.Name(), fromtype );
      
      traverse( objects, Elements, o )
      {
        objnvt := NamedValueTreeIO::Export( o, false );
    
        this.AppendConvertObjectNVT( fromtype, totype, objnvt, basenvt ); 
      }
      
      // Traverse NVT to manually set timestamp in each object (as we don't normally have as attribute in object, but we need in import Message)
      this.SetDefaultValues( totype, basenvt );
    }
  *]
}