Description


Create INIT triggers/operations for ENTITIES on conceptual and component level. Call them while NEW instance of EntityCollection are created ...after component operation INIT succeeds. ...(+ ?? maybe,when outer occurrence will be created ??) Status>=0 should be returned by trigger code if initialization is succesfull. It should allow to programmer to define dynamic entity initialization in model - setting valreps to entity columns - grid column visibility, grid column width and so on Now , it can be done in init trigger of component, so there is no model inheritance

Use Case


operation InitEntity if (!IsMemberOf(BUSSINESGROUP)) $collhandle(<$entname>)->HideColumn(Prices) $valrep(DocumentTypes.<$entname>) endif end operation

Importance



Type


Proc code

Operating System


Not Applicable

Status


4 thoughts on “\”Init\” trigger or operations for entities”

  1. with the dITo Uniface Reflection (DUR) project, we used the following:
    1) create a #define DUR_ENTITIES with comma separated painted entities (automatic by DUR)
    2) provide the INIT and CLEANUP collection operations (modeled or on the fly)
    3) Enhance the components INIT and CLEANUP oeration with:
    #for pe = ()
    $collhandle()->INIT()
    #endfor ; pe
    #undefine pe

    Greetings from Frankfurt/Germany, Uli

    1. The usual problem with this comment editor eating some characters

      with the dITo Uniface Reflection (DUR) project, we used the following:
      1) create a #define DUR_ENTITIES with comma separated painted entities (automatic by DUR)
      2) provide the INIT and CLEANUP collection operations (modeled or on the fly)
      3) Enhance the components INIT and CLEANUP oeration with:
      #for pe = (<DUR_ENTITIES>)
      $collhandle(<pe>)->INIT()
      #endfor ; pe
      #undefine pe

      Greetings from Frankfurt/Germany, Uli

  2. You should be able to use $componentinfo($instname,”OUTERENTITIES”) to get a list of the top entities painted, then run a recursive routine to call the INIT operation of each entity in the list and all inner entities.

    operation INIT ;Component operation
    call lp_init_ents($componentinfo($instname,”OUTERENTITIES”))
    end
    entry lp_init_ents
    params
    string p_entities : IN
    endparams
    variables
    string v_ent
    endvariables

    forlist v_ent in p_entities
    $collhandle(v_ent)->INIT()
    ; Consider processing errors, remember to ignore missing init operations.
    call lp_init_ents($entinfo(v_ent,”INNER”))
    ;If errors processed, in internal loop, pass back?
    endfor
    end

Leave a Reply