What the equivalent of GPE = 1 in Class ?

SUGGESTED

Hello, 

Using classic object, it's possible to use GPE = 1 in a specific process (a standard $ACTION-CREATION, MODIF.... ) ) to deactivate the standard action. 

What will be the equivalent in Class to pass by the standard $EVENTS? if possible? 

As an example, shipment class is having 2 processes:

  • SHIPMENT_CSTD
  • SHIPMENT1_CSPE

We can configure CSPE to be executed before CSTD (by changing the execution order). ok
Then, what needs to be done in CSPE, if we want to deactivate one EVENT in particular (ie AINSERT_CONTROL_BEFORE) to be executed from CSTD? 



One "possible" option will be to remove CSTD process from the class and to have a redirection in the CSPE like : 

$EVENTS
    If [L]CURPTH ='' and [L]AEVENT = 'AINSERT_CONTROL_BEFORE'
        # do what needed
    Else
        Gosub EVENTS from SHIPMENT_CSTD
    Endif
Return
$METHODS
    Gosub METHODS from SHIPMENT_CSTD
Return
$OPERATIONS
    Gosub OPERATIONS from SHIPMENT_CSTD
Return
$PROPERTIES
    Gosub PROPERTIES from SHIPMENT_CSTD
Return

I am not a big fan.
Do we have a better solution?

Note: 

  • I know this kind of modification can be risky.
  • I don't have a particular case to apply, I am just curious if we have a way to do so.

Thank you

  • 0
    SUGGESTED

    The order of execution is set on the class definition, the field called "Running order" or in you screenshot "Ordine di esecuzione". The list, as show in the class definition, is loaded and set in context variable "this.AINF.PTH" or "[V]GACTX.AINF.PTH" with PTH having dimension 1.. maxtab(this.AINF.PTH).

    Using your example:

    this.AINF.PTH(1) = "SHIPMENT1_CSPE"

    this.AINF.PTH(2) = "SHIPMENT_CSTD"

    The execution of the process attached to the class is done using a For execution loop, thus a single break statement in your *CSPE process will prevent further execution in the other class process files.   

  • 0 in reply to Regard Hulsbos

    Hello,

    Ok. I see. 

    Thank you