Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 38 ActiveMatrix BusinessWorks Integration : Invoking a TIBCO BusinessEvents Rule Function from a Process

Invoking a TIBCO BusinessEvents Rule Function from a Process
To enable an ActiveMatrix BusinessWorks process to call a TIBCO BusinessEvents rule function, you need to configure an Invoke RuleFunction activity.
See Integration Components for an introduction to the integration features.
See Thread Management for important information about avoiding deadlock.
Be careful in using the ThreadLocal variable because the thread of execution may not be same as that in the prior activity.
Object support is not provided. You can't set Object in the scope of the rule function or as its return value. You must specify a specific type of TIBCO BusinessEvents object or a primitive (other than Object).
Specifying Input Arguments
All TIBCO BusinessEvents primitives (except Object) are supported. Appropriate boxing and unboxing of XML primitive types to TIBCO BusinessEvents primitive types is handled. For more details, see Chapter 20, Rule Language Datatypes.
You can pass null values. Select the argument in the Activity Input panel of the Input tab. Click the Edit Statement (exclamation point) button. In the Edit Statement dialog, Content tab, check the Set Explicit Nil checkbox. If xsi:nil==true, then a null is passed as the argument.
Base Concept and Base Event are supported as argument types. You must map a specific type to the base concept or base event. Open the Edit Statement dialog, and in the Type tab, check the Type Substitution check box. In the Type field, select XML Type Reference. Select a Schema and a Type.
Using Synchronous Invocation
Execution is synchronous. The process waits for the rule function to return a value. The rule function acquires a lock on TIBCO BusinessEvents working memory until the RTC cycle completes and then returns a value to the process.
You can use more than one Invoke RuleFunction activity in a process only if each uses a different agent. See Thread Management for more details.
Using the lockWM Parameter
By default the working memory is locked during the invocation (that is, the value is true). You can change this behavior by setting the lockWM parameter to false.
When you set the value to false, the rule function executes outside the context of the working memory.
The results must not modify concept instances or scorecards (as in the case of a preprocessor).
Set the lockWM parameter to false for optimization purposes only and use with care. Set it to false only if the call does not modify the working memory in any way. For example, use it to perform stateless calls or calculations, or to create new concept instances or events, or for lookups and so on.
Overriding the Rule Function at Runtime
You can override which function is called at runtime. To do so, enter a global variable as the value for rulefunction in the input tab. At runtime, you can specify a rule function with a different name but the same signature as the one specified in the activity's Configuration tab.
You can only use rule functions that are in the TIBCO BusinessEvents EAR file deployed for the integration project.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved