webMethods business rules: How to create a decision table that depends on another decision table - rule-engine

I am using the native rule engine of webMethods (wm Business rule) to create complex rule. I need to create a decision table that depends on the result of another decision table. As shown in the graphic below,

I finally find out how to do it.
The idea is to put both decision tables into the same rule set. Then running the rule set by providing var1, var2, param1 and param2
The rule engine is going to infer the result for the first decision table into the second one.
NB. the name of the result of the first table has to be the same in the second table.

Related

DAX SUMMARIZE function isn't respecting row-based security in my Power BI Model

I'm adding Row-level security to a Power BI model and it's working on all the normal tables, but there's a DAX table created from a SUMMARIZE that's ignoring the security. I've created a small model that reproduces the issue - am I doing something wrong here, or is this behavior intentional?
Here's my data model - "Raw Table" is just a manual table with some numbers in it and a filter column:
"DAX Table" is created with a SUMMARIZE statement that just makes it a copy of the manual table (since every row is unique anyways):
DAX Table = SUMMARIZE('Raw Table', 'Raw Table'[Number], 'Raw Table'[Filter])
Here's what the content of the tables look like when nothing is filtered:
I've added row-level security that filters the Filter table to just the "Show" records:
And through the join, this appears to filter the Raw table normally - when it's enabled, I can only see the rows with "Show" in them (as expected). However, the DAX table continues to show everything, even the filtered rows that I'm not supposed to see:
What am I doing wrong here? Since I'm not allowed (via RLS) to see the rows labelled "Hide" in the raw table, shouldn't those also be excluded from the SUMMARIZE statement? I realize that adding a slicer on the Filter table and slicing the Raw table doesn't impact the SUMMARIZE statement (I still see all the rows in that case) - am I just seeing the same thing here? Since I'm prevented from seeing these rows based on a security setting, I'd expect them to be hidden from my DAX as well.
Assuming I'm doing this correctly and this is intentional, how can I create a DAX table that does respect my security filters (as I need to do this in my full model)?
Here's a link to the testing PBIX file as well.
Calculated Tables (and columns) get calculated when the model is loaded, and materialized. Not at runtime.
You will need to connect that table to your model so security propagates there aswell.

Drools Guided Decision table :How to reference fact in action column?

I am trying to use the Guided decision table in Drools Workbench 7.8.0.Final. I am binding a fact pattern for the condition column. Like so:
I then add a condition for one of the fields.
I now add an action column.
I bind it to a different fact. I want a field of this fact to be same as person.age.
How can I do this in the decision table?
It seems to allow only constants
p.age is taken to be a string constant. Not what I want.

TSQL list of business rules in MDS

