admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Quintiq file version 2.0
#parent: #root
Method ExecuteCapacitiesBrokers (
  Boolean isexcel,
  BinaryValues binarydatas,
  Strings brokers
)
{
  Description: 'Execute brokers that are associated with objects in Capacities ObjectGroup'
  TextBody:
  [*
    if( not isexcel )
    {
      this.MPSync().MPSync_ImportShiftPatternsFromDBBroker().Execute();  
      this.MPSync().MPSync_ImportStockingPointCapacitiesFromDBBroker().Execute();
      this.MPSync().MPSync_ImportUnitCapacitiesFromDBBroker().Execute();
      this.MPSync().MPSync_ImportUnitAvailabilitiesFromDBBroker().Execute();
      this.MPSync().MPSync_ImportTransportCapacitiesFromDBBroker().Execute();
      this.MPSync().MPSync_ImportTransportAvailabilitiesFromDBBroker().Execute();
    }
    else
    {
      brokername :="";
      try
      {
        // Shift patterns
        brokername := typeof( MPSync_ImportShiftPatternsFromExcelBroker ).ShortName();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportShiftPatternsFromExcelBroker().Source(),
                             binaryvalue );
        this.MPSync().MPSync_ImportShiftPatternsFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true ); 
      }
      onfailure
      {
        this.UpdateLastExecutedImportObjectGroupErrorMessage( brokername + ":" + e.GeneralInformation() );
      }  
      
      try
      {    
        // Unit capacities
        brokername := typeof( MPSync_ImportUnitCapacitiesFromExcelBroker ).ShortName();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportUnitCapacitiesFromExcelBroker().Source(),
                             binaryvalue );    
        this.MPSync().MPSync_ImportUnitCapacitiesFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true );
      }
      onfailure
      {
        this.UpdateLastExecutedImportObjectGroupErrorMessage( brokername + ":" + e.GeneralInformation() );
      }  
      
      try
      {  
        // Unit availabilities
        brokername := typeof( MPSync_ImportUnitAvailabilitiesFromExcelBroker ).ShortName();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportUnitAvailabilitiesFromExcelBroker().Source(),
                             binaryvalue );      
        this.MPSync().MPSync_ImportUnitAvailabilitiesFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true );
      }
      onfailure
      {
        this.UpdateLastExecutedImportObjectGroupErrorMessage( brokername + ":" + e.GeneralInformation() );
      }  
      
      try
      {    
        // Transport capacities
        brokername := typeof( MPSync_ImportTransportCapacitiesFromExcelBroker ).ShortName();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportTransportCapacitiesFromExcelBroker().Source(),
                             binaryvalue );      
        this.MPSync().MPSync_ImportTransportCapacitiesFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true );
      }
      onfailure
      {
        this.UpdateLastExecutedImportObjectGroupErrorMessage( brokername + ":" + e.GeneralInformation() );
      }  
      
      try
      {    
        // Transport availability
        brokername := typeof( MPSync_ImportTransportAvailabilitiesFromExcelBroker ).ShortName();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportTransportAvailabilitiesFromExcelBroker().Source(),
                             binaryvalue );      
        this.MPSync().MPSync_ImportTransportAvailabilitiesFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true );
      }
      onfailure
      {
        this.UpdateLastExecutedImportObjectGroupErrorMessage( brokername + ":" + e.GeneralInformation() );
      }  
      try
      {
        // Stocking point capacities
        brokername := typeof( MPSync_ImportStockingPointCapacitiesFromExcelBroker ).ShortName();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportStockingPointCapacitiesFromExcelBroker().Source(),
                             binaryvalue );    
        this.MPSync().MPSync_ImportStockingPointCapacitiesFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true ); 
      }
      onfailure
      {
        this.UpdateLastExecutedImportObjectGroupErrorMessage( brokername + ":" + e.GeneralInformation() );
      }  
    }
  *]
  InterfaceProperties { Accessibility: 'Extensible' }
}