script to run a rule

Dear all,
If you want to schedule the execution of a Rule, or of all the Rules of a CRF, you can use the following script, change it to match your situation and save it as a *.vbs.
If you want to read more about the why's and how's, go to 
Kind regards,
Gerben Rienk
---
Option explicit
Dim objIEDebugWindow
Dim objHTTP
Dim strURLStart
Dim strURL 
Dim strReq 

If WScript.Arguments.Count <> 3 then
WScript.Echo "Missing parameters. This script needs: "_
& VbNewLine & "username, password and CRFID or RuleSetID"_
& VbNewLine & "to run correctly."
Else
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
'j_spring_security_check
strURL = strURLStart & "j_spring_security_check?j_username=" & WScript.Arguments(0) 
strURL = strURL & "&j_password=" & WScript.Arguments(1)
objHTTP.Open "POST", strURL, False
objHTTP.send

'choose one of the following: 
'this first line will run all Rules for a CRF, 
'strURL = strURLStart & "RunRule?crfId=" & WScript.Arguments(2) & "&action=true"
'this second line will run one RuleSet
strURL = strURLStart & "RunRuleSet?ruleSetId=" & WScript.Arguments(2) & "&dryRun=no"

objHTTP.Open "GET", strURL, False
objHTTP.send
End if
---

Comments

This discussion has been closed.