package gw.rating.flow uses com.guidewire.pc.domain.rating.flow.CalcStepValueDelegateAdapter class CalcStepDefinitionOperandAdapter implements CalcStepValueDelegateAdapter{ var _owner : CalcStepDefinitionOperand construct( owner : CalcStepDefinitionOperand) { _owner = owner } override function changeToOperandType(targetType : CalcStepOperandType) { // In case of sub operands, do not wipe out other operands if (_owner.PrimaryOperand) { _owner.CalcStep.removeOperands() } if (_owner.OperandType != targetType) { // do something special when transitioning between typelist constant and typelist collection if (_owner.OperandType == TC_CONSTANT and _owner.TypekeyConstantValue != null and targetType == TC_COLLECTION) { _owner.TypelistCollection = { _owner.TypekeyConstantValue } } else if (_owner.OperandType == TC_COLLECTION and targetType == TC_CONSTANT) { final var val = _owner.TypelistCollection?.first() _owner.TypelistCollection = {} _owner.TypekeyConstantValue = val } else { _owner.clearOperandValues() } _owner.OperandType = targetType } } override property get OwningStep(): CalcStepDefinition { return _owner.CalcStep } }