Try OpenEdge Now
skip to main content
BPM Events User's Guide
Accessing Java objects and EJB components : Rule language extensions : Object instantiation
 

Object instantiation

As shown in Table 14, BPM Events uses a syntax that is similar to Java. Note that when invoking a Java object, BPM Events uses the full class name, prefixed by the adapter name, "java". The Java adapter is used for qualifying any Java call, and is an abstraction of the Java Virtual Machine (No actual adapter requires writing).
In the following example, a Java object of type Vector is created inside the function "gen()". The scope of the value identifier "vec" is the function only, but this function could return the new Vector object, which could be used inside rules that invoke this function.
Instantiation is possible in any bloc statement, that is, in functions, rule actions, or initialize{} and finalize{} sections. In the example below, new is a constructor operator that creates or instantiates the Java object called Vector().
application BP_test_suites
using java.util.Vector;
module jobj_event_test
fun gen(i: int){
    val vec = new ~Vector();
…}
Note: The "perform" action is still in use and is reserved for asynchronous calls. Do not use the "perform" action, as currently implemented, to access Java objects.