A global constant is a constant that you define once — manually or by calling an external script, Dynamic Link Library (DLL), or executable — and then use throughout AEC policy. Global constants apply to all rules in a policy. These constants can be used to implement a static text substring in multiple rules. The substring can be changed globally, making it unnecessary to modify many rules manually.
Global constants can be either static or dynamic. The value of static constants can be determined using the fields of an event. A dynamic constant can be configured to use an external script, DLL, or executable to return the constant value. The DLL is loaded periodically, and the specified DLL function is called to retrieve the constant value. In this way, constants that reflect the current state of the dynamically changing enterprise can be assigned.
As with user-defined dynamic tokens, the script or executable invoked must return a string in the format:
[input-string]\n[output-string]
where input-string is the string substituted in input events, and output-string is the string substituted in output events.
If you want to write a DLL function then it must be in Microsoft MFC/ATL. The function declaration is as follows:
bool DllFunc(CStringList *lpParams, int *nBufSize, CString *lpReturnString);
where the parameters are as follows:
In parameter. A cstring list of all parameters, specified during the creation of the global dynamic constant.
Out parameter. Return the length of the lpReturnString here.
Out parameter. Return the string here. This should be in the format Input\nOutput, as with the executables and scripts.
|
Copyright © 2010 CA.
All rights reserved.
|
|