Thursday, February 13, 2014

Running DRM Batch file using Control-M Agent and DRM credentials utility

Here is a situation i got myself into and out. I created a batch file to run a simple export. I mapped drm user to windows user using drm credentials utility, this way i dont have to hardcode username and password for batch.

Issue: when the batch wass run manually it works just fine but it fails when it is executed by Control-M agent.
the error indicates batch failed because one of the required parameter username is not supplied.

Fix:
on the box where drm and control-m agent is installed, do the following


  1. Goto Administrative Tools->Services
  2. Select the Control-M/Agent Service
  3. Right Click->Properties
  4. Click Logon Tab
  5. Change the Logon as from "Local System Account" to "This Account"
  6. Enter the DRM windows username and password.
  7. Click Apply
  8. Click OK
  9. Restart the services.


Tuesday, February 11, 2014

Error while trying to communicate with DRM API Adapter at http://localhost:5240/oracle/drm/adapter?wsdl

Here is a fix for the above issue.. it took me 4 days to figure out what was happening....

1. Check if the url and port for the api adapter is correct. to test it just copy/paste the url in browser.














2. Check if you setup the api adapter in DRM configuration console. 
















3. Check if  you have created an external user in DRM and a user with the same name in shared services and a user with the same name and password in weblogic. 


Thursday, February 6, 2014

Upgrading to DRM 11.1.2.3.304

DRM 11.1.2.3.304 patch introduces enhanced password security. This mean when upgrading from previous release the drm-config.xml file gets modified and will not be backward compatible with previous release. Please make a backup of the file before upgrading that way if you decide to downgrade to the previous you can use the backup copy of config-xml.


This file is located at

Oracle\Middleware\EPMSystem11R1\products\DataRelationshipManagement\server\config\drm-config.xml

Windows User Account for DRM

When performing DRM Install/Patch updates, make sure the windows user account used to perform the task has

  1. Has Local administrator rights and was set up for installation and configuration. 
  2. This user must be an administrator and should be the same for all EPM System products installed on the machine. 
  3. This Windows user requires the following local policies to be assigned
    1. Act as part of the operating system
    2. Bypass traverse checking
    3. Log on as a batch job
    4. Log on as a service
To verify check the following


  1. Check if the user that will be used to install DRM belongs to Administrative Group.
  2. Go to Control Pannel and select Administrative tools and double click Local Security Policy
  3. Expand to Security Settings->Local Policy->User Rights Assignment
  4. Select one of the above policy listed above in the main article. example. Bypasstraverse checking
  5. double click to edit
  6. Make sure the user you want to use for DRM is listed in here, if not click on the Add User button to include.
  7. repeat the steps 6 thru 9 for other policies.

Dynami Script Examples

Example 1: Debugging code by printing the value.
Print(node.Abbrev); // Will print out value of the current node. Handy for debugging.

Example 2: Extracting part of node name. Similar to ArrayItem() Formula.
return node.Abbrev.split("_").slice(0,1); // Returns first part of the array.
return node.Abbrev.split("_").slice(2,3); // returns 3rd part of the array.
OR
return node.Abbrev.split("_")[0]; // Returns first part of the array.
return node.Abbrev.split("_")[2]; // returns 3rd part of the array.


Example 3: Finding when was a hierarchy last updated by comparing all the nodes of the hierarchies (starting from top node) last update date.
var dt;
var childEnumerator = node.Hier.TopNode.GetChildEnumerator();
while(childEnumerator.MoveNext()) {
    var propValue = childEnumerator.GetCurrent().PropValue("Core.NodeLastChangedOn");
    if(dt == null || dt<propValue)
        dt=propValue;
}
return dt;

Example 4: validating description should not be empty and should be less than 10 characters. This helps users understand exactly why the validation failed.
var errm;
var dsr = node.PropValue("Core.Descr");
if (!dsr)
    errm="Description cannot be empty";
if(dsr.length >10)
    errm="Description should be less than 10 characters.";
if(!errm)
    return true;
else
    return{
        success:false,
        parameters:[errm]

    }
Dynamic error message

Example 5:This formula tries to find list of all the distinct property values for all the children of a parent node. it helps to identify nodes that have different children with different property values.

var cprt;
var childEnumerator = node.GetChildEnumerator();
while(childEnumerator.MoveNext()) {
    var propValue = childEnumerator.GetCurrent().PropValue("Custom.CPRTSchedule");
       if(cprt == null)
           cprt=propValue;
   
var re=new RegExp(propValue);
    if( re.test(cprt)==false)
         cprt=cprt+","+propValue;
   
}
if(!cprt)
    return(node.PropValue("Custom.CPRTSchedule"));

return cprt;






Dynamic Scripting

Oracle introduces Dynamic Scripting in DRM 11.1.2.3. This functionality makes drm much more powerful and flexible in deriving properties and validating business rules.

What is dynamic scripting?
Dynamic script is Java Script programming in DRM. This feature is introduced in DRM 11.1.2.3 version. It enables you to develop business logic for derived properties and validations.

Why do we need it?
Dynamic scripts provide
1.    Robust and better performing alternative to formulas.
2.    Better organization and less complexity of logic through the use of
a.    Multiple statements
b.    Variables
c.    In-line comments.
d.    Loops & regular expressions.

Where can we use it?
Dynamic scripts can be used in one of two ways
  • Derived Properties
  • Validations


Derived Properties: We can now use script instead of formula to derive property values. Bonus addition in this 11.1.2.3 is deriving Hierarchy and Version level properties.
Script can derive property values at node (Global, Local), Hierarchy and Version level.

Validations: Script and formula are now available in validations.We dont have to create properties and reference them in validations, instead we can directly use the formulas or script within validation.

How should we use?
DRM provides parameters (node, hierarchy, version, validation etc.). All applicable properties and methods can be referenced using these parameters. Check the example in later sections.

Pros and Cons
Pros
Cons
Programming Capabilities
Need to know/learn java scripting
Variables can be used to replace some properties

Customize error messages in validations.

Can use one validation to perform multiple validations.

Performance improvement and easy debugging