The TIBCO Platform is a real-time, composable data platform that will bring together an evolving set of your TIBCO solutions - and it's available now!
A chart showing the TIBCO Platform vision
Jump to content
Articles
Read more about TIBCO use cases, product features, capabilities and more
  • BW6.X - BWCE - How to access property values in mappings in BusinessWorks and BusinessWorks Container Edition


    This article is to explain how to access both Module property values and Java property values in a BusinessWorks mapping.

    Module properties

    There are two kinds of module properties some are defined by the application developer and some are predefined in BusinessWorks.

    The module properties defined by the application developer are managed in the ‘User’ tab of the Module Properties:

    1*UHrRiXKJEg1GDni67UGy0g.png

    The predefined module properties are visible in the ‘System’ tab of the Module Properties:

    1*_liB_wIG2u3v75Wc9WP95Q.png

    The value of a given module property can be accessed in a mapping using the following XPATH function:
    bw:getModuleProperty()

    For example to access a property called ‘MyProperty’ that is part of a group called ‘Service’ you have to use the following XPATH formula:
    bw:getModuleProperty(“/Service/MyProperty”)

    1*d1kgWtYWdOWJbuwnte5wHg.png

    Similarly, this function can also be used to access the predefined properties.

    For example, to access the property ‘BW.APPNODE.NAME’, that contains the name of the appnode hosting the application, have to use the following XPATH formula:
    bw:getModuleProperty(“BW.APPNODE.NAME”)

    1*GUnAUlAwaxgYrhrHjZhkLg.png

    Note that the deployment unit name and version are the name and version of the running application.

    It is also possible to access properties defined in Shared Modules using the following syntax:

    bw:getModuleProperty(“//<Shared Module Name>///<GroupName>/<PropertyName>”)

    For example to access the value of the property “MsgLabel” part of the “SMProperties“ group of the “MySharedModule” Shared Module you have to use the following syntax:

    bw:getModuleProperty(“//MySharedModule///SMProperties/MsgLabel”)

    1*GCwVx3RCvDL0jO7nU02QzQ.png

    In case there are multiple group levels the name of each sub-level should be included like this:
    bw:getModuleProperty(“//<Shared Module Name>///<GroupNameLevel1>/<GroupNameLevel2>/<GroupNameLevelN>/<PropertyName>”)

    For more details you may refer to the following KB article:
    https://support.tibco.com/s/article/Tibco-KnowledgeArticle-Article-46830

    Note that starting from BusinessWorks 6.10 it is possible to directly use Module Properties in Mappings (with the limitation that in case the name of a property would change the developer would have to update the impacted mappings manually). Module Properties are available in the DataSource tab of the Mapper, you can select a property and drag and drop it in the target field, this automatically creates an XPATH formula using the getModuleProperty() function to access the property value.

    1*NEg5WziWWHTZWJDMBba4gw.png

    System properties

    System properties are in fact the Java properties defined by default in Java or defined in the appnode tra file or config.ini file.

    The value of a given system property can be accessed in a mapping using the following XPATH function:

    bw:getSystemProperty()

    The values of the following java system properties are accessible using this approach:
    file.encoding
    java.version
    user.home
    os.name

    For example to access the Java property ‘java.version’ you have to use the following XPATH formula:
    bw:getSystemProperty(“java.version”)

    The values of the properties defined in an appnode tra file or config.ini file, can also be accessed using this function but for some properties it is only working in deployed mode.

    For example to access the appnode Java property ‘logback.configurationFile’ you have to use the following XPATH formula:
    bw:getSystemProperty(“logback.configurationFile”)

    1*2qYiebrYX1NlGOatx50SEQ.png
     
     
    Additional elements
     
    A sample project is attached.
     

    AccessSystemProperties.zip

    • Thanks 1

    User Feedback

    Recommended Comments

    In BW5 we have global variables but in BW6 we dont have global variables instead we have module and process properties.

    when we are importing a project from bw5 to bw6 it says global variables are imported as module and process properties.

    But i feel there is a lot of difference between them.

    Global variables in BW5 can be used across multiple projects on any process definition across the workspace.

    Module properties are limited to Application module level ( of course module can contain multiple process) ., but in the same workspace if a different application is created then module properties created in one module cannot be extended to another module. Here in this case Global variables is not matching the criteria as in BW5.

    So we can say Module properties cant be global variables.

    similarly process properties concept is also similar to Module properties and it cannot extend beyond processes. so we can say process properties cant be global variables.

     

    Kindly clarify.

    Link to comment
    Share on other sites

    Hi Pranay,

    Thanks for your question.

    I'am sorry but in BW 5.X Global Variables are only available within a project. The way to use Global Variables across multiple projects is to define them in a DTL.

    In BW 6.X this is the same, to use the same properties in multiple applications you need to define the properties in a Shared Module and refer to the Shared Module from the applications.

    I hope this is useful.

    Regards
    Emmanuel

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...