UF_TRVRS - Signal VLF Objects
  • *=============================================================================
    *
    * Component   : UF_TRVRS
    * Type        : Reusable Component
    * Ancestor    : PRIM_OBJT
    *
    * PLEASE NOTE:  This UF_ (User Framework) component is the shipped version. You
    * may choose to modify it. You should do this by copying the source
    * code of this component into your own component and then change
    * the copied version. This will prevent the accidental loss of your
    * changes if you upgrade your Visual LANSA Framework version. Refer
    * to the end of this component for more details about making your
    * own version of this component.
    *
    * This is example code only - No warranty is expressed or implied.
    * Neither this program, nor any derivative of it, should be ever be used in
    * production or end-user environments.
    *
    * =============================================================================
    *
    * This reusable part can be used to signal VLF objects - See UF_QRY01, 02 03
    * =============================================================================

    FUNCTION OPTIONS(*DIRECT)
    Begin_Com Role(*EXTENDS #PRIM_OBJT)

    Define_Com Class(#VF_SY001) Name(#USYSTEM) Reference(*dynamic) scope(*Application)
    Define_Com Class(#VF_FP001) Name(#UFRAMEWORK) Reference(*dynamic) scope(*Application)

    Define_Com #VF_AC009 #TempVF_AC009 Reference(*Dynamic)

    Define_Com #VF_FP001 #TempVF_FP001 Reference(*Dynamic)
    Define_Com #VF_FP002 #TempVF_FP002 Reference(*Dynamic)
    Define_Com #VF_FP003 #TempVF_FP003 Reference(*Dynamic)

    Define_Com #VF_FPM09 #TempVF_FPM09 Reference(*Dynamic)
    Define_Com #VF_FPM10 #TempVF_FPM10 Reference(*Dynamic)
    Define_Com #VF_FPM14 #TempVF_FPM14 Reference(*Dynamic)

    Define_Com #VF_FP025 #TempVF_FP025 Reference(*Dynamic)
    Define_Com #VF_FP026 #TempVF_FP026 Reference(*Dynamic)

    Define_Com #VF_FPM27 #TempVF_FPM27 Reference(*Dynamic)
    Define_Com #VF_FPM28 #TempVF_FPM28 Reference(*Dynamic)
    Define_Com #VF_FPM29 #TempVF_FPM29 Reference(*Dynamic)
    Define_Com #VF_FPM30 #TempVF_FPM30 Reference(*Dynamic)

    * =======================================================================
    * Events signaled back to user application for each type of object found
    * =======================================================================

    Define_evt Framework
    define_map *input #VF_FP001 #Reference Pass(*By_Reference)

    Define_evt Application
    define_map *input #VF_FP002 #Reference Pass(*By_Reference)
    define_map *input #VF_FP001 #VisParent1 Pass(*By_Reference)

    Define_evt BusinessObject
    define_map *input #VF_FP003 #Reference Pass(*By_Reference)
    define_map *input #VF_FP001 #VisParent1 Pass(*By_Reference)
    define_map *input #VF_FP002 #VisParent2 Pass(*By_Reference)

    Define_evt CommandDefinition
    define_map *input #VF_FPM09 #Reference Pass(*By_Reference)

    Define_evt CommandReference
    define_map *input #VF_FPM10 #Reference Pass(*By_Reference)
    define_map *input #VF_FPM09 #CommandDefinition Pass(*By_Reference)
    define_map *input #VF_FP001 #VisParent1 Pass(*By_Reference)
    define_map *input #VF_FP002 #VisParent2 Pass(*By_Reference)
    define_map *input #VF_FP003 #VisParent3 Pass(*By_Reference)


    Define_evt Filter
    define_map *input #VF_FPM14 #Reference Pass(*By_Reference)
    define_map *input #VF_FP001 #VisParent1 Pass(*By_Reference)
    define_map *input #VF_FP002 #VisParent2 Pass(*By_Reference)
    define_map *input #VF_FP003 #VisParent3 Pass(*By_Reference)

    define_evt RAMPContainer
    define_map *input #VF_FP025 #Reference Pass(*By_Reference)

    define_evt RAMPSession
    define_map *input #VF_FP026 #Reference Pass(*By_Reference)

    define_evt RAMPDestination
    define_map *input #VF_FPM27 #Reference Pass(*By_Reference)

    define_evt RAMPJunction
    define_map *input #VF_FPM28 #Reference Pass(*By_Reference)

    define_evt RAMPSpecial
    define_map *input #VF_FPM29 #Reference Pass(*By_Reference)

    define_evt RAMPScript
    define_map *input #VF_FPM30 #Reference Pass(*By_Reference)

    * =======================================================================
    * This is the method exposed to the user application
    * =======================================================================

    Mthroutine Name(uTraverseFramework)

    Invoke #Com_Owner.uEnumerateOBJECT Reference(#uFramework) Parent(*null)

    Invoke #Com_Owner.uEnumerateOBJECT Reference(#uSystem.uNodeContainer) Parent(*null)

    Endroutine

    * =======================================================================
    * This method is internal and not exposed
    * =======================================================================

    Mthroutine Name(uEnumerateOBJECT) Access(*PRIVATE)
    Define_Map For(*input) Class(#VF_AC001) Name(#Reference) Pass(*By_Reference)
    Define_Map For(*input) Class(#VF_AC001) Name(#Parent) Pass(*By_Reference)

    Define_com #vf_elindx #EnumIndex
    Define_com #vf_elmbri #EnumMemberGUID

    If_ref #Reference is_not(*null)

    * Handle this object bvy signalling each type found

    Case #Reference.uClass

    * Framework

    When (= VF_FP001)
    set_ref #TempVF_FP001 (*Dynamic #Reference)
    Signal Framework Reference(#TempVF_FP001)

    * Application

    When (= VF_FP002)
    set_ref #TempVF_FP002 (*Dynamic #Reference)
    set_ref #TempVF_FP001 (*Dynamic #TempVF_FP002.uAuthorityParent)
    Signal Application Reference(#TempVF_FP002) VisParent1(#TempVF_FP001)

    * Business Object

    When (= VF_FP003)
    set_ref #TempVF_FP003 (*Dynamic #Reference)
    set_ref #TempVF_FP002 (*Dynamic #TempVF_FP003.uAuthorityParent)
    set_ref #TempVF_FP001 (*Dynamic #TempVF_FP002.uAuthorityParent)

    Signal BusinessObject Reference(#TempVF_FP003) VisParent1(#TempVF_FP001) VisParent2(#TempVF_FP002)

    * RAMP Container

    When (= VF_FP025)
    set_ref #TempVF_FP025 (*Dynamic #Reference)
    Signal RAMPContainer Reference(#TempVF_FP025)

    * RAMP Session

    When (= VF_FP026)
    set_ref #TempVF_FP026 (*Dynamic #Reference)
    Signal RAMPSession Reference(#TempVF_FP026)

    Endcase

    * Enumerate all members

    If_ref #Reference.ecMemberManagers is_not(*null)
    For #Manager #Reference.ecMemberManagers

    #EnumIndex := 0

    Dowhile (#Manager.Enumerate_MEMBERS(#Reference #EnumIndex #EnumMemberGUID 7))

    #Manager.Currentmemberguid := #EnumMemberGUID

    Case #Manager.VF_FPNNNClass

    * Command Definition

    When (= VF_FP009)
    set_ref #TempVF_FPM09 (*Dynamic #Manager)
    Signal CommandDefinition Reference(#TempVF_FPM09)

    * Command reference

    When (= VF_FP010)
    set_ref #TempVF_FPM10 (*Dynamic #Manager)
    #uFrameWork.VF_FP009Manager.CurrentmemberGUID := #TempVF_FPM10.uCommandGUID

    set_ref #TempVF_AC009 (*Dynamic #TempVF_FPM10.uLinkedOwner)

    If_Ref Com(#TempVF_AC009) Is(*INSTANCE_OF #VF_FP001)
    * Framework Command
    set_ref #TempVF_FP003 *null
    set_ref #TempVF_FP002 *null
    set_ref #TempVF_FP001 (*Dynamic #TempVF_AC009)
    ENDIF

    If_Ref Com(#TempVF_AC009) Is(*INSTANCE_OF #VF_FP002)
    * Application Command
    set_ref #TempVF_FP003 *null
    set_ref #TempVF_FP002 (*Dynamic #TempVF_AC009)
    set_ref #TempVF_FP001 (*Dynamic #TempVF_FP002.uAuthorityParent)
    ENDIF

    If_Ref Com(#TempVF_AC009) Is(*INSTANCE_OF #VF_FP003)
    * Business Object Command
    set_ref #TempVF_FP003 (*Dynamic #TempVF_AC009)
    set_ref #TempVF_FP002 (*Dynamic #TempVF_FP003.uAuthorityParent)
    set_ref #TempVF_FP001 (*Dynamic #TempVF_FP002.uAuthorityParent)

    ENDIF

    Signal CommandReference Reference(#TempVF_FPM10) CommandDefinition(#uFrameWork.VF_FP009Manager) VisParent1(#TempVF_FP001) VisParent2(#TempVF_FP002) VisParent3(#TempVF_FP003)

    * Filter

    When (= VF_FP014)
    set_ref #TempVF_FPM14 (*Dynamic #Manager)
    set_ref #TempVF_FP003 (*Dynamic #Reference)
    set_ref #TempVF_FP002 (*Dynamic #TempVF_FP003.uAuthorityParent)
    set_ref #TempVF_FP001 (*Dynamic #TempVF_FP002.uAuthorityParent)

    Signal Filter Reference(#TempVF_FPM14) VisParent1(#TempVF_FP001) VisParent2(#TempVF_FP002) VisParent3(#TempVF_FP003)

    * RAMP Destination

    When (= VF_FP027)
    set_ref #TempVF_FPM27 (*Dynamic #Manager)
    Signal RAMPDestination Reference(#TempVF_FPM27)

    * RAMP Junction

    When (= VF_FP028)
    set_ref #TempVF_FPM28 (*Dynamic #Manager)
    Signal RAMPJunction Reference(#TempVF_FPM28)

    * RAMP Special

    When (= VF_FP029)
    set_ref #TempVF_FPM29 (*Dynamic #Manager)
    Signal RAMPSpecial Reference(#TempVF_FPM29)

    * RAMP Script

    When (= VF_FP030)
    set_ref #TempVF_FPM30 (*Dynamic #Manager)
    Signal RAMPScript Reference(#TempVF_FPM30)

    Endcase

    Endwhile

    Endfor
    Endif

    * Enumerate all children recursively

    If_ref #Reference.ecchildcollection is_not(*null)
    For #Child in(#Reference.ecchildcollection)
    Invoke #Com_Owner.uEnumerateOBJECT Reference(#Child) Parent(#Reference)
    Endfor
    Endif


    Endif

    Endroutine

    END_COM