Product Documentation
Virtuoso Studio Design Environment SKILL Reference
Product Version IC23.1, November 2023

ddRegTrigger

ddRegTrigger( 
t_triggerName 
s_triggerFunc 
[ x_priority ] 
) 
=> t / nil 

Description

Registers a function to be called when the triggering event occurs. Adds callbacks (triggers) to PI functions that change things. Each of these PI functions has a pre-trigger and an post-trigger.

Functions you attach to a pre-trigger are passed the same arguments that were passed to the associated PI function. Functions you attach to a pre-trigger should be written to return either t or nil. If the value is nil, no further trigger functions are called, and the associated PI function will be canceled.

Functions that you attach to a post-trigger will be passed the same arguments that were passed to the associated PI function, and in addition, the last argument will be the value to be returned by the PI function. Post-trigger functions must be written to return void.

Arguments

t_triggerName

The trigger you wish to attach a callback to.

Valid Values:
PI function Pre-Trigger name Post-Trigger name

ddUpdateLibList()

“PreUpdateLibList”

“PostUpdateLibList”

ddGetStartup()

“PreGetStartup”

“PostGetStartup”

ddDeleteObj()

“PreDeleteObj”

“PostDeleteObj”

ddCreateLib()

“PreCreateLib”

“PostCreateLib”

ddGetObj()

“PreCreateObj”

’PostCreateObj”
“FirstAccessLib”

ddCheckin()

“PreCheckin”

’PostCheckin”

ddCheckout()

“PreCheckout”

“PostCheckout”

ddAutoCheckout()

“PreAutoCheckout”

ddGetObj calls triggers when it creates an object and the first time it accesses a library in the library list.

The names are case insensitive.

s_triggerFunc

The function you want to have called back when the trigger is activated.

x_priority

The order in which functions are called after they have been registered as triggers. Priority is an integer in the range ( 0 <= priority <= INT_MAX ).

Functions that have the same priority are called last-registered, first called-back. Triggers that have lower priorities are called-back before triggers that have higher priorities. The default priority is INT_MAX.

Value Returned

t

The function was successfully registered to trigger when the event occurs.

nil

Execution of the function failed.

Examples

ddRegTrigger( "PreCheckin" ’checkinTrigFunc 0 ) 
=> t 

Additional Information

Application programs need to react when certain changes occur to library objects. The DFII software lets you register a SKILL function to be called (triggered) when certain changes either have just occurred or are about to occur for library objects.

Do not call functions from within the registered functions that might cause an infinite loop. The trigger code that calls back to the DFII environment can have serious side effects. The only operations done by a trigger such as PreObjAccess or PreAutoCheckout should be calls to services outside of the DFII environment. The capability described here is only an enabling feature; Cadence cannot take responsibility to debug any user trigger code unless the problem lies within the DFII environment that is enabling the integration.

Use the registration function, ddRegTrigger, to register a function to be called for any kind of triggering event.

For example, to register the function exampleCheckinCallback to be called when any cellview version is checked in,

ddRegTrigger( "PostCheckin" ’exampleCheckinCallback )

You can register many functions to be called when an event occurs. When several functions are registered for the same event, you can set the order called using the priority argument of ddRegTrigger. Triggers that have lower priorities are called back before triggers that have higher priorities. Each function registered for a single triggering event must have a unique name. If you try to register a function with the same name as one already registered, the registration function returns nil and the original function remains registered.

Having unnecessary functions registered can slow down performance. Un-register functions that are no longer needed. The ddUnregTrigger function un-registers a trigger.

A trigger that calls registered functions before the object is changed is called a pre-trigger. A trigger that calls the registered functions after the object is changed is called a post-trigger.

Pre-triggers are created to prepare information or the user environment and are allowed to cause the function to fail, preventing execution of the body of the function. Post-triggers may not cause the function to fail and are expected to handle cleanup of user data or other bookkeeping tasks.

Functions you attach to a pre-trigger are passed the same arguments passed to the associated PI function. Functions that you attach to a pre-trigger should be written to return either t or nil. If the value is nil, no further trigger functions are called and the associated PI function is canceled.

Functions you attach to a post-trigger are passed the same arguments passed to the associated PI function. In addition, the last argument is the value returned by the PI function. Post-trigger returns are ignored with the exception of the First Access Lib Trigger, which must return t or nil.


Return to top
 ⠀
X