Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise Design Integration Forum Variable load order of CSB variables and cfg files
    • Sign In

    • State Verified Answer
    • Replies 1 reply
    • Subscribers 61 subscribers
    • Views 401 views
    • Users 0 members are here

    Variable load order of CSB variables and cfg files

    Joel Zimmerman
    Offline Joel Zimmerman 11 months ago

    I would like some clarification on setting variables in CSB and cfg in the CONNECT Edition WorkSpace/WorkSet configuration in ProjectWise.

    The load order of Managed CSBs are:

    1. Predefined

    2. Global

    3. etc...

    At any point in the CSB a cfg file is evaluated due to a variable being set in a CSB.

    So when in the Predefined CSB a variable is set for _USTN_CONFIGURATION to the WorkSpace folder the WorkSpaceSetup.cfg file is loaded.

    In the WorkSpaceSetup.cfg file the _USTN_WORKSPACESROOT variable is referenced to set the _USTN_WORKSPACEROOT value.

    The _USTN_WORKSPACESROOT variable is populated in the WorkSpace Managed CSB which is loaded after the Predefined CSB and then the WorkSpaceSetup.cfg?

    If everything is loaded in order, the WorkSpaceSetup.cfg won't know the value of _USTN_WORKSPACESROOT because it won't load until the WorkSpace Managed CSB is loaded?

    Thanks,

    Joel

    • Sign in to reply
    • Cancel

    Top Replies

    • Kevin van Haaren
      Offline Kevin van Haaren Wed, Dec 28 2022 4:17 PM +1 verified
      The _USTN_WORKSPACESROOT variable is populated in the WorkSpace Managed CSB which is loaded after the Predefined CSB and then the WorkSpaceSetup.cfg? If everything is loaded in order, the WorkSpaceSetup…
    • Kevin van Haaren
      +1 Offline Kevin van Haaren Wed, Dec 28 2022 4:17 PM

      The _USTN_WORKSPACESROOT variable is populated in the WorkSpace Managed CSB which is loaded after the Predefined CSB and then the WorkSpaceSetup.cfg?

      If everything is loaded in order, the WorkSpaceSetup.cfg won't know the value of _USTN_WORKSPACESROOT because it won't load until the WorkSpace Managed CSB is loaded?

      Kind of. There are 2 ways to refer to the value of a variable: in parenthesis $(VARIABLE_NAME) and braces ${VARIABLE_NAME}. When parenthesis are used microstation retains the $(VARIABLE) structure and doesn't substitute the value in place until the variable referring to it is used. So as the config files are loaded and microstation has:

      _USTN_WORKSPACESROOT : $(_USTN_CONFIGURATION)WorkSpaces/
      _USTN_WORKSPACEROOT  : $(_USTN_WORKSPACESROOT)$(_USTN_WORKSPACENAME)/

      It'll remember that _USTN_WORKSPACEROOT is $(_USTN_WORKSPACESROOT) and $(_USTN_WORKSPACENAME) but even though _USTN_WORKSPACENAME isn't set yet it keeps processing. Then when MicroStation finally goes to load it looks at the _USTN_WORKSPACEROOT variable and now _USTN_WORKSPACENAME IS defined so it substitutes it in and the variable points to the correct location.

      So by using $(VARIABLE_NAME) MicroStation will re-evaluate the variable everytime it's used and use the current values of whatever variables are used in the definition.

      (Braces, by the way, mean 'do the substitution right now, and don't remember the source' so _USTN_WORKSPACEROOT = ${_USTN_WORKSPACESROOT}${_USTN_WORKSPACENAME}/ would fail the way you mention)

       

      Answer Verified By: Joel Zimmerman 

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies