-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbusiness_rule_report.asp
176 lines (162 loc) · 6.12 KB
/
business_rule_report.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<%@ language="JavaScript" %>
<!DOCTYPE html>
<!--
///////////////////////////////////////////////////////////////////////////////
// Product : Online Tools(tm)
//
// Series : Dovetail Software Development Series(tm)
//
// Name : business_rule_report.asp
//
// Description : Report about Business Rule Usage
//
// Author : Dovetail Software, Inc.
// 4807 Spicewood Springs Rd, Bldg 4 Suite 200
// Austin, TX 78759
// (512) 610-5400
// EMAIL: [email protected]
// www.dovetailsoftware.com
//
// Platforms : This version supports Clarify 9.0 and later
//
// Copyright (C) 2001-2012 Dovetail Software, Inc.
// All Rights Reserved.
///////////////////////////////////////////////////////////////////////////////
-->
<html>
<head>
<meta http-equiv="expires" content="0">
<meta name="KeyWords" content="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="Shortcut Icon" href="favicon.ico">
<link href="css/<%=Request.Cookies("boltTheme")%>bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/tablesorter.css" rel="stylesheet">
<!--#include file="inc/config.inc"-->
<!--#include file="inc/adojavas.inc"-->
<!--#include file="inc/report.inc"-->
<%
var sPageTitle = "Business Rule Usage Report";
var sPageType = "BizRules";
var FSO = Server.CreateObject("Scripting.FileSystemObject");
var udl_file = FSO.GetFile(dbConnect.replace("File Name=","").replace(/\\/g,"\\\\"));
%>
<!--#include file="inc/ddonline.inc"-->
<!--#include file="inc/inc_vbscript.inc"-->
</head>
<body>
<!--#include file="inc/navbar.inc"-->
<!--#include file="inc/notifications.inc"-->
<%
//Setup start & end dates
var when = Request("when") + "";
if (when == "undefined" || when == "null") when = "last_30_days";
var start = getStartDate(when);
var end = getEndDate(when);
var totalRulesFired = 0;
var numberOfRuleActions = 0;
//Setup a recordset to hold all of our rule and action data
var rs = Server.CreateObject( "ADODB.Recordset");
rs.Fields.Append("rulename", adLongVarWChar, 8000);
rs.Fields.Append("action", adVarWChar, 1000);
rs.Fields.Append("fired", adInteger);
rs.Fields.Append("create_activity_log", adInteger);
rs.Fields.Append("objid", adInteger);
rs.Open();
%>
<div class="container-fluid">
<div class="row">
<div id="headerContainer" class="col-8 offset-2">
<h3>Business Rule Usage Report (<%=whenString(when)%>)</h3>
<div class="horizontalMargin">
<span>Filter by Time Period:</span>
<div id="filters">
<%
var now = new Date();
var thisYear = now.getFullYear();
var lastYear = now.getFullYear() - 1;
var curr_month = now.getMonth();
var thisMonth = monthAbbreviationArray[curr_month];
var last_month = curr_month - 1;
if(last_month == - 1) last_month = 11;
var lastMonth = monthAbbreviationArray[last_month];
%>
<%=BuildTimeFilter("last_30_days","Last 30 Days",when)%>
<%=BuildTimeFilter("last_365_days","Last 365 Days",when)%>
<%=BuildTimeFilter("this_month","This Month (" + thisMonth + ")",when)%>
<%=BuildTimeFilter("last_month","Last Month (" + lastMonth + ")",when)%>
<%=BuildTimeFilter("this_year","This Year (" + thisYear + ")",when)%>
<%=BuildTimeFilter("last_year","Last Year (" + lastYear + ")",when)%>
</div>
</div>
<p align="center" id="loading" class="highlight info" >Loading...</p>
<%
Response.Flush();
FillRecordSetWithRulesThatFired(rs, start, end);
FillRecordSetWithRemainingRules(rs);
%>
<table class="tablesorter">
<thead>
<tr><th>Rule Name</th><th>Rule Action</th><th># of times rule fired</th><th> </th></tr>
</thead>
<tbody>
<%
WriteReport(rs);
rs.Close();
%>
</tbody>
<tfoot>
<tr><th>Totals</th><th><%=numberOfRuleActions%> Business Rule Actions</th><th class="centerMiddle"><%=totalRulesFired%></th><th> </th></tr>
</tfoot>
</table>
</div>
</div>
<div class="row">
<div class="col-8 offset-2">
<p class="centered"><img src="img/icon-warning.png" alt="warning"/>
<strong>Regarding the Warning:</strong>
If a rule action has its <em>Create Activity Log</em> option set to No, then the number of times the rule fired will always be zero.
If you wish the number of rule firings to be accurate for this rule, check the <em>Create Activity Log on Action</em> checkbox
for this rule action in your Business Rule Editor.</p>
</div>
</div>
<div class="row">
<div class="col-8 offset-2">
<p class="centered"><strong>About this report:</strong>
This report allows you to see the rules that are fired, including their frequency.
Perhaps even more importantly, it allows you to see the rules that are not being fired.
Perhaps those rules could be removed, or made inactive, therefore simplifying your business rule administration.
</p>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="js/jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="js/tether.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="js/notifications.js"></script>
<script type="text/javascript">
function DisplayReport(when){
var href="business_rule_report.asp?when=" + when;
window.location=href;
}
$(document).ready(function() {
var path = window.location.pathname;
var page = path.substr(path.lastIndexOf("/")+1);
$("ul.navbar-nav li a[href$='" + page + "']").parent().addClass("active");
$(".navbar").find(".connected").text("<%=connect_info%>");
document.title = "Bolt: <%=sPageTitle%>";
$("#loading").hide();
$(".tablesorter").tablesorter();
$(".tablesorter tr").click(function () {
$(this).children("td").toggleClass("highlight");
});
});
</script>
</html>
<%
FSO = null;
udl_file = null;
%>