cancel
Showing results for 
Search instead for 
Did you mean: 

Using Environmental variables in paths

Former Member
0 Kudos

Hi all,

I'm trying to see how I can get Powerdesigner to reference Environmental variables for a few of the fully qualified path names found in the .pdm files.  For example, suppose my file is called somedesign.pdm and it is located in a directory called v:\xxx\yyy\zzz. Then, in the somedesign.pdm I find 2 lines.

1) GenPathName=v:\xxx\yyy\zzz\

2) <a:RepositoryFileName>v:\xxx\yyy\zzz\somedesign.pdm</a:RepositoryFileName>

I believe this is defined by saving the file.  I can see it in the "Model Properties"."File Name:" dialog.


Is there a way to define an environmental variable, lets say I define it "PD_TOPLEVEL_DIR=v:\xxx" and then have these variables show up as

1) GenPathName=v:\xxx\yyy\zzz\

2) <a:RepositoryFileName>v:\xxx\yyy\zzz\somedesign.pdm</a:RepositoryFileName>

Accepted Solutions (1)

Accepted Solutions (1)

former_member192453
Active Participant
0 Kudos

Hi Galen

Have you tried using and/or setting Environment Variables or Named Paths via the Tools ->General Options menu? If so, did you try referencing your command by prefixing it with a dollar sign and then enclosing it within percent signs?

Anthony

Former Member
0 Kudos

Hi Anthony,

I'm not trying to run scripts here.  I'm trying let where the models sit be relative based on an environmental variable.  This seems to be controlled by saving the model.  I'd like to see if I can get it to honor an environmental variable when saving, or let me modify it to use an environmental variable when saving the model.  We use clearcase as our source control.  This means when I'm working on a model my file is v:/e528294_db_green/aaaa/  but my peer's model directory would be v:/e123456_db_blue/aaaa.  If I get his changes from clearcase, PD would have a different value for those 2 variables than I would need.

Its clear in the some_design.pdm file.  The variables are there and hard coded to directories.

former_member192453
Active Participant
0 Kudos

Hi Galen,

It appears that your are describing 'Named Paths'.

From each PD client, you create a Named Path Variable with the same name, but define a different path for each instance. When you save the model in this directory, the path variable is saved within the model.

For example

My PC:

Create the following Named Path variable

ClearCase= v:\e528294_db_green\aaa

Your PC

Create the same Named Path variable but with a different path

ClearCase = v:\e123456_db_blue\aaa

If the model is saved from either PD client, the value stored within the model would be %ClearCase%\MyLocal.pdm. Therefore, when either user opens the model, the path variable is resolved.

For the Named Path variables the path will need to reference a windows drive or network share.

Since you mentioned Clearcase, I ran a search and there is an open enhancement to save (check in/out) models to clearcase. At this time no decision has been made regarding this request.

Anthony

Former Member
0 Kudos

Hi Anthony,

That was what I was looking for.

Thanks!

Answers (1)

Answers (1)

Former Member
0 Kudos

Oops, need to amend the final question.

Is there a way to define an environmental variable, lets say I define it "PD_TOPLEVEL_DIR=v:\xxx" and then have these variables show up as</>

1) GenPathName=%PD_TOPLEVEL_DIR%\yyy\zzz\

I gave up on rewriting #2 The HTML interface for editing did not allow me to cut and paste the greaterthan lessthen sign. Hopefully you understand I would like both lines to be affected properly