{"componentChunkName":"component---src-templates-default-template-tsx","path":"/documentation/integration/Approval/introduction/","result":{"data":{"asciidoc":{"id":"d1ae1142-d3e7-5a77-b480-f38374b2b383","html":"<div id=\"toc\" class=\"toc\">\n<div id=\"toctitle\">Table of Contents</div>\n<ul class=\"sectlevel1\">\n<li><a href=\"#_introduction\">Introduction</a></li>\n<li><a href=\"#_prerequisits\">Prerequisits</a></li>\n<li><a href=\"#_example_usage\">Example usage</a></li>\n<li><a href=\"#_the_question_structure_json_obejct\">The Question Structure (JSON obejct):</a>\n<ul class=\"sectlevel2\">\n<li><a href=\"#_control_objects\">Control Objects</a></li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_introduction\">Introduction</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The AskApprove capability allows decisions to be made by an \"Approver\" on whether a Task should be completed or not, and allows them to provide extra information into the Task based on a pre-defined template in the KI.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_prerequisits\">Prerequisits</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The Approval Action Handler requires use of an Approval UI Application in HIRO Desktop. For users to gain access to this application they must be part of the Task Approver Team, <code>haasXXXXX_task_approver</code>, for the given instance. Membership of the Team can be provided in Arago ID by an Organizational Admin.\nThe Approval Action Handler uses the <code>SendEmail</code> capabilities.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_example_usage\">Example usage</h2>\n<div class=\"sectionbody\">\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code>ki\n  name: \"Approve Sample\"\n  description: \"KI will ask approval\"\n  version: \"1\"\non\n  ogit/_id\nwhen\n  ProcessIssue==\"true\"\n  ogit/_id\ndo\n  LOCAL::model = '{\n      \"action\":\"approve\",\n      \"task\":\"The task needs to be approved (Title)\",\n      \"template\":\"Abhi test approval (Body)\",\n      \"controls\":[\n          {\n              \"approve\":{\"/approve\":\"true\"},\n              \"reject\":{\"/approve\":\"false\"}\n          }\n      ]\n  }'\n  exec: LOCAL::RESULT,\n  stdout: LOCAL::OUTPUT,\n  stderr: LOCAL::ERROR,\n  exit: LOCAL::SYSTEMRC = action(\n      capability: \"AskApprove\",\n      user_email: \"consult@org.com\",\n      issue_id: ISSUE::ogit/_id,\n      question_model: model\n      )\n  log.info(LOCAL::RESULT)\n  log.info(LOCAL::OUTPUT)\n  log.error(LOCAL::ERROR)\n  log.info(LOCAL::SYSTEMRC)\n\n  delete(ProcessIssue)\n  eject_issue(message: \"Wait for approve\", issue_id: ISSUE::ogit/_id)</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p>The <code>capability</code> should be set to <code>AskApprove</code></p>\n</li>\n<li>\n<p>The <code>user_email</code> is the recipient email address</p>\n</li>\n<li>\n<p>The questions structure is defined in <code>LOCAL::model</code> (see below)</p>\n</li>\n<li>\n<p>Before the Approval Email is sent, the KI should <code>eject_issue</code>. This puts the Task into a WAITING state. The Approval UI will then return the KI to PROCESSING. If the Task is not put into WAITING, the UI will not show the Task.</p>\n</li>\n</ul>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_the_question_structure_json_obejct\">The Question Structure (JSON obejct):</h2>\n<div class=\"sectionbody\">\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  \"action\": \"&lt;ACTION&gt;\",\n  \"task\": \"&lt;TASK&gt;\",\n  \"template\": \"&lt;TEMPLATE&gt;\",\n  \"controls\": [ &lt;CONTROL&gt;, &lt;CONTROL&gt;, ...]\n}</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>\"action\": \"&lt;ACTION&gt;\"</code> The user friendly name of the action the user will perform, ie \"Approve\".</p>\n</li>\n<li>\n<p><code>\"task\": \"&lt;TASK&gt;\"</code> The user friendly name of the task the user will perform the action on, ie \"Add User to Security Group\".</p>\n</li>\n<li>\n<p><code>\"template\": \"&lt;TEMPLATE&gt;\"</code> The user friendly description of the task.</p>\n</li>\n<li>\n<p><code>\"controls\": [ &lt;CONTROL&gt;, &lt;CONTROL&gt;, &#8230;&#8203;]</code> The array of questions / inputs the user needs to provide. The controls array can contain one or more <code>&lt;CONTROL&gt;</code> objects.</p>\n</li>\n<li>\n<p>The <code>&lt;CONTROL&gt;</code> object is a single, or block of input questions for the user. These can be: \"Approve or Reject\", Text Inputs, or Dropdown Options.</p>\n</li>\n<li>\n<p>The \"Approve or Reject\" object the only required object, and all other inputs will be available only if the user selects \"Approve\".</p>\n</li>\n</ul>\n</div>\n<div class=\"imageblock\">\n<div class=\"content\">\n<img src=\"/7.0/images/actionhandler/approval_title.png\" alt=\"Title\">\n</div>\n</div>\n<div class=\"sect2\">\n<h3 id=\"_control_objects\">Control Objects</h3>\n<div class=\"paragraph\">\n<p>Each Control Object specifies which format to ask the question, and what data to save to the AutomationIssue Node.</p>\n</div>\n<div class=\"paragraph\">\n<p>For \"Approve or Reject\" or Dropdown Options, the data is defined as a DataObject which will be saved directly into the AutomationIssue if the option is selected by the user. The DataObject&#8217;s key is the Attribute Name, and the value is the value to be saved in the graph. The DataObject can be empty, or have one or more Attribute Mappings.</p>\n</div>\n<div class=\"paragraph\">\n<p>For Text options, the value is the Attribute Name, the user&#8217;s input will be saved to.</p>\n</div>\n<div class=\"paragraph\">\n<p>The Control Object can be used for either the Approval or Rejection flow. By default they are for the Approval flow, but a key <code>for</code> can be specified to allow the Control Object to used in the Rejection flow.</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  ..., //Control Object Parameters\n  \"for\": \"reject\"\n}</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>The Control Object can also be either required or optional. By default they are required, but a key <code>required</code> can be specified to allow this to be configurable.</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  ..., //Control Object Parameters\n  \"required\": false\n}</code></pre>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_approve_reject_option\">Approve / Reject Option</h4>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  \"approve\": { \"/attribute\": \"value1\" },\n  \"reject\": { \"/attribute\": \"value2\" }\n}</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>\"approve\":</code> Holds the DataObject to be saved on approval.</p>\n</li>\n<li>\n<p><code>\"reject\":</code> Holds the DataObject to be saved on rejection.</p>\n</li>\n</ul>\n</div>\n<div class=\"imageblock\">\n<div class=\"content\">\n<img src=\"/7.0/images/actionhandler/approval_approve.png\" alt=\"Approve / Reject Option\">\n</div>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_text_input_single\">Text Input (single)</h4>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  \"text\": \"/attribute\"\n}</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>\"text\":</code> Holds the string Attribute Name, the user&#8217;s input will be saved to.</p>\n</li>\n</ul>\n</div>\n<div class=\"imageblock\">\n<div class=\"content\">\n<img src=\"/7.0/images/actionhandler/approval_text2.png\" alt=\"Text Input (single)\">\n</div>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_text_input_multiple\">Text Input (multiple)</h4>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  \"text\": [\n    \"/attribute1\",\n    \"/attribute2\"\n  ]\n}</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>\"text\":</code> Holds an array of string Attribute Namea, the user&#8217;s inputs will be saved to.</p>\n</li>\n</ul>\n</div>\n<div class=\"imageblock\">\n<div class=\"content\">\n<img src=\"/7.0/images/actionhandler/approval_text2.png\" alt=\"Text Input (multiple)\">\n</div>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_text_input_with_provided_label_single\">Text Input with Provided Label (single)</h4>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  \"text\": { \"Example Label\": \"/attribute\" }\n}</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>\"text\":</code> Holds an object, Label to Attribute Name, the user&#8217;s input will be saved to.</p>\n</li>\n</ul>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_text_input_with_provided_label_multiple\">Text Input with Provided Label (multiple)</h4>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  \"text\": {\n    \"Example Label 1\": \"/attribute1\",\n    \"Example Label 2\": \"/attribute2\"\n  }\n}</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>\"text\":</code> Holds an object, Label to Attribute Name, the user&#8217;s input will be saved to.</p>\n</li>\n</ul>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_text_input_header_and_description\">Text Input Header and Description</h4>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  \"text\": \"/attribute\",\n  \"header\": \"Header Text\",\n  \"desc\": \"Description Text\",\n}</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>\"header\":</code> Optional Header text for this section.</p>\n</li>\n<li>\n<p><code>\"desc\":</code> Optional Description text for this section.</p>\n</li>\n</ul>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_dropdown_select\">Dropdown / Select</h4>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  \"options\": {\n    \"Option1 Name\": { \"/attribute\": \"option_1_value\" },\n    \"Option2 Name\": { \"/attribute\": \"option_2_value\" }\n  }\n}</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>\"options\":</code> Holds an object, which contains Key, Dropdown Option Name, to the DataObject to be saved on selection.</p>\n</li>\n<li>\n<p>There can be multiple Key, Value options.</p>\n</li>\n</ul>\n</div>\n<div class=\"imageblock\">\n<div class=\"content\">\n<img src=\"/7.0/images/actionhandler/approval_options1.png\" alt=\"Dropdown / Select (single)\">\n</div>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_dropdown_select_header_and_description\">Dropdown / Select Header and Description</h4>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-JSON\" data-lang=\"JSON\">{\n  \"options\": {\n    \"Option1 Name\": { \"/attribute\": \"option_1_value\" },\n    \"Option2 Name\": { \"/attribute\": \"option_2_value\" }\n  },\n  \"header\": \"Header Text\",\n  \"desc\": \"Description Text\",\n}</code></pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>\"header\":</code> Optional Header text for this section.</p>\n</li>\n<li>\n<p><code>\"desc\":</code> Optional Description text for this section.</p>\n</li>\n</ul>\n</div>\n</div>\n</div>\n</div>\n</div>","document":{"main":"Approval Action Handler","title":"Approval Action Handler","subtitle":""},"fields":{"toc":true,"location":["documentation","integration","Approval","introduction"]}},"sidebarYaml":{"id":"6d066bdd-c982-5a69-b909-a31e6fc044e0","showIndex":null}},"pageContext":{"id":"d1ae1142-d3e7-5a77-b480-f38374b2b383","parent":"documentation"}},"staticQueryHashes":["1010459453","1010459453","2356112386","2356112386","2603905930","2603905930","3026652197","3026652197","3167850324","3167850324","63159454","63159454"]}