Do’s and Don’ts for Java Task
With the Java task you can use Java at the task level, however some restrictions and guidelines apply.
- The Java task code is meant to be used with synchronous code; if asynchronous code is used, it blocks the worker threading model of the process.
- Java files are to be created inside a Java source folder for TIBCO BusinessEvents to index it. Best practice is to create a package and not use the default package. Specify the Java file in the Java Resource field of the Java task.
- Without proper annotations, the Java code will not be recognized by TIBCO BusinessEvents. Only the methods that have proper annotations can be selected as Java resource.
- You can enter any names for your variables, but the variable types must stay consistent with what is provided in the annotations.
- Do not use the names of reserved words or existing packages as your variable names when combined with @BE Function annotation to catalog functions. Packages that are reserved include be.gen and com.tibco, which are TIBCO created classes and objects. After the code is compiled, it should not collide with any existing packages. For a complete list of all reserved words see TIBCO BusinessEvents® Architect’s Guide.
- Avoid static variables as they will be shared between different instances of tasks.
- Certain tasks causes the process to become dormant and are only meant to be evoked by external events.
- Practice caution when any threading operations are executed in the BPMN Java Task, as the code must be synchronous. Avoid using multi-threading between Java tasks.
- Ensure that the class that you write for the Java task is packaged into the be.jar file.
- Ensure that catalog names and Java task function names are kept separate.
Copyright © Cloud Software Group, Inc. All rights reserved.