perhaps my understanding is not complete about the salience use, but ,
we have a scenario such as sorting a bunch of reports based on position within the Table
and adding the number of pages from each report cumulatively and then generating a final
report with total number of pages. The pages have some logic to them and hence they need
to added as per the report rank.
. because I know which report comes after the other, the first time I create the decision
table, I have 2 options.
I can just add the reportnames in each row and let the rowNumber be used as the rank. or I
can just assign rank using a separate column . I do not know for sure how to use the
row.rowNumber meta data as a column.
I create a decision Table with Report.name in the condition and set the Report.rank,
report.pages in the action
decision table with Report.reportname as a condition and Report.rank as the action
ReportName Rank pages
reportA 1 4
reportB 2 2
reportC 3 6
reportD 4 8
reportE 5 5
based on some previous rules defined in the ruleflow that decide which reports have been
created so far, lets say, we end up
reportA,reportD, reportE being inserted into memory.
I need to first sort reportA, reportD and reportE as per the rank and then add the number
of pages (4 + 8+ 5 ) in that order because as per the rank, reportA comes first, reportD
comes next and reportE comes next.
Please ignore the logic as to why pages need to be added so. Its the sorting of reports
per the rank that is the issue .
Is there a way to do this kind of sorting of reports as per rank in another rule or can
salience be applied in this case?
Also, a second question is , how to use row.rowNumber as the rank to maintain the order of
the reports in decision table
Hopefully, my description of the usecase hasnt made it worse than before :)
--- On Fri, 9/2/11, Michael Anstis <michael.anstis(a)gmail.com> wrote:
From: Michael Anstis <michael.anstis(a)gmail.com>
Subject: Re: [rules-users] sorting rows/ules fired in a decision table
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Friday, September 2, 2011, 5:58 PM
Sorry I do not understand. Can salience be used? Please explain a little more and I will
try to help.
sent on the move
On 3 Sep 2011 01:09, "puja nandamuri" <med_9501(a)yahoo.com> wrote:
I have a question to ask about sorting rules(rows) fired in a decision table
I have a decision table that has a action column which is kind of a ranking order.
based on some conditions, corresponding rows get fired and as a result, we end up with
rows being selected not necessarily in any order,but based on the ranking order column of
the fired rules, the rows need to be sorted in a subsequent rule .
so, lets say, we end up with rows/rules that get fired as follows:
row7 - ranking order- 3
row 5- ranking order - 6
row 3- ranking order - 4
I would like to sort the rows subsequently as row7,row3, row5
Please note that it is the ranking order that is criteria for sorting, not the row Number
How do I accomplish this ? Please pardon if the question is not clear or confusing.
I will try to present it better .
-----Inline Attachment Follows-----
rules-users mailing list