Python scripting OLP - Callbacks

IOlpEventRule

 

Kernel class callback

Operator class

Return value type

Default return value

Python script file name

PostExecute

CENPyOlpEventRuleOperator



 

%EventRuleName%.py

GetUniqueId


String

""

GetRuleProcessType


EventProcessType

EVENTPROCESS_NONE

GetInsertPosition


TPInsertPosition

TPINSERTPOS_INSERTNONE

GetActiveEvent


Int

0

GetVisibility


Bool

False

NeedSelection


Bool

False

GetSelectability


Bool

False

HasDefault


Bool

False

 

[Example]

 

from centypes import *

 

def GetUniqueId():

   return "F8FA5044-2109-447C-ABF9-3D89AB910451"

   

def GetRuleProcessType():

   return EVENTPROCESS_RETRACT

 

def GetInsertPosition():

   return TPINSERTPOS_INSERTAFTER

 

def GetActiveEvent():

   return 0

 

def GetVisibility():

   return True

 

def NeedSelection():

   return True;

 

def GetSelectability():

   return True;

 

def HasDefault():

   return True;

 

def PostExecute(reo):

    tpes = reo.FindTpElementsByType(EVENTPROCESS_INPROCESS)

    for x in tpes:

        reo.AddTpe(x)


Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante