0

1. Is there a way to generate an ID in a decision table when a new row is added during Rules authoring.

Say a Decision Table has 2 Offers configured.

<BR>Offer_Name | Offer_id | Offer_expiration_date | offer_type | offer_group<BR>
Offer1         |   1      |  12-31-2019           | DOLLAR     | DISCOUNT<BR>
Offer2         |   2      |  12-31-2030           | DOLLAR     | DISCOUNT

If a Business User goes and adds a new row to the decision table, a new row should appear with the Offer_id already populated with a value - 3.

2. and can this value/column be made non-editable by the user?

  • value/column be made non-editable by the user? do you mean business user? if so u can configure the DT that those columns can be hidden in ODM – ASP Oct 01 '19 at 08:58
  • @ASP : I meant the values are auto-generated with an increment by 1 (like how we have AUTO_INCREMENT in sql server). We were trying to achieve something like when a business user adds a new row in the above Decision Table, the Offer_id field should already have value - 3 populated with the rest of the cells blank where the user can add the Offer details. Also the offer_id field(or column) is non-editable so the business user should not be able to make any change to this field. – user9307545 Dec 27 '19 at 15:16

1 Answers1

0

Re: 1 This is not a standard feature that ODM supports. The purpose of a Decision Table is to filter a set of existing objects based on the values specified in the columns of the Decision Table, then to apply some actions to either update the resulting objects or perhaps create other objects. In either case, it needs a list of existing objects to work from. Many (!) users of ODM would like ODM to provide what I call a Data Table, whose purpose is to specify and create a set of objects with the values specified in the columns of the Data Table. Alas, ODM does not provide such a feature, and in the past has intentionally refused to consider such a feature. Your question does not differentiate between Condition Columns and Action Columns, which leads me to believe you are hoping for a Data Table (which does not exist). Usually, it is possible to re-think your requirement into Condition-Action terms. In the worst case, all rows can share a trivial condition (true = true) and everything else can happen in the actions (such as creating instances). If you are using a Java XOM (and you should be!), you can implement the offer_id functionality behind the scenes in Java.

Re: 2 Older versions of ODM supported Decision Table templates, which allowed a developer to lock certain aspects of the Decision Table from the rule author. That feature is now deprecated (since 8.9, I believe), and there is no replacement for it.