Hi John,
When we create an application, we name it with a generic name say APPLICATION_X
For different environments like DEV, QA, PROD etc we use the event prefix to drive it.
So you could use Strings like DEV, QA, PROD or numbers that represent each environment like 300 = DEV, 200 = QA, 100=PROD etc
The %(APPL._eventprefix) variable.
When you define your event, down in the left corner where you add event etc, you can define the event prefix.
Normally the event is given the users name as the event prefix, so override it and set it to something else.
If you have saved it prior to changing, you will need to delete that event and add a new event.
Then at run time you can define your APPL to be named say %(APPL._eventprefix)_APPLICATION_X
This could translate into DEV_APPLICATION_ or QA_APPLICATION_X or PROD_APPLICATION_X
or
300_APPLICATION or 200_APPLICATION or 100_APPLICATION
Numbers corresponding to envs allows for greater number of envs.
This can also tie into your global variables where you can define connection strings for each environment etc.
user names & passwords etc etc. Use %APPL.<GLOBAL_VARIABLE> loaded based on context.
You can define a global variable say called EnvType for each, named say "DEV", "QA" or "PROD"
You can reference this in email notifications etc by %APPL.EnvType
Just ensure you set load javascript at runtime within the APPL.
Or you can write some Javascript like this to leverage.
loadContext(APPL,'%APPL._eventprefix');
<-- HERE you specifically load the EVENT PREFIX VARIABLES ONLYswitch (parseInt(APPL._eventprefix)) {
case 100:
APPL.envType='PROD';
break;
case 201:
APPL.envType='STAGING';
break;
case 200:
APPL.envType='QA';
break;
case 300:
APPL.envType='DEV';
break;
case 400:
APPL.envType='STG';
break;
case 500:
APPL.envType='XYZ';
break;
default:
APPL.envType='UNKNOWN';
Jobs
As for the jobs, I leave those named the generically, no event prefix in those.
You could set with event prefix too I guess, I just don't as I track by Application
In the CA WA DB you will can select Applications by name i.e. DEV_APPLICATION_X and then linked to the ESP_GENERIC_JOB table by APPLICATION_ID
I hope this is useful.
Thanks
Original Message:
Sent: 09-29-2020 09:49 AM
From: John Wright
Subject: Using variables when defining jobs
Is there a way to change the default job name from unjx_1 to %(jp)%var1.%var2.%var3._00010 (increment the step# by 10 for each job) ?
I am trying to code an application once, for use in each environment by using the event prefix to set the jp (job prefix) to P or Q or T, and use javascript in the appl to set var1, var2 etc.
If anyone is doing something like this, can you show me how you coded everything?