Book a Demo

Author Topic: DMN Tables and Automation API  (Read 3066 times)

Greenbolt

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
DMN Tables and Automation API
« on: March 12, 2020, 06:17:17 am »
Good afternoon everyone,

I am testing around with DMN tables and the Automation API. I created a Diagram, added a Decision Table and added DMN Expressions into the Table and successfully validated the expressions.
Now, when I'm running some Javascript or Java on that Element inside the table and want to print out the DMN Expression I get no output. I'm using the "getDecisionTable()" function in the Element class. Is that the wrong approach or is there something else missing to get the DMN Expression returned?


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: DMN Tables and Automation API
« Reply #1 on: March 12, 2020, 07:22:18 am »
I have no idea what that DMN would be. But without seeing the code it's hard to guess what's wrong.

q.

Greenbolt

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: DMN Tables and Automation API
« Reply #2 on: March 13, 2020, 01:36:47 am »
DMN is Decision Model and Notation. This is a quote from Wikipedia:
Quote
It is a standard approach for describing and modeling repeatable decisions within organizations to ensure that decision models are interchangeable across organizations

Basically I would like to read out the decision in my Element and do something with it with the help of the Automation API.
This code is a Javascript example:
Code: [Select]

selectedObjects = currentDiagram.SelectedObjects;

if ( selectedObjects.Count > 0 )
{
var element as EA.Element;
var dO as EA.DiagramObject;
dO = selectedObjects.GetAt(0);
element = Repository.GetElementByID(dO.ElementID);
Session.Output("Decision Table: " + element.GetDecisionTable());
Session.Output("Bus Rules: " + element.GetBusinessRules() );
}
The output for GetDecisionTable and GetBusinessRules is both empty.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: DMN Tables and Automation API
« Reply #3 on: March 13, 2020, 02:17:44 am »
In former days I was eager to test a new API as soon as possible. No longer now since I'm tired of being used as guinea pig. I might look into that when V16 comes out (not sure, though). You're better off sending a bug report to Sparx (see link down this page in the Support section).

q.