Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all, I have to develop A claim processing engine in asp.net 4.0(c#).
The claim will be having a error and i have to process it. There will be say, 10 step to process that error. I may stop in any of the ten step if the claim satisfies the condition in that step. So I need not to be follow the rest of the steps. How can I make a rule engine for this in asp.net or in my sql table.

step1- if (condition is true) goto step 2 else stop.
step 2- if (condition is true)goto step 3 else stop.
step 3,......

Step 10- stop.

There can be 'n' number of steps. HOw will I solve this. Someone pls help me.
Posted
Comments
Zoltán Zörgő 11-Sep-12 7:27am    
This is really an underdefined problem. Of course it can be solved, but you have not given any constraints. There are several approaches, but we need to know what exactly do you want, how is your tree defined (static, dynamic) and stored; in which layer do you need to add this feature (client side JS, C# code, SQL statement or SQL stored procedure, and so on. But what I am really missing, is the result of the computation: there is no use writing (and stopping) the an algorithm, if there is no returned value (as with a function) or changed object (like with a procedure)... or is this a validation algorithm?
somzz 11-Sep-12 7:56am    
Hi Thanks for the response. Let me make my problem more clear.

Claims to be processed will be given to a vendor.He has to process the cliam by following certain pre defined steps. At last we have to calculate the performance of the vendor by comparing the pre defined steps and user actions. So I will be having two tables 1.table having Pre defined steps -TablePDS 2. User Performed steps -TableUPS.
I have a Claim C1 which has to be processed by a vendor. For processing this he has to follow 10 steps say. The steps will be defined in my TablePDS.
Now the problem is I may not follow all the steps because each step can contain a condition and i have to go to the next step only if the condition is true. So I have to consider this as a subclaim or something and define substeps for this. Then only I can compare it with user actions. no? But that approach is not possible as there can be more than 50 steps in an avg. for each claim (the no of subsets will be 2^n - 1). So i am looking for some decision tree or rule engine kind of thing. It can be define anywhere, either in business layer or in Sql tables.Pls suggest.
Zoltán Zörgő 11-Sep-12 9:37am    
What you drafted is not a tree. It is a linear evaluation. In a tree there are nodes where you can go in more than one direction. In this case you follow the evaluation step by step. But you continue to speek about trees, please explain how this sequence is going to be a tree. And what you mean by stop?
How I see, the user start with step1 and goes to stepn until one of the conditions is false. Am I right? This is no tree, and can contain only N steps. It would contain 2^N-1, only if any combination of steps could occur, but this has no meaning in this context, and you would need also that many conditions also.
But tree or not tree, you need to define your conditions for every type of claim or not? So no engine of the world will save you this.
But you don't need any. Indifferent of how complex the condition structure is, can be easily stored and evaluated.
Just rethink your model. I am pretty sure you are afraid of going the way you imagined, because you have made wrong mathematical assumptions.
It would be great to see a more concrete example, to be able to give you concrete suggestions about the implementation.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900