Focal Point
[SOLVED]Setting a variable dependent on APP Path

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/5637018486

December 06, 2016, 11:33 AM
slee
[SOLVED]Setting a variable dependent on APP Path
I am trying to create a pseudo development environment in DataMigrator by maintaining a set of production folders and development folders. The development folders will be hold the same copies of flows, synonyms, etc as the production folder, however, we'll need to point the development flows and synonyms to our development system. The various table names and file paths will all the be the same except for a different prefix that'll denote we're accessing resources on our dev environment.

I'm trying to set up variables in my synonyms to act as a dynamic prefix that'll automatically assign the correct development or production prefix to the synonym. I am able to successfully concatenate a variable and the table name, however I need some help in figuring out how to assign the value to the variable depending on whether the app path is the development or production folder. Anyone have any experience with this?

Thanks,
Susan

This message has been edited. Last edited by: Tamra,


DataMigrator 7.7.06
Windows Server 2012
December 14, 2016, 11:57 AM
Tamra
Here is an idea from the WebFOCUS forum
Change APP PATH on the fly

If you have synonyms in a "prod" folder and in a "dev" folder, then you can change the APP Path to the one that is required.


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
December 15, 2016, 10:34 AM
Tamra
When you build flows, the app path is assigned to the objects (tables, stored procs and sub flows).

Please review the following suggestions....

1) Set the variable in the user profile => you have to have a development specific user id. You can set the production variables in the server profile, and user the user profile to override it for development.

2) Use APP MAP to point to separate meta-data directories (also done in the user profile)

edasprof:
APP MAP meta /apps/prod/metadir
APP PATH meta flows ...

dev-user-profile:
APP MAP meta /apps/dev/metadir
APP PATH meta flows ...

Please let us know if this provides you with the assistance you need to move forward.

Thank your for participating in the Focal Point Forum,
Tamra Colangelo
Focal Point Moderator
Information Builders


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
December 15, 2016, 11:06 AM
slee
Thanks for your replies Tamra. Unfortunately, I've tried multiple variations of what you suggested to no success. I can't remember what all the issues were with those solutions, but I think the primary issue was that we still needed to have those development flows run on a schedule, and I wasn't able to figure out a way to have the DM Scheduler pick up both the schedules of our production and development apps and their profile specific assignments when using multiple users.

We were able to solve our issue by spinning up another DM server.


DataMigrator 7.7.06
Windows Server 2012
December 16, 2016, 08:38 AM
dhagen
Look into using CMRUN command line program to schedule your development jobs. It allows you to specify the user.

It is intended to be used with third party schedulers, but you can create a stored procedure in DM and call the CMRUN from there using the OS shell syntax:
! CMRUN ....  


You can schedule the stored proc like any flow.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
December 16, 2016, 10:04 AM
Marina
quote:
I'm trying to set up variables in my synonyms to act as a dynamic prefix that'll automatically assign the correct development or production prefix to the synonym. I am able to successfully concatenate a variable and the table name, however I need some help in figuring out how to assign the value to the variable depending on whether the app path is the development or production folder.


You can set a global variable in your server profile (edasprof.prf) or on a user profile.
One example solution as the following.

If you have a development and production on different machines then you can use the code as the following:
-SET &&MYCOMP=FGETENV(25, COMPUTERNAME, 25, 'A25');
-TYPE &&MYCOMP
-IF &&MYCOMP CONTAINS 'BOX2' THEN GOTO TESTBOX ELSE GOTO PRODBOX;
-TESTBOX
-TYPE *** here I am at the TEST machine ***
-EXIT
-PRODBOX
-TYPE *** here I am at the PRODUCTION machine ***
-RUN

If you have a development and production on the same machine - on a different directory path - then you can use the same technique. Only, instead of the COMPUTER name use the directory path; for example, using the environment variable EDAHOME:
-SET &&MYAPPROOT= FGETENV(50, 'EDAHOME', 50, 'A50');
-TYPE &&MYAPPROOT ---