Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content

Accessing Module properties in Java Global Instance in BW 6.4 or BWCE


Recommended Posts

Has anyone tried to pass the parameters to the java global instance(java method which is called by java global instance) through module properties in tibco bw 6.4 or tibco bwce In documentation it is mentioned that:

1) In the TIBCO BusinessWorks Container Edition module, specify a dependency on the package "com.tibco.bw.palette.shared.java" usingImport-Package.

Double-clickDependencieslocated underBusinessWorks Container Edition Module>Module Descriptors. This opensBW Manifest Editor.

In theImported Packagessection, click theAddtab to add the dependency on thecom.tibco.bw.palette.shared.javapackage.

2)Add the@ModulePropertiesannotation to the method that accepts only one parameter of typejava.lang.HashMap.

Through this HashMap you can access the name or value pair of BusinessWorks Container Edition module properties.

It doesnt seems to be clear from the documentation. Any help or sample code as an example provided will be appreciated. Thanks in advance

Link to comment
Share on other sites

  • 1 month later...

I had the same issue and this is what I used to get it working.

First I followed the steps fromt he documentation:

https://docs.tibco.com/pub/activematrix_businessworks/6.4.2/doc/html/GUI...

Specifically adding the package to the import.

Then I added the following method to my class.

 

@ModuleProperties

public void loadProperties(HashMap moduleProperties){

System.out.println("Started loading module properties.");

this.myClassProperty = moduleProperties.get("/path/to/bw6/CaseSensitive/moduleProperty");

System.out.println("Completed loading module properties.");

}

What it does is load the module properties into the class. I use them to transfer the module properties to class properties. This method is called by the BW engine when it instantiates the Global Instance (twice, it seems, for some reason. I added to System.out calls to see if the method gets called).

While this works as intended I do find it strange that TIBCO didn't provide the option to select module properties as the input for parameters in the Java Global Resource editor. Perhaps something to post on ideas...

Link to comment
Share on other sites

  • 2 weeks later...

If we set the myClassProperty to static in the below code snippet then it will be accessible across the instances,regardless how many objects are created.

 

@ModuleProperties public void loadProperties(HashMap moduleProperties){ System.out.println("Started loading module properties."); this.myClassProperty = moduleProperties.get("/path/to/bw6/CaseSensitive/moduleProperty"); System.out.println("Completed loading module properties."); }

Link to comment
Share on other sites

  • 1 year later...

Do you have an working example to the path to the module properties

 

(this.myClassProperty = moduleProperties.get("/path/to/bw6/CaseSensitive/moduleProperty");

 

below is my code that not working

 

argUserName = moduleProperties.get("/Ent-Integration/iSeriesConnectionFactory/userid");

 

 

Link to comment
Share on other sites

×
×
  • Create New...