Startup rule functions are optional and are used to initialize the system. For example they can provide initial values for scorecards. Startup rule functions can be used to perform more "expensive" operations so that the system is more efficient at runtime. For example, in a startup rule function you might load specified entities from the backing store to the cache.
Startup rule functions may trigger rule actions. However, note that TIBCO BusinessEvents executes all startup rule functions before it begins the first RTC cycle, which completes when all rules eligible to execute have executed and no more actions remain.
Shutdown rule functions are optional and are used to perform various actions during a normal shutdown, for example, they can send events to external systems.
However, if recovery is from a situation that does not involve node failure, then startup actions do not execute. For example, the network connection goes down. The agent becomes inactive and fails over to another node. The connection is restored. The agent becomes active again, but does not restart. Startup functions do not execute on the node that became active again.
Startup (and shutdown) rule functions execute in all active agents. When multi-engine (multi-agent) functionality is used, ensure that multiple agents do not attempt to create the same entity. See
Designing for Concurrency for more information.
In ActiveMatrix BusinessWorks integration projects, if ActiveMatrix BusinessWorks is running as the container, do not specify any startup actions that result in starting or invoking an ActiveMatrix BusinessWorks process.
Note that after the ActiveMatrix BusinessWorks engine is initialized, processes that invoke TIBCO BusinessEvents rule functions will fail if the TIBCO BusinessEvents engine has not finished starting up. For example, an ActiveMatrix BusinessWorks process that listens to a JMS queue may attempt to invoke a TIBCO BusinessEvents rule function before the TIBCO BusinessEvents engine has started up.