Details
Accessing module level properties from java code by using @ModuleProperties results in nullpointer exception. It happens due to misconfiguration. Please follow the steps as mentioned in the resolution to overcome configuration issue.
Resolution
1. Create a Simple project and define some module level properties
2. Convert the project into a java project
3. Create a java class.
4. Open the module dependencies
5. Add the following class in the dependency com.tibco.bw.palette.shared.java
6. After selecting it, save the project.
7. Open up the class "AccessModuleProperties" and copy paste the following content.
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import com.tibco.bw.palette.shared.java.M oduleProperties;
public class AccessModuleProperties { HashMap map=null;
public AccessModuleProperties() {
; }
@ModuleProperties
public void setProperties(HashMap maptmp)
{
System.out.println("called");
System.out.println(maptmp.size());
map=maptmp; }
public void printProperties()
{
Iterator it =
map.entrySet().iterator(); while (it.hasNext()) {
Map.Entry pair = (Map.Entry)it.next();
System.out.println(pair.getKey() + " = " + pair.getValue());
}
} }
8. Create a java global instance
9. Choose the class and the constructor as follows
10. Create a simple process with timer to test the configuration. Add java invoke and configure it as follows
11. Run the project and it will print all the module level properties as follows
Reference
https://docs.tibco.com/pub/active matrix_businessworks/6.4.0/doc/ht ml/GUID-0789354B-8A60-4E70- B492-5E155FE18D6F.html
Feedback
BW6 AS plug-in 4.x 연동하기 (0) | 2020.04.30 |
---|---|
TIBCO BW6 6.6 install with eclipse lgpl (0) | 2020.04.03 |
BusinessWorks REST Resource (0) | 2019.09.19 |
EMS custom properties 사용 (BW6) (0) | 2019.09.19 |
BW6 property 사용 (0) | 2019.09.16 |
댓글 영역