cancel
Showing results for 
Search instead for 
Did you mean: 

Date range validity evaluation in BRM table

Former Member
0 Kudos

Lectori salutem, Gurus salutem,

I'm using 7.3 sp03. I would like to achieve the following with BRM (bit simplified):

a parameter, ABC, is passed to a ruleSetService, and needs to be evaluated.

The table is as follows:

ABC startDate endDate Value

1 01-01-2011 31-12-2011 A

1 01-01-2012 31-12-2012 B

2 01-01-2011 31-12-2011 X

4 01-01-2012 31-12-2012 Y

When ABC-value '1' is passed to the ruleSetService in the table the first row needs to be selected. CurrentDate (24-11-2011) is in between 01-01-2011 and 31-12-2011, making this the valid row. The value that should be returned is A.

Beginning of next year it should change to B.

How should I set this up in BRM?

Thanks in advance!

Martijn.

Accepted Solutions (0)

Answers (1)

Answers (1)

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Martijn,

Appreciate that you've simplifiied the scenario... but do you have any idea how many of these entries you are likely to have in total as that may change the answer.

You have a couple of choices that might work here...

1. You could a decision table... to hold your values (i.e. ABC and date range as conditions, value as action) and use the rule that evaluates the decision table to pick up the current date for the comparison. e.g. date conditions would be "greater than than 01-01-2011", "less than 31-12-2011", etc.

2. Alternatively, if the plan is to have a simple end of year change over, you could use Effectivities (in the Project Resources of the rules project) to determine which values are selected and use a decision table or even just a rule script to determine the value.

But the thing is... HOW you organise your rule is going to depend a lot on:

a) How many entries in total do you expect

b) Is there a nice neat cutover of all ABC values at the same time or do effective date ranges vary a lot between different ABC values

c) Who's responsible for maintaining these and if multiiple people are responsible do you need to organise your rule to cater for that? E.g. Are different people responsible for different ABC entries

Does that help at all?

Regards,

Jocelyn

Former Member
0 Kudos

Hi Jocelyn,

Yes, it helps. Thanks for your reaction.

The table may have many, many entries. Could be 1000 rows, or more.

The cutover is a simplification as well, since date ranges are unpredictable. So I'm afraid that alternative 2 would not work. Too bad, since that is the "easiest" solution.

There will be one person in charge for maintaining the table. This will probably be done via the portal-solution, and spreadsheets. Would that have an impact on the action, in alternative 1?

I tried to set up alternative 1, but could not get it to work. Would you have an example? Or is there a blog to explain this?

Let me know your opinion anyways.

Best regards,

Martijn.

Former Member
0 Kudos

Hi Gurus,

Herewith the solution to this matter (for me at least):

Add a variable definition:

Date Today = Current Date

Add Today as a condition, and per row the start date and end date as follows:

Between 2011-01-01 and 2099-12-31

Best regards,

Martijn.

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Martijn,

Thanks for posting your solution.

Just to expand on that, if you just want to use date and not time, I'd recommend sticking to java.util.Date type. It's simpler.

You can also use "Before <date>" and "After <date>" for the extremes of your date ranges.

You might also want to put a date field of that type in your XSD definition (that's used to call yoru rule) instead of using Today - that way you can pass in the effective date you want and allow for running the rule in the past/future - which can be handy.

I'll add your suggestion of a blog to my list of potential knowlege assets for BRM... we are currently working on increasing the knowledge assets for BPM, BRM and BRFplus... it's a gradual process but we are always open to ideas.

Regard,s

Jocelyn