I need help with querying my business rules in SQL!
I have created couple of business rules in MDS web service to validate my master data and found out that 2 % of my data is not complying with the rules. Now I have created a SQL subscription view to report on the invalid data in PowerBI. In my PowerBI report I need to tell the business user why the data is invalid but I cannot since the subscription view only tells where the data is invalid but not why the data is invalid. So I need to know how I might query my business rules from MDS database in SQL and map it with my PowerBI data model. Is there a way to query the list of business rules from MDS database?
OK, so there are multiple ways to go about this. Here are some solutions, pls choose one that suits your scenario.
1. SQL - List of all Business Rules
The following query will retrieve the list of all Active Business Rules created in MDS.
SELECT *
FROM [MDM].[mdm].[viw_SYSTEM_SCHEMA_BUSINESSRULES]
WHERE Model_Name = 'YourModelName'
AND BusinessRule_StatusName = 'Active'
You can, of course, further filter by Entity_Name, etc.
The important columns in your case are going to be:
[BusinessRule_Name]
[BusinessRule_Description]
[BusinessRule_RuleConditionText]
[BusinessRule_RuleActionText]
Note: The challenge in your scenario, I think, is going to be that the Subscription View of the entity does not have IDs of the exact Business Rules that failed. So I'm not sure how you'll tie these 2 together (failing Rows -> List of Business Rules). Also remember that each row may have more than 1 business rule that failed.
2. using View viw_SYSTEM_USER_VALIDATION
This is a view that has a historical list of all business rules (+row info) that failed. You may use the view in this way:
SELECT
DISTINCT ValidationIssue_ID, Version_ID, VersionName, Model_ID, ModelName, Entity_ID, EntityName, Hierarchy_ID, HierarchyName, Member_ID, MemberCode, MemberType_ID, MemberType, ConditionText, ActionText, BusinessRuleID, BusinessRuleName, PriorityRank, DateCreated, NotificationStatus_ID, NotificationStatus
FROM [MDM].[mdm].[viw_SYSTEM_USER_VALIDATION]
WHERE --CAST(DateCreated as DATE) = CAST(GETDATE() as DATE) AND
ModelName = 'YourModelName'
--AND EntityName IN ('Entity_1','Entity_2') -- Use this to Filter on specific Entities
Here, use the columns Model_ID, Entity_ID and Member_ID/MemberCode to identify the specific model, entity & row that failed.
Columns BusinessRuleName, ConditionText & ActionText will give your users additional info on the Business Rule that failed.
Note:
One issue with using this view is that even though, let's say, your failure condition was resolved the next day by the user, the view will still show that on a certain date, a validation had failed. (via column DateCreated).
Also note that the same failed data row will appear multiple times here if multiple Business Rules on the same row failed validation (there will be different BusinessRuleID/Name, etc). Just something to take note of.
Similarly, the same row may appear multiple times if it has failed again & again at different times. To workaround this, and if your final report can do with that, add a WHERE clause on the DateCreated column so that you only get to see any row that Failed today. The commented out line of code <--CAST(DateCreated as DATE) = CAST(GETDATE() as DATE) AND> does the same. If you can't use that, just make sure the data row are distinct. However, if you do this, remember that if something Failed yesterday (and is still in the Failed status), it may not show up.
My suggestion would be to use a slightly modified version of Solution #2:
Get the list of Failed Rows from your Subscription View (the data row's ValidationStatus is actually still 'Failed'), then JOIN with viw_SYSTEM_USER_VALIDATION making sure that you only select the row with MAX(DateCreated) value (of course for the same data row AND Business Rule).
Best of luck and if you find anything else while solving this issue, do share your learning here with all of us.
Lastly, if you found this useful, pls remember to Mark it as the Answer :)

How to create table occurrences for filtered data..?

I have a table called transactions. Within that is a field called ipn_type. I would like to create separate table occurrences for the different ipn types I may have.
For example, one value for ipn_type is "dispute". In the past I would create a global field called "rel_dispute" and I would populate that with the value of "dispute". Then I could create a new table occurrence of the transactions table, and make a relationship based on transactions::ipn_type = transactions::rel_dispute. This way only the dispute records would show up in my new table occurrence.
Not long ago, somebody pointed out to me that this is no longer necessary, and there is a simpler way to setup such a relationship to create a new table occurrence. I can't for the life of me remember how that was done, though.
Any information on this would be greatly appreciated. Thanks!
To show a found set of only one type, you must either perform a find or use the Go to Related Record script step to show only related records. What you describe as your previous setup fits the latter.
The simpler way is to perform a find - either on demand, or by a script triggered OnLayoutEnter.
The new 'easy' way is probably:
using one base relationship only and
filtering only the displaying portal by type. This can be done with a global field, a global variable containing current display type. Multiple portals with different filter conditions are possible as well.
~jens

What's the ideal way to store dropdown list text/values in a Postgres 9.4?

What's the optimal way to store values for a select list in a web-app with Postgres?
If I use an enum, this has the benefit of acting as a constraint for whatever column is set to that type (only allowing possible values). I can also write rather normal queries to pull those values to populate the select... but this has the drawback of requiring the option text and value to be identical.
If I create a table to store these, I can have columns for both value and text, and perhaps even a third (comment/description, whatever). However, it means a full table for every set of values, of which I expect several dozen throughout the webapp. Not sure why this feels like a "heavier" solution than enums, but it does. (A "create enum" statement plus possible "alter enum" in the future vs. a "create table" plus many initial insert statements and maybe more in the future.)
Nor can I create a single table for all dropdown lists, because then I would need to do convoluted constraint logic in the various tables that related to that.
Is there a code pattern that is ideal for this problem that I'm unaware of?
The solution doesn't need to be portable to other database engines... I'm more than happy to use a postgres-only solution.