Architecture - Apply The Correct Data From The GUI To The Parameters For The Rule And Execute The Rule

Apr 6, 2011

I have a very simple Business Rules Engine that has only three methods. One gets all the rules for the current operation, one will retrieve a list of parameters for the rules, the last applies the rules. The rules are stored in the database as user defined functions using parameters. The client will call the BRE pass in the operation and a Lot Number and the BRE checks for any rules that apply to this operation for this Lot. The client gets a list of rules that apply (the names of the corresponding UDF's in the database) and at which step in the operation the rule applies. When the material gets to a step that has a rule, it calls BRE to get parameters for the UDF for that operation, fills in the parameters with data contained in the GUI and calls the BRE to apply the rule with this lot's specific data. Multiple lots can share the same rule that is why there are parameters for the UDF. This all works well. However, this is assuming we have a set number of rules for each lot at each operation. If the lot needs a new rule applied at this operation we have to add a new rule and corresponding UDF into the BRE database. This is not a problem, the client will now see two rules, however, it only knows how to apply the parameters for the first rule, and there is no code for applying the parameters for the second rule.

For example: Rule 1 states that only the same Lot number items can be put into a carton. So the UDF expects one parameter called LotID and one parameter called Carton ID. It runs the rule (UDF) with these parameters and checks to ensure the lots match. Now the Lot requires a second rule: Only 25 items can be packed in the carton. We create a new rule and corresponding UDF, but this rule has the CartonID and a quantity associated with it.

The GUI can handle Rule 1 because it knows how to apply the correct data from the GUI to the parameters for the Rule and execute the rule, so LotID from the GUI = LotID in the parameter name in the UDF and CartonID from the GUI = CartonID parameter name in the UDF. Now there is a new rule, the GUI sees this new rule, gets the parameters, but has no way to applying the quantity to the new parameter to execute the rule without having to change the GUI. We don't expect there to be many rule changes, however, when they do occur we don't want to have to recompile the GUI every time. Does anyone have any suggestions on how to create a class that could determine the how to apply set the correct parameters? We have thought about a table in a database that maps the parameter names in the UDF with parameter names in the GUI so when we add a new UDF we update the table with the corresponding data from the GUI. That could work but may get cumbersome and would require us to make sure that, that table is kept current. Another suggestion was to name the parameters in the UDF the same as the parameters in the GUI, but this too, would require us to maintain the names in two locations.

View 5 Replies


ADVERTISEMENT

MVC Data Annotation Validation Rule For Collection?

Dec 2, 2010

Is there a dataannotation validate rule for a collection based property? I have the following
<DisplayName("Category")>
<Range(1, Integer.MaxValue, ErrorMessage:="Please select a category")>
Property CategoryId As Integer
<DisplayName("Technical Services")>
Property TechnicalServices As List(Of Integer)
I'm looking for a validator that I can add to the TechnicalServices property to set a minimum for the collection size.

View 1 Replies

Create New MS Outlook Rule VB

May 5, 2012

I'm trying to write a rule to compensate for laziness caused by program changes. Used to be, case numbers for family law cases where I work were written as follows: 12-DR-012345. Now, you can get away with 12DR12345, and the file management program accepts it.

View 1 Replies

How To Merge Two DataSets On Specified Rule

Apr 13, 2010

I'm trying to merge two datasets based on these rules:
1. With ds1 and ds2, If the Unique Key from ds1 is not found in ds2, copy it to ds2 and move to next row in the table, else, goto the next part
2. If the unique key in ds2 is found in ds1, check the DateLastEdited row.
a. If DateLastEdited in ds2 is greater then in ds1, copy the row from ds2 to ds1, else , do nothing

I'm just having trouble with the loops. Here's what I have:
Dim ds1 As DataSet = fillNetwork() 'this function fills ds1 with the dataset from a table found on a network
Dim ds2 As DataSet = fillLocal() 'this function fills ds1 with the dataset from a table found on local drive
Dim returnRows() As System.Data.DataRow = Nothing
For Each dtDs1 In ds1.Tables
[Code] .....
This bit of code is just trying to segregate the one that are in both tables from the ones that are just in one table.

View 6 Replies

Applying A Rule Set To Different Lines Of Text?

Apr 27, 2012

The general purpose of my application simply reads a line of text for example:

1. I have a printer issue
2. I have a software issue

I have a rule set as follows:

'Define the class 'Printer' with 14 values as a string...
Dim Printer(13) As String
'The string 'Printer' gets assigned a value, this is repeated another 13 times...
Printer(0) = "Printing"

[code]....

The code simply uses a number of keywords to detect if the issue is a 'printer', 'software', 'telephone',. or 'password' problem.I want to apply this rule set to 10 issues within the same rich text box, with the results sent to a text file. The exporting to a text file I can do, however the main issue is, i cannot read the lines individually.

View 5 Replies

Asp.net - Subdirectory URL Automatic Rewrite Rule?

Apr 25, 2012

I'm using ASP.NET 4 / VB.NET / IIS to build a web application. Folks will access the web application via a URL like so: [URL] So, for example, here is the urls for Jane Doe, John Doe, and James Doe respectively: [URL] I need to somehow pass them off (no matter what name is entered) to a default.aspx page which then pulls in the name portion of the url and uses it to perform a lookup against the database which contains info. about this particular person and displays a personalized page based on that information.

[Code]...

View 1 Replies

VS 2010 Check First Rule (not Line) In RTB?

Mar 5, 2011

Let's say I have a rtb with a few lines.

line1: (empty)
line2: (empty)
Line3: "blablablablabla"
Line4: ..... etc

How do I get/read the first, only the first line? ("blablablabla")

View 9 Replies

Business Rule Engine - GUI To Check For Three Rules ?

Mar 30, 2011

I have a simple business rules engine that I need to write. I have looked at both Biztalk and Windows Workflow, but they are to much for what we need to do. This is a process that material will come to an operation, the GUI will check for three rules, one for the operation, one for the steps in the operation, and one for the item coming into the operation. These are the only three checks that will be done. It is possible there will be more than one rule for each check. I have a simple database set up to contain all the operations, steps and products and there is a crosstab table that links all the rules to each item. Here is an example of some rules (these are actual rules from the process):

View 5 Replies

Conceptual / Rule Implementation / String Manipulation

Dec 29, 2011

So I'm working on a software in VB.Net where I need to scrape information and process it according to rules. For example, simple string replace rules like making "Det" into "Detached" for a specific field, or a split/join rule, basic string operations. All my scraping rules are RegEx and I store them in a database in rows of rule sets for different situations.What is the best way behind creating/storing rules to manipulate text? I do not want to hardcode the rules into the software, but rather be able to add more as there will be a need for them. I want to store them in a database, but then how do I interpret them?

View 1 Replies

Programmatically Modify Access Rule For Directory?

Oct 25, 2011

I want to programmatically change ACL for all the subdirectories into a containing one. Specially when ACL of a particolar user is found I want to duplicate that ACL, change the security identifier and add the rule.

Look at this code:

cDirectoryInfo = New DirectoryInfo(strPath)
cDirectorySecurity = cDirectoryInfo.GetAccessControl()
cAuthorizationRuleCollection = cDirectorySecurity.GetAccessRules(True, True,

[Code]....

View 5 Replies

GDI+ Flat File Disposal Rule For Textured Brush?

Dec 8, 2010

I place these 2 questions in this forum simply 'cause those that know GDI+ best are probably .Net vs. VB6 classic users... So here it goes.I'm using GDI+ flat file to generate a textured brush with image attributes. Creating these are no problem, but I can't find documentation that says whether disposing of the brush will dispose the original image & attributes handles I've assigned to the brush or whether I need to destroy those also? I can't locate anything that says whether GDI+ copies the handles or uses the ones I provided. Destroying the handles well before the brush is destroyed does no damage. Thus my assumption is that the handles are copied. But you know what they say about assumptions.

2. Likewise I use a GDI+ function to return the image assigned to a textured brush. Again, I don't know if that returned image handle is to be disposed by me or not. The returned handle changes every time I call the function, so I'm assuming that I should be destroying it. Thanx to all that can shed any light whether from personal experience or pointing me to some black & white documentation.

View 1 Replies

Enforce Validation Rule In Create Table Statement For A Coloumn

Dec 15, 2011

I want to enforce validation rule in create table statement for a coloumn. im using vb.net as front end and access as back end.

View 2 Replies

Import Or Create An Outlook 2003 Rule (.rwz) With VSTO 2005?

Jul 29, 2009

I would like to automatically create an Outlook rule (move email containing something in subject to folder xyz) but dont know how to achieve this. Of course I can create the rule and export it to a .rwz file. This file can be imported manually, but how can I import it automatically?

Can I import a rule through my VSTO 2005 Outlook (2003) Addin? Or can I create the rule from within this addin?

View 2 Replies

Regex - Tokenizing A Complex String (a Snort Rule) With Regular Expressions (.NET)

May 21, 2011

I need help from the Regex wizards out there. I am trying to write a simple parser that can tokenize the options list of a Snort rule (Snort, the IDS/IPS software). Problem is, I can't seem to find a workable formula that breaks apart the individual rule options based on their terminating semi-colon. The formulas that I have cooked up grab all options between parenthesis into a single capture group.

I am using the excellent RegExr tool at the GSkinner site with some of the below sample rule options from Emerging Threats (I parsed off the rule header -- that's easy to tokenize):

[Code]...

I had to play with a few example regex's that work with quoted strings. Finally realized that I am staring at negative look-behinds that avoid quotes that are escaped. This seems to solve any other escaped character, too, because escaped characters only appear inside unescaped quotes.

View 1 Replies

Create A Authentication Rule If I Use Separate Login For Two Folders Say Admin Folder And Vendor Folder

Feb 9, 2011

I have the following directory structure in my asp.net webdirectory i want when any body access anypage inside my admin folder then it auto redirect to login page of admin folder until they login

View 1 Replies

Is This Workaround/architecture Correct Using Classes (complex Properties)?

Feb 15, 2012

what's a Class, and Object, a Method, a property and thins like that, but I have this doubt:Let's supppose I have a class "Laundry" this class has (just for this example) 3 propierties:

1.- laundryID
2.- Name
3.- Washers

Id and Name are "primitive" types or simple types (integer and string), but Washers, represent a list of object of type "Washer", that has 3 properties:

1.- washerID
2.- laundryID
3.- capacity
4.- brand

All of them (for this example) simple/primitives types (integer,string,string).So this my dilemma, it is correct to have a constructor like this (VB .net)

public sub new(ByVal laundryID as integer)
'' Here I'll query for the data of the Laundry on DB
'' After that I will query for every washer that belongs to this laundry

[code]....

And inside of that constructor query for all the washers that belongs to the laundry with id=laundryID parameter, and create objects of type "Washer" and add them to the list of Laundry ?I'm not sure If I explain myself, any comment I'll be really grateful, in less words, what's the correct approach (or good practices) to work with class/objects that has properties which are complex (other class/objects).I usually work with ADO.net probably ADO/LINQ/Entity solve this thins in an transparent way, but if they do it I don't really know it.

Note: I'm familiar with VB.net, C#, PHP, so if you prefer explain/help me using examples with its syntax, it's ok

View 2 Replies

Make VB To Execute SQL SP With Parameters?

May 23, 2010

I have a database in MS SQL Server 2008, I have Stored Procedures. One of them does an INSERT with parameters. It works in Server Management Studio.Now I'd like to make a button in Visual Basic 2008 that executes this SP. I have made a DataSet, it contains my 3 SP's, I can easily use 2 of them, because they return data, but the one I'm having trouble with doesn't. Could anyone please tell me how to make VB to execute it? (The command should look like this: "EXECUTE SP2 a, b, c, d".)

View 1 Replies

VS2005 Error On Execute, Correct In Debug Mode On Some Computers?

Aug 4, 2010

It read some data from a database and put the result into a word document. In this document is a blanc table with a bookmark to indicate the start position.In debugmode this works fine and after distributing thsi is still working fine.A user called me to say that the word document was a complete mess. I ran the application in production mode and yes it is a complete mess. Because the bookmark is not found, the data will be enterd into the wrong column.When i return to debug mode, the apllication is still correct and the result on the word document is good. Behalf of this, there are users who don't have this problem at all.

View 3 Replies

Execute Shell-commands With Parameters?

Mar 2, 2010

I cant understand why this works (Start a service "test" on a remote computer):

Dim rCommand As String
rCommand = "c:pstoolspsservice \computer -u admin -p blabla start test"
Shell("cmd.exe /c" & rCommand)

[Code]....

The above code that doesnt work starts a virtual machine on VmWare Server. I have the exact same line in a .bat file and if i call the batfile from VB it starts the batfile and execute the commmand. I cant understand why this doesnt work without the batfil when i have no problem executing the PsTools command from VB-code.

View 2 Replies

VS 2005 Execute A Command Line EXE (busobj.exe) With Required Parameters Through .Net?

Jul 3, 2009

I am trying to execute a command line EXE (busobj.exe) with required parameters through VB.Net. Because of unknown reason the report is not being generated. Here's the commandline:

Shell(txtBOExecutable.Text & _
" -user " & txtUserName.Text & _
" -pass " & txtPassword.Text & _
" -system " & txtDomain.Text & _

[code].....

View 5 Replies

Displaying And Updating Data In DataGridView With Parent Child Relation Using N-tier Architecture (2008)

Jun 16, 2009

I have recently built an N-Tier app using VB.Net 2008. The application is based on Beth Massi's tutorial at [URL] I am trying to incorporate a datagrridview control on a Parent form - one parent (father and mother) to many children. For example,

[Code]...

View 1 Replies

Apply Mask To Data In A Combobox?

May 8, 2009

I have a data in combobox which is "2003010420030117", and the data is from datasource.

How do I make it look like " 2003/01/04 - 2003/01/17"?

View 5 Replies

VS 2008 Serial Data - Make Sure The Correct Data Is Received?

Jun 28, 2009

I am using Visual Basic express to create a serial interface to a multi-room audio controller. I have started by creating a form that can connect to the controller and I can receive data from the Controller and display Zone status, volume etc in corresponding texts box thaks to help from Stanav and Tassa in my previous thread.

My next problem is to do with receiving lots of data from the serial port and my application getting out of sync. This is mainly caused by turning the volum control as each time it is turned a little bit the controller sends out the new status of the Zone being effected

eg
****Turning Volume knob on Zone 1***
Status returned from Controller:
#Z01PWRON,SRC3,VOL05<CR>

[Code].....

View 7 Replies

Search An Console Application For Specific Data And Apply It?

Jul 30, 2010

I'm fairly new to VB 2008(a few months in) and I'm trying to find certain information in my module. First here is my code:

[Code]...

View 2 Replies

Sql Code - Apply Inserting Data Syntax Into The Try Catch?

Aug 25, 2011

how to apply inserting data syntax into the Try catch..

sqlstr = "insert into StudentDiplomaTable (LastName, FirstName, MiddleName, StudentNo, SoNo, CourseTaken, Honors, DateofGraduation, Copy, DateIssued, DateRealesed, Notes) values ('" _
& txtlastname.Text & "','" _[code]......

View 1 Replies

Password Loop Textbox - Code Works To Read The Entry Data And To Recognise The Correct Data, And The Incorrect

Apr 16, 2012

CODE:

That code works to read the entry data and to recognise the correct data, and the incorrect. However, even if entry is correct, the error msgbox will appear (x times of how many records there are in file), despite being navigated to the menu. Anyway that the Else isn't triggered when data is correct. Also for it to appear just one instead of (x times of how many records there are in file.)

View 2 Replies

C# - Enable The User To Apply A Custom Filter To A System.Data.DataTable?

Feb 16, 2012

I 'd like to enable the user to apply a custom filter to a System.Data.DataTable.At the moment I have a very simple function like this:

Dim result = dataTable.Select(txtUserInput.Text)

With the filtered results I'd like to do further operations(e.g. Database Update/Delete).Is an sql injection protection needed or is the "Select" function secure?


//Edit:Can the "select" function be abused to manipulate any data in the datatable, execute code, ...? If the only danger is that this function can return to much/to less data there is no problem. But if the data in the dataset gets corrupted it's a real problem.

View 3 Replies

Not Showing Correct Data?

Jul 18, 2012

im having a problem on my sql command. here is my command
select ProductCode, ProductName, qtyinstock, critical
from product where qtyinstock <= critical

[code].....

View 3 Replies

Populating DataGridView With Correct Data

Jul 30, 2011

[VB 2008]. I'm trying to populate a DataGridView based on information in the Items in a ListBox (specifically, the file names without hypens or file extensions) and the content of the actual files. The DataGridView is supposed to look something like this:

IDNon-Hyphenated File NameFile Data
1. Some fileThe sky is blue.
2. Another fileThe grass is green.

The Items in the ListBox (lstFiles) look like this:
C:UsersUsernameDesktopFolderAsome-file.txt
C:UsersUsernameDesktopFolderAanother-file.txt

What is happening is that the DataGridView is being populated, but it looks like this:
IDNon-Hyphenated File NameFile Data
1 Another fileThe grass is green.
2 Another fileThe grass is green.

It's adding the second file's information to the DataTable twice and not adding the first file's information at all.

Private Sub btnDoSomething_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDoSomething.Click
Dim pattern As String = "([w:\w /]([a-zA-Z0-9-]+?).w+)"
Dim reg As Regex = New Regex(pattern, RegexOptions.IgnoreCase)
Dim mat As Match
For Each Item In lstFiles.Items
[Code] .....

View 5 Replies

VS 2010 - Correct Way To Read Data Into Textbox

Jan 31, 2012

I'm trying to read data from a text file into an array and then loop through all the lines and display it into the textbox, only problem is i want each line on a new line so this is what i have:

[code]...

But that adds a newline to that last line causing a out of bounds error.How do i make it add a newline for each LINE except the last one?

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved