|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |
The Java Code and Java Method activities both execute Java. Therefore, there are some features that both activities share. This section describes some of the common features between the two activities.You can use the com.tibco.pe.plugin.PluginProperties.getProperty() method to retrieve any Java system property or global variables defined in your project.Global variables are contained in Java System properties that are prefixed with tibco.clientVar. For example, if you define a global variable named myVar, you can access the value of the global variable with the following Java code:You must specify the full path for global variables contained in variable groups to access the variable’s value. Use the slash character (/) to separate each element in the path. For example, if you have a global variable named item1 contained in a group named myGroup, you can access the value of the global variable with the following Java code:Any Java System property can also be accessed with the PluginsProperties.getProperty() method. Supply a string containing the property name as the input parameter to the method to obtain the property’s value.
The com.tibco.pe.plugin.PluginProperties class is contained in the lib/engine.jar file within the TIBCO ActiveMatrix BusinessWorks installation directory. This directory is in the TIBCO ActiveMatrix BusinessWorks classpath, and therefore Java Code activities can compile code referencing this class. If you compile your code outside of TIBCO ActiveMatrix BusinessWorks, you must ensure your development environment has access to theengine.jar file.The standard log4j logging service is available for components of TIBCO ActiveMatrix BusinessWorks. See TIBCO ActiveMatrix BusinessWorks Process Design for more information about using the BusinessWorks log4j properties file.Code in the Java Code or Java Method activities can send messages to the log4j file by using the bw.logger class. For example, the following code obtains the bw.logger class and uses the class to send a message to the log file.If you use your own logger class, you can configure the BusinessWorks log4j properties file to include your logger. This involves adding log4j.logger and log4j.appender properties to the properties file. See the log4j documentation for more information about log4j properties. Once the properties for your custom logger class are added to the BusinessWorks log4j file, you can obtain your logger class and write messages to the log file in your Java Code and Java Method activities.
|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |