hongji.li
2023-11-03 aefafd2142478d4fb07d6b8b45c3047e247389e0
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
Quintiq file version 2.0
#parent: #root
Method GetCanBeDeleted (
  BaseOperationLink excludedlink
) as Boolean
{
  Description: 'Return if this input group can be deleted'
  TextBody:
  [*
    // DWE2 Mar-30-2016 (created)
    
    bomsize := counter( this, Operation.OperationBOM, bom,
                        bom <> excludedlink
                        and bom.IsInput()
                        and bom.InputGroupID() = this.InputGroupID() );
    
    linksize := counter( this, Operation.DestinationOperationLink, bom,
                         bom <> excludedlink
                         and bom.DestGroupID() = this.InputGroupID() ) ;
    
    canbedeleted := bomsize <= 1 and linksize <= 1;
    
    return canbedeleted;
  *]
}