Hi all!! Oracle Santa worked his magic, and EDM update 19.12 has a bunch of shiny new features to test out, including Custom Validations. The validations leverage the same Expression Language that is used in derived properties and node type converters.
If you haven’t worked with EDM Expression language yet, the documentation is a great reference to learn.
The Custom Validations will allow you to check for naming conventions, lengths, naming convention by level in a hierarchy, ensuring that a tree is balanced (if that is a requirement), etc. Tons of opportunity to ensure the correct data is getting into the Viewpoints, and then into your target applications.
Building a Custom Validation
You can apply Custom Validations on the Node Types or Hierarchy Sets, so they will apply to the default application view viewpoints + any custom/maintenance viewpoints that those data chain objects will fall into. In my example, I have Custom Application Adapter registered, called “Kate Prototype Hierarchies” and my viewpoint is “PM_Account”.
The Validation I want to create will validate the length of the nodes being added to a Node Type used in the Viewpoint, called “PM_Prime”. I want to ensure the node length is less than 8 digits; so this should fire an error message if the user enters a longer node name.
I select the “Node Type” card at the top of EDMCS and find my node type, and go to “Inspect”. Select the Validations tab and “Create” to start building your Custom Validation.
You will name your Custom Validation (mine is Validation_Length to keep this simple, but you’ll want to use a common naming convention), and then head on to the Validation settings.
I’ve enabled this Custom Validation by clicking the checkbox, and also defined which Trigger Actions (Add, Rename) and Trigger Properties (Name) will be necessary. At least one of each need to be defined.
Available Trigger Actions: Add, Rename, Insert, Move, Reorder
When defining your Trigger Actions, think about what you are attempting to validate and if it makes sense. If you are adding a Custom Validation to a Node Type, you shouldn’t have to define the Trigger Action on Insert, Move, or Reorder Actions, since they are used in building a hierarchy (and therefore should be used on Hierarchy Set validations).
The interface will have valid selections appear when you are in the Trigger Actions and Trigger Properties boxes, as seen below, which helps you along:
I’ve also defined a the Failure Message that appears to end users. Ensure your Failure Message tells the user what the issue is, and what they need to do to resolve.
The meat of the validation is on the Expression line. Select the “dx” in the right corner to get started. My comments are in Pink!
The Expression Builder also has “helpers” – if you click the “…” icon next to expressions it will allow you to select from valid values for both the Expression logic and the data returned from the validation.
When complete, press “Apply” to finish the Expression for the Custom Validation. And press “Save”. You’ll see your new Custom Validation on the “Validations” tab for the Node Type or Hierarchy Set:
Now that the Custom Validation is created and enabled, we can test it. I go to my Default Application View for “Kate Prototype Hierarchies” and find my Viewpoint, “PM_Account”, which uses the Node Type “PM_Prime”. I open a new Request and create a couple new nodes, one of which has a very long Name… longer than 8 digits. Remember, I set my Trigger Actions to fire on “Add” and “Rename” – so Adding these nodes will count for those Actions.
Validate the Viewpoint:
And the Custom Validation will fire for the Node that does not meet the criteria (Name > 8 characters):