<h2>The HR case approval subflow triggers incorrectly</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><ul style="list-style-position: inside;"><li>Users see that the workflow HR case approval subflow runs abruptly on an HR case setting the state of the HR case to 'Awaiting Approval'.</li></ul></section></div><div ><h3 >Resolution</h3><section><ul style="list-style-position: inside;"><li>The " HR case approval subflow " is triggered as a sub-workflow from " Life cycle event case approval " workflow, so users need to check on when this sub-flow is triggering on their instances and if they desire to set the state to ' Awaiting approval '</li><li>This sub-workflow is triggered by the activity ' Run Approval Subflow ' from the parent.</li><li>The reason why the state is being changed to Awaiting approval , is as per the script running on the sub-workflow Run script activity.<br />var inputState = current.getValue('state');<br />if (!workflow.scratchpad.hr_case_approval_input_state || inputState != hr_Constants.CASE_AWAITING_APPROVAL)<br />workflow.scratchpad.hr_case_approval_input_state = inputState;<br />current.state = hr_Constants.CASE_AWAITING_APPROVAL;<br />current.approval = 'requested'; // sys choice field<br /></li><li>If customer do not want this change , they can customize the workflow running based on the requirements.</li></ul></section></div></article></div>