{"id":448,"date":"2017-09-11T21:58:08","date_gmt":"2017-09-11T17:28:08","guid":{"rendered":"http:\/\/www.enhisecure.com\/isecureblog\/?p=448"},"modified":"2019-05-21T13:55:14","modified_gmt":"2019-05-21T09:25:14","slug":"referring-rule-libraries-in-validation-script","status":"publish","type":"post","link":"https:\/\/www.enhisecure.com\/isecureblog\/2017\/09\/11\/referring-rule-libraries-in-validation-script\/","title":{"rendered":"Sailpoint Implementation: Referring Rule Libraries in Validation Scripts"},"content":{"rendered":"<p>Validation scripts are amongst the most common features while working with <a href=\"https:\/\/www.sailpoint.com\/identity-management-software-identityiq\/\">Sailpoint Identity IQ&#8217;s<\/a> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Workflow\">workflow <\/a>forms. When we have common validation logic for multiple fields, it is always good to maintain this piece of logic in a separate rule library and call it from the validation script whenever required. This encourages <a href=\"https:\/\/en.wikipedia.org\/wiki\/Modular_programming\">modularity of the code<\/a> and decreases <a href=\"https:\/\/en.wikipedia.org\/wiki\/Redundant_code\">code redundancy<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>The way in which the name space of a validation script of a form in the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Workflow\">workflow <\/a>behaves is quite different from the rest of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Workflow\">workflow<\/a>. Initial declaration of referenced libraries does well for referring the code in other parts of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Modular_programming\">workflow<\/a>. But this does not work with validation scripts.<\/p>\n<p>&nbsp;<\/p>\n<p>The following syntax should be used when we are using the rule referencing in validation scripts &#8211;<\/p>\n<p style=\"padding-left: 30px;\"><em>&lt;ValidationScript&gt; <\/em><\/p>\n<p style=\"padding-left: 60px;\"><em>&lt;Includes&gt; <\/em><\/p>\n<p style=\"padding-left: 90px;\"><em>&lt;Reference class=&#8221;sailpoint.object.Rule&#8221; name=&#8221;Rule-Library-Name&#8221;\/&gt; <\/em><\/p>\n<p style=\"padding-left: 60px;\"><em>&lt;\/Includes&gt;<\/em><\/p>\n<p style=\"padding-left: 60px;\"><em>&lt;Source&gt;<\/em><\/p>\n<p style=\"padding-left: 90px;\"><em>\/\/ your code that calls some useful function in the rule library<\/em><\/p>\n<p style=\"padding-left: 60px;\"><em>&lt;\/Source&gt;<\/em><\/p>\n<p style=\"padding-left: 30px;\"><em>&lt;\/ValidationScript&gt;<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Validation scripts are amongst the most common features while working with Sailpoint Identity IQ&#8217;s workflow forms. When we have common validation logic for multiple fields, it is always good to maintain this piece of logic in a separate rule library and call it from the validation script whenever required. This encourages modularity of the code [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,14],"tags":[10,29,19,11],"class_list":["post-448","post","type-post","status-publish","format-standard","hentry","category-identity-governance","category-sailpoint","tag-identity-iq","tag-iiq","tag-rules","tag-sailpoint"],"_links":{"self":[{"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/posts\/448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/comments?post=448"}],"version-history":[{"count":10,"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/posts\/448\/revisions"}],"predecessor-version":[{"id":479,"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/posts\/448\/revisions\/479"}],"wp:attachment":[{"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/media?parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/categories?post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.enhisecure.com\/isecureblog\/wp-json\/wp\/v2\/tags?post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}