lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Quintiq file version 2.0
#parent: #root
Method GenerateIdentifierFindBy
{
  TextBody:
  [*
    gp := this.TG_TestGenerator().TG_GlobalParameter();
    
    objecttypename := this.CreatedName();
    identifier := this.CreatedIdentifierName();
    name := 'FindBy' + identifier;
    returntype := objecttypename;
    body := this.GetIdentifierFindByBody();
    description := '';
    accessibility := 'Public'; // TODO
    
    cg := CG_CodeGenerator::Construct();
    
    // TODO - Wrap into global
    cg.CreateMethodArgument( 'run',
                              typeof( LibUTF_IterationRun ).Name(),
                              false,
                              false,
                              false,
                              false )
      .CreateMethodArgument( 'company',
                              'Company', // TODO Global parameter
                              false,
                              false,
                              false,
                              false );
    
    traverse( this, TG_UIObjectIdentifier, id )
    {
      cg.CreateMethodArgument( id.CreatedName().ToLower(),
                               id.TG_UIObjectAttribute().ValueType(),
                               false,
                               false,
                               false,
                               false );
    }
    
    cg_nvt := LibInt_MessageAccessor::CreateEmptyMessage();
    LibInt_MessageAccessor::SetBodyAsObject( cg_nvt, cg );
    
    CG_CodeGenerator::CreateStaticMethod( gp.TestModuleName(),
                                          objecttypename,
                                          name,
                                          returntype,
                                          true,
                                          body,
                                          description,
                                          accessibility,
                                          cg_nvt );
  *]
}