Not sure if this goes in this forum or the Admin forum. At any rate I’m building a process to dynamically launch DI jobs from the command line. I’ve been working out how to programmatically create the equivalent of the parameters text file that the DI web admin creates when you export jobs. I’m doing that since we want to use different values for our global values. I’ve noticed that even though DI encrypts the parameters you can provide cleartext versions of them and it seems to work just fine.
For example, I have a global variable in the Job called $gSourceId, when I export the job via the web admin with a $gSourceId of 1, then I get the following value in the parameters txt file:
-GV"$gSourceId=2D750C5C345103;"
But if I edit that text file and replace the encrypted value with a cleartext value, i.e. -GV"$gSourceId=1;" It works fine, and I can put 2 or 4 or whatever there and it’s good to go.
So that’s cool, but I’m running into a problem when I’m try to do the same thing with dates. In DI web admin I’ll have a global variable $gEndDate and I’ll set it to something like to_date(‘12-JUN-2007 02:42:15’,‘DD-MON-YYYY HH24:MI:SS’). Again the value in the txt file is encrypted:
-GV"$gSourceId=2D750C5C345103;$gEndDate=274817731266032B0C3"
So I replace the source id and it’s fine, but when I start to mess with the $gEndDate DI totally throws up.
I get an odd error message:
4700 5932 REP-100108 8/30/2007 8:47:23 AM Initialization
4700 5932 REP-100108 8/30/2007 8:47:23 AM Cannot perform operation on repository because no connection has been opened.
Does anyone know what format it expects to receive dates in? Has anyone been able to do what I’m trying to do here? Thanks!
Thanks. That’s not quite what I’m going for though, I don’t think. I’m trying to dynamically create the txt file that has the parameters for the command line job execution. For a DI job I export from WEB admin there will be a .bat file that call AL_RWJobLauncher and passes in a .txt file as the C parameter that has the actual parameters in it.
I found I can skip the C and pass the parameter directly on the command line without the txt file just by putting all the contents of the text file in between quotes.
So the complete command line (some parts X’d out) would be:
That will run, but now I want to make it more dynamic. We have automated builds that run on many dev and test environments and we want to avoid the manual export via web admin in each environment.
So first I remove the encrypted txt file for data login information with the following parameters instead of -R"test_bodi.txt" :
-S"" -U"" -P""
That works fine, then I looked at replacing -G and the GUID with -s"". But unfortunately I found that -s is not fully supported
So I’ve written a function to pull the GUID for the repository. That piece is taken care of.
Now I’m trying to supply values for the global variables. In this job I have a number of global variables used to pass information between work flows, but I only need two prepopulated by the user (or automated test process) at run time, gSourceId and gEndDate.
Now there’s no problem replacing
$gSourceId=2D750C5C345103; with $gSourceId=1;
That works just fine. The problem is in replacing the date. In webadmin I just put the value to_date(‘12-JUN-2007 02:42:15’,‘DD-MON-YYYY HH24:MI:SS’) and it runs just fine. But I’m unsure rather the webadmin is interpreting that value before it generates the entry it in the parameters txt or if it’s just putting the string ‘to_date(‘12-JUN-2007 02:42:15’,‘DD-MON-YYYY HH24:MI:SS’)’ in an encrypted format in the parameter list.
At any rate, putting:
“$gSourceId=2D750C5C345103;$gEndDate=to_date(‘12-JUN-2007 02:42:15’,‘DD-MON-YYYY HH24:MI:SS’)”
does not work, which doesn’t surprise me, the originally value looked too small to be an encrypted text of the to_date call. So now I’m wondering what would work there?
I also do not fully understand what those last 2 -GV entries are:
-GV"D0F22683D735E6C5C6C5B7B4B794377457F4E7B5C705713577A3778" -GV"361B421B421B3B733B093D074A03396A391E376F16462E4B19;"
Are those something to indicate the global variables I left blank, or are they related to my $gEndDate entry.
If I can just resolve these two issues Ill have a full dynamic call, which will be VERY handy for us in both development and the testing.
p.s. I did set up all the paths to the AL_RWJobLauncher.exe and the log so they are dynamically built to, in case DI is installed in different directories in the different environments. Didnt address that above.
Every -GV entry will be concatenated and then used as one list a parameters. To enable passing double byte chars and special characters we do encode the values. But it is fine to use clear text as well like
I’ve tried that, but it doesn’t seem to work for me. I did notice I’m having a problem passing in char strings as well. I pass in something like this
-GV"$gSourceId=2;$gVXMLPath=‘c:\SVN2\VXML’"
And it errors out with the following:
5708 5188 PAR-010202 8/31/2007 11:07:55 AM Error parsing global variable values from the command line: <$gSourceId=2;$gVXMLPath=c:\SVN2\VXML;>. Please check the syntax
5708 5188 PAR-010202 8/31/2007 11:07:55 AM and try again.
So it has a problem with the ‘:’ either that is a special character and I need to escape it somehow, or the single quotes aren’t coming across in the command line call. I’m not sure if the error message would display the single quotes if they were coming across. When I use the web admin piece and export it it comes up with the following:
So it seems to be breaking the gVXMLPath into two parts. I tried the following:
-GV"$gSourceId=2;$gVXMLPath=‘c’" -GV"’:\SVN2\VXML’"
But got the exact same error, so DI was putting those fields together. I’m wondering if the problems isn’t with the single quote, if so it’s probably what is screwing up my to_date calls too. Has anyone else successfully passed char variables?
How about just passing the date as a string $gEndDate_str and then you convert it to your final $gEndDate using to_Date it in a script. Quicker workaround then solving the orig problem.
Okay, well I’m embarrassed to admit the issue ended up being something different all together. Sorry about that. I left out some information, cause I thought it wasn’t causing the issue, but I was wrong. We’re using ANT to automate builds and run nightly testing. It’s nice to have a complete automated end to end test to verify our mappings/models etc. are all correct.
Anyway, so the problem wasn’t in DI it was in how ANT was passing variables to the batch file it was using to call DI. It was a tricky thing, cause ANT would echo out the right values, so it looked like it was passing the values correctly, but somewhere in the call to the batch the apostrophes were getting lost.
For those interested, I tried every trick I could think or find on the internet, no escapes characters or double quotes were working. The trick that worked was creating a property in my local properties file that was just an apostrophe, then just using that properties reference anywhere I needed an apostrophe. So that solved both the date problem and the char problem. Lo and behold it all works now.
For clarity if you don’t mind could you post what you finally supplied in the text file to get this to work to enable proper date value handling and passing to the AL_RWJobLauncher.exe
Sorry! I was swamped with a customer issue, then out on a customer trip. What exactly were you looking for? The code to construct the al_engine.exe call is all in ANT, but the call it ends up making is something like that:
The hard part was getting the ANT to pass the right values, especially quotes to the cmd file. The key was just using a local properties file in ANT and referencing that. If you’re interested in that code, let me know, I can post that too.
I’m about 2 years late on this thread. But I’d be interested in the ANT code.
I’m going down the same path.
Also, wanted to know if you had any issues with using this is in automated build of a DEV environment - in other words, the jobs are just in DIDesigner…not scheduled or anything via management interface.
Hello RJones,
I know this is a very old post and not sure whether you are still active or not in this forum. You mentioned that you wrote a function to pull the guid from the repository. I am trying to get the guid from the BO DI repository. I have not been successful. I find the column GUID in AL_PROJECTS as null. I am using the BO DI 11.5.
Can you please help me in getting the guid from the repository?