Skip to content

Commit 68d9116

Browse files
aswamy93adminSapphicFire
authored
Adds a new instance check to notify about the possible risk associated with the usage of setWorkflow(false) method in business rule (#119)
* Adds a new instance check to notify about the possible risk associated with the usage of setWorkflow(false) method in business rule * Update README.md Updated description of the instance scan definition --------- Co-authored-by: admin <[email protected]> Co-authored-by: Astrid Sapphire <[email protected]>
1 parent 256d252 commit 68d9116

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ It is recommended to use an OOB library for modals in order to improve the user
322322
### Use "last run datetime" for JDBC data loads
323323
In your JDBC data load configuration, ensure that the 'last run datetime' option is set to true and configure the target database field to serve as a timestamp, as this best practice enables incremental data loading and improves performance in data integration processes using JDBC.
324324

325+
### Use of setWorkflow(false) in business rules will cause unexpected issues
326+
As setWorkflow(false) method will stop the execution of business rules on that particular GlideRecord object, this will result in unexpected behaviour where the execution of business rules skipped. Maintain caution while using this method and perform regression testing to avoid possible risk. It can have noticeable impact on Audit, Journal fields, notifications, SLA engine, workflow, flow engine etc.,
327+
325328
# Additional resources
326329

327330
Please check these additional links for more information and details:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CiJ15NYBQlN98r5DlixaQIenUXX1VhYfhj3Viqimn6xnWLRjm49eemoXHGUOks40yE_KLBqmaWSeV7OWtVNzeOh9-y1LiYIK1vybPlCkm7Vs17cPZilSdJm90QP6eYbjuA2REbx6CenCuljifa_GhgrTQQQTXhfLrK4AITqwSONkcpSIq_JtLnGAQ5LxsEDZVwVRiosBg6ub4RhGBA_Ty3QB1c8QTDX5jMJ0w5v26VVfKclro6vthJBcfD7zKGT2O4dChhUM1CqmvzAeXTXxnQ-ntin_vJQNdqJOcZBeadAqgdq7_wGAZ5K89oTnIEG8wIi-TtNYo6iETGMYNKNZFfnXdFoqYCs7eLzZwzAx01yNQuixM8q29qc-UpMDfeVSOd-0rTgZTfQqHwkv3NgRqf6iJOFD_M8LSftCrO03UJb9UIzExafd6uwgGej8knhd3WlC9L0WyE9jpvLnBilYuuu2dv1cubkoK4J8Nyy8gWo8AY25xbvex6elPi0be9ynkQDFNtOnTMZRSBKWqHTZxM6N5VA8E3B5ZCB2zjgp6MQMAu7l0EoXfA5jkZG47xuBIbmYZYB45JRQwS0pWqdHWF6Y1D83eFIoFQ6FyYBcbJYBEDN8k3juc1IACIdH6rl9JWBRK6mr0PhujD-MKedCLbvL2OVLm6EAQTPnQMnjyo0
1+
CuRfUCF5TEEar0o-4-1zN_c4AEm04tYOYyitzaQ_ex8I7N1JnJYMxjgZkKwGNaxquET4kyKZwNGgOGLwBZBGQqV0ad_q9I2iqmSUNivzapvftarN9j3ub-8HHtzDLdZBhLnOsB8_AjaPv-Eh_ggd7Hq1LXsfJR-l2YKbNaYWGEXz3eOtbbMEtaN3alsPdg5xSkjvK9JKAkrc5bGTECXU4roa_kZ-uGIFs-qEsoX2JLGSCx_aN3WFyHzUxK0G_TeT80_oLemMf-ZR5tSP0MOFefZs3yckoTXG35VZfAHf4Y7GLJ2ue-KUTTVyHcmBeXwWVAvAHqfZufjne18FtwGdyXbVMV2NmSYcIfMhjkRVvI-DFT1zbEVdkhZAfueYlHevUDcAbwJlY0d0jAe9XbcK_z8b0jdGgruv6aO-NQiekLsMi2uQtb2XsEs7ZNRpSJ_uMGL4SaEIJRjF-Tvcaw-Lls2ejcFD8cZGsUMlfOSHGkNL7N4gjjSZSayzWZSYAnFYGV85NzxJSHt9TDSD0k1TsUiFplvaPqh8sjPvhCk4CbsEadTIm73aWOwmakBfWH6uENaUgBxAwOFayH2fN4r0PkrjsP1Yj6kHxkWBZhIZT8nhMDGM1eTWhP6duu2uY3ANpE2Hl3tv_6LEqDQbZjFNa5o3mL2r7GHxwheQBmq-Cv4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
2+
<scan_table_check action="INSERT_OR_UPDATE">
3+
<active>true</active>
4+
<advanced>false</advanced>
5+
<category>manageability</category>
6+
<conditions table="sys_script">scriptLIKEsetWorklfow(false)^EQ<item endquery="false" field="script" goto="false" newquery="false" operator="LIKE" or="false" value="setWorklfow(false)"/>
7+
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
8+
</conditions>
9+
<description>As setWorkflow(false) method will stop the execution of business rules on that particular GlideRecord object, this will result in unexpected behaviour where the execution of business rules skipped. Maintain caution while using this method and perform regression testing to avoid possible risk. It can have noticeable impact on Audit, Journal fields, notifications, SLA engine, workflow, flow engine etc.,</description>
10+
<documentation_url>https://support.servicenow.com/kb?id=kb_article_view&amp;sysparm_article=KB0867584</documentation_url>
11+
<finding_type>scan_finding</finding_type>
12+
<name>Limit use of setWorkflow(false) in business rules</name>
13+
<priority>2</priority>
14+
<resolution_details>Based on the scenario or use case, think of alternative approach instead of using setWorkflow(false) especially in business rules. Reaserch about the system property trigger_engine.ignore.set_workflow</resolution_details>
15+
<run_condition/>
16+
<score_max>100</score_max>
17+
<score_min>0</score_min>
18+
<score_scale>1</score_scale>
19+
<script><![CDATA[(function (engine) {
20+
21+
// Add your code here
22+
23+
})(engine);]]></script>
24+
<short_description>Use of setWorkflow(false) in business rules will cause unexpected issues</short_description>
25+
<sys_class_name>scan_table_check</sys_class_name>
26+
<sys_created_by>admin</sys_created_by>
27+
<sys_created_on>2024-10-04 15:57:42</sys_created_on>
28+
<sys_id>110515e547819210b8ca0b02d16d4308</sys_id>
29+
<sys_mod_count>1</sys_mod_count>
30+
<sys_name>Limit use of setWorkflow(false) in business rules</sys_name>
31+
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
32+
<sys_policy/>
33+
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
34+
<sys_update_name>scan_table_check_110515e547819210b8ca0b02d16d4308</sys_update_name>
35+
<sys_updated_by>admin</sys_updated_by>
36+
<sys_updated_on>2024-10-04 16:00:33</sys_updated_on>
37+
<table>sys_script</table>
38+
<use_manifest>false</use_manifest>
39+
</scan_table_check>
40+
<sys_translated_text action="delete_multiple" query="documentkey=110515e547819210b8ca0b02d16d4308"/>
41+
</record_update>

0 commit comments

Comments
 (0)