index > Windows Workflow Foundation > How to update the rules without recompiling or redeploying an app...

How to update the rules without recompiling or redeploying an app...

Hi,

I am having Xoml file with rule conditions. Anybody help me how can I update the Declarative Rule Condition without redeploying. I got an External Toolkit to update the RuleSet, but I can't find any tool for updating RuleConditions. I got the information from one of the site(http://www.odetocode.com/Articles/458.aspx) regarding updating the rules that we could store workflow and rule definitions inside of database records, and update the rules without recompiling or redeploying an application.

Please help me if any body having tool or sample code for storing and updating the rules as said above.

Thank you

Satya




satya vani
Satya vani
Hi Vani,

As far as i understand, you want a tool or code, that can edit .rules file, which is created by rules editor.

If it is, currently, there is no such tool, to directly edit .rules file, as the file will be complied as embedded resource and workflow at runtime reads this file and creates .cs / .vb class using CodeDom.

An alternative solution for your proble is, as written by you, to use database support to store your rules and modifing them using ExternalRulesEditor which can be found at
http://wf.netfx3.com/files/folders/rules_samples/entry310.aspx

Also, see my post in the forums on the same, if you want more info:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=489272&SiteID=1

Hope we can get such tool very soon!

Regards,

Pavan
Pavan Apuroop

Hi Pavan,

Thank you for your great response. The tool u have suggested is for updating ruleset, But I need to update the .rules file as you said in your post. I have done the XAMLActivation as the response given by Tom Lake for your post. Like the following

objIDMServiceParameters.Add("wsCredentialsInput", requestDetails)

objIDMServiceParameters.Add("wsAction", action)

AddHandler workflowRuntime.WorkflowCompleted, AddressOf WorkflowRuntime_WorkflowCompleted

AddHandler workflowRuntime.WorkflowTerminated, AddressOf WorkflowRuntime_WorkflowTerminated

objxomlReader = New XmlTextReader(System.Web.HttpContext.Current.Server.MapPath("IDMUpdateCredentials.xoml"))

objruleReader = New XmlTextReader(System.Web.HttpContext.Current.Server.MapPath("IDMUpdateCredentials.rules"))

instance = workflowRuntime.CreateWorkflow(objxomlReader, objruleReader, objIDMServiceParameters)

instance.Start()

objSchedulerService = workflowRuntime.GetService(Of ManualWorkflowSchedulerService)()

objSchedulerService.RunWorkflow(instance.InstanceId)

WaitHandle.WaitOne()

The Declarative Rule Condition in my Workflow is this.validPassword == 1, this might be changed later like this.validPassword != -1.

I want to update the above condition in .rules file. Help me with sample code please.

Thank you

Satya




satya vani
Satya vani
Hi Vani,

I have tried couple of ways to directly edit .rules file, but found no luck.

But after seeing your code throughly, i can think of one possible solution.

Using the tool, i have suggested, we can import existing rules file, edit the same and export it back to .rules file.

And in your code, you are already loading both workflow definition and .rules file using xml readers.

So what i can suggest you is to try importing the rules file, make necessary changes and export it back to the same file by over writing the existing .rules file and loading new .rules file to the runtime.

This way may wor and please let me know, if you have any issues.

Regards,

Pavan
Pavan Apuroop

Hi pavan,

I have tried to import the .rules file which is having only RuleDefinitions instead of RuleSets with ExternalRuleSetToolkit. but it is showing error like "File Does not contain any RuleSets". I think we can't update RuleCondition in this way.

Thank you

Satya.




satya vani
Satya vani
reply 5

You can use google to search for other answers

 

More Articles

• Relation between IfActivity and .Rules file
• I cannot design child activities in my derivated custom Composite...
• SetStateActivity - set TargetStateName during Execution of Statem...
• How to integrate WWF with Sharepoint or Infopath
• CodeDomDesignerLoaderNoRootSerializer appears
• Create new condition rule from the designer
• Semantics of Status.Cancel?
• Tracking removed Workflows (Beta 2)
• Tracking EventArgs for HandleExternalEvent Activities
• How to get child workflow instanceId after calling invokeworkflow
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• an error about "aspnetwfpageflowexa
• Workflow designer debugging does not work
• How to get the list of Running Instances?
• Enable/disable activities based on worfk
• Fault Handler State Workflow
• Dependency Properties
• need help
• Activities operating on shared data
• Dynamically load policyActivity ruleSet
• Problems with CreateWorkflow method usin
• web service exposed workflow
• Adding Custom Activities to Hosted Workf
• adding dynamic properties to custom Acti
• Save or export xaml?
• question about load state workflow from

Hot Articles

• System.Xml.XmlException while sending In
• Expense Reporting Sample Updated to June
• How to get workflow instance from databa
• Error: Changing a workflow and getting a
• SQLPersistenceService and remote clients
• What do i have to do in order to use Sql
• Passing Parameters Problem
• Official Release Candidate
• ExternalDataEventArgs Serialization prob
• Installing WWF beta 2 on 64bit Windows XP
• Sheduling API Feature Request
• worfkow monitor sample does not compile
• Clarification on persistence & workf
• About the Role in WWF
• UnloadOnIdle no longer works in Web.Conf

Recommend Articles

• Passing parameters to custom activity Be
• Add Graphic User Interface to custom Act
• Using root activity parameters
• how to customize serlztn of wrkflw defs?
• Some sample about AcivityBind and Workfl
• Where is BPEL support currently?
• EventTypeId field in TrackingDataItem ta
• Beta 2 question: Why did local services
• Query on SQL Tracking service for WWF
• Custom Composite Activities and Correlat
• .xoml File
• Using rules without WF
• Problems with Persistance and ASP.NET
• XAML only workflows and X:Class attribut
• Cleaning Persisted Workflows