Skip to content

Adds a new instance check to notify about the possible risk associated with the usage of setWorkflow(false) method in business rule #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ It is recommended to use an OOB library for modals in order to improve the user
### Use "last run datetime" for JDBC data loads
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.

### Use of setWorkflow(false) in business rules will cause unexpected issues
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.,

# Additional resources

Please check these additional links for more information and details:
Expand Down
2 changes: 1 addition & 1 deletion ca8467c41b9abc10ce0f62c3b24bcbaa/checksum.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CiJ15NYBQlN98r5DlixaQIenUXX1VhYfhj3Viqimn6xnWLRjm49eemoXHGUOks40yE_KLBqmaWSeV7OWtVNzeOh9-y1LiYIK1vybPlCkm7Vs17cPZilSdJm90QP6eYbjuA2REbx6CenCuljifa_GhgrTQQQTXhfLrK4AITqwSONkcpSIq_JtLnGAQ5LxsEDZVwVRiosBg6ub4RhGBA_Ty3QB1c8QTDX5jMJ0w5v26VVfKclro6vthJBcfD7zKGT2O4dChhUM1CqmvzAeXTXxnQ-ntin_vJQNdqJOcZBeadAqgdq7_wGAZ5K89oTnIEG8wIi-TtNYo6iETGM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@
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
<scan_table_check action="INSERT_OR_UPDATE">
<active>true</active>
<advanced>false</advanced>
<category>manageability</category>
<conditions table="sys_script">scriptLIKEsetWorklfow(false)^EQ<item endquery="false" field="script" goto="false" newquery="false" operator="LIKE" or="false" value="setWorklfow(false)"/>
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
</conditions>
<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>
<documentation_url>https://support.servicenow.com/kb?id=kb_article_view&amp;sysparm_article=KB0867584</documentation_url>
<finding_type>scan_finding</finding_type>
<name>Limit use of setWorkflow(false) in business rules</name>
<priority>2</priority>
<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>
<run_condition/>
<score_max>100</score_max>
<score_min>0</score_min>
<score_scale>1</score_scale>
<script><![CDATA[(function (engine) {

// Add your code here

})(engine);]]></script>
<short_description>Use of setWorkflow(false) in business rules will cause unexpected issues</short_description>
<sys_class_name>scan_table_check</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-04 15:57:42</sys_created_on>
<sys_id>110515e547819210b8ca0b02d16d4308</sys_id>
<sys_mod_count>1</sys_mod_count>
<sys_name>Limit use of setWorkflow(false) in business rules</sys_name>
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
<sys_policy/>
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
<sys_update_name>scan_table_check_110515e547819210b8ca0b02d16d4308</sys_update_name>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-04 16:00:33</sys_updated_on>
<table>sys_script</table>
<use_manifest>false</use_manifest>
</scan_table_check>
<sys_translated_text action="delete_multiple" query="documentkey=110515e547819210b8ca0b02d16d4308"/>
</record_update>
Loading