I thought today, I would do a little follow-up post, based on a question from one of our commenters. The question was, “How do we automate blends and backups using the batch client?”. As we saw from an earlier post, configuration files allow some flexibility when setting up DRM automations. Let’s walk through a simple scenario where we can use configuration files to do these 2 tasks:
- Backup a version
- Blend an existing version into the current version
Version Variables
Before, we go too far, I should probably underscore the importance of setting version variables, to make your automations simpler.
For instance, in the example below, the “xtest” version is set to be the current version.
Archive Versions
In order to perform a backup of a version, you need to first set up a backup location, to archive off the file. This is done by setting up an external connection to a network share.
The connection I used, is just a shared drive. Make sure to provide a UNC path, as seen in the example below.
Now that we have a location for our backup, let’s get to setting up a simple configuration file. In this example, I am setting up separate configuration files for backups versus blends. But, it’s up to you, if you want to group all actions into one or multiple.
The “Backup_Versions.cfg” file below shows 3 actions:
- Close the current version: I think it’s a good idea to unload the version, so that no one’s doing any work on it.
- Backup the version: in this example, to a file called “Current_Version.dat.”
- Reopen the version.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
[General] Operation=Multiple [Operations] OperationCount=3 Operation1=CLOSE_CURRENT Operation2=BAK_CURRENT Operation3=OPEN_CURRENT [CLOSE_CURRENT] Operation=CloseVersion VersionAbbrev=Current_Version [BAK_CURRENT] Operation=BackupVersion VersionAbbrev=Current_Version Connection=DRM_ARCHIVES FileName=Current_Version.dat [OPEN_CURRENT] Operation=OpenVersion VersionAbbrev=Current_Version |
Blend to the Current Version
Assuming (of course!) that you’ve set up your blends in DRM, you can set up a simple configuration file, as seen below. More actions can be added, if needed.
Note that we are using a version variable for the “TargetVersionAbbrev” parameter.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
/*** Script sets up DRM blends. ***/ /* General section. */ [General] Operation=Multiple /* # of operations to be performed. Update Count and Operation when a new one needs to added. */ [Operations] OperationCount=1 Operation1=BLN_BEERS /* Blends Beers hierarchy into the Current_Version. */ [BLN_BEERS] Operation=Blend BlendName=BLN_BEERS SourceVersionAbbrev=MA_BEERS TargetVersionAbbrev=Current_Version BlendLogFileName=D:\Admin\Logs\Blend_Beers.log |
The Script
All we need to do now, is to wrap all this into a little batch script. Note, I am not doing any error checking. In fact, I strongly recommend doing some (note to self, post on error trapping) to perform branching and exit conditions. BTW, this is my folder structure:
All we need now, is a simple batch script.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
:: Set variables SET DRMCLIENT=D:\Oracle\Middleware\EPMSystem11R1\products\DataRelationshipManagement\client\batch-client SET DRMUSER=unlk_admin SET DRMPWD=blah123 SET DRMURL=net.tcp://localhost:5210/Oracle/Drm/ProcessManager SET SCRIPTDIR=D:\Admin :: Archive current version call %DRMCLIENT%\drm-batch-client.exe /u=%DRMUSER% /pw=%DRMPWD% /url=%DRMURL% /cfgfile=%SCRIPTDIR%\Definitions\Backup_Versions.cfg /log=%SCRIPTDIR%\Logs\Archive_Version.log :: Blend version to current call %DRMCLIENT%\drm-batch-client.exe /u=%DRMUSER% /pw=%DRMPWD% /url=%DRMURL% /cfgfile=%SCRIPTDIR%\Definitions\Blend_Versions.cfg exit |
We run the script, and, predictably, it performs the 2 actions successfully.
If we check the logs, we get notice of successful execution, as well.
And finally, we can see our archived version as well.
As you can see, setting up your automations with the DRM batch client is pretty simple. This method shows how configuration files can be used to group like actions together. I will do another post later, on alternatives to this type of scripting.
Hi Vijay,
Thanks a lot for posting the solution. I regularly follow ur posts .They are just awesome ..
Regards
Dilip Kumar
Glad it helped. Put a comment in if there are other things on your mind. If we know how (or have time) to come up with a solution, we will try.
HI Vijay,
Is their any way to export the worklist request from the DRM and status of the request (whether it is approved or not).
Regards
Di
Ha ha. That was fast. Let me take a look at it over the next couple of weeks.
Excellent post and got more information.
Thanks. Glad it helped.
Hi Vijay,
Thanks for your post. I have one query.
We have a scenario where we want to create a user who will be able to run system exports from available hierarchies. But the user should not have any access to modify data and should not be able to view Administer option. Is there any way to achieve this? Your valuable comments on this are much appreciated.
Thanks a lot.
Avik
Hi Vijay. I enjoy your posts!
I have an unrelated question perhaps you could assists with.
Everynight I receive the same DRM Action Script. It involves two members each with an alias. The alias is in DRM and is correct however I still get a changeproperty action for the alias on these two members every morning. Any thoughts would be appreciated!
Hi Brian,
not sure I follow. Where do you get the action script from?