Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: meeert on December 21, 2023, 09:08:37 pm

Title: Custom SQL Query passing EAGUID or Scenario?
Post by: meeert on December 21, 2023, 09:08:37 pm
Hi,

I'm trying to access the EAGUID to filter per scenario in a way like the #OBJECTID# is being passed in SQL within Templates.

Code: [Select]
SELECT
a.step.value('@level', 'NVARCHAR(MAX)') AS 'step',
a.step.value('@name', 'NVARCHAR(MAX)') AS 'action',
a.step.value('@result', 'NVARCHAR(MAX)') as result,
a.step.value('@uses', 'NVARCHAR(MAX)') as comment
FROM
(SELECT CAST(XMLContent AS XML) AS Content FROM t_objectscenarios WHERE Object_ID = #OBJECTID# ???AND ea_guid = #EAGUID#???) s
CROSS APPLY Content.nodes('/path/step') a (step)

Is there a way to pass the EAGUID within a custom query (template)? OR Scenario name with SQL? Or should I use a custom script to get the desired result?
Title: Re: Custom SQL Query passing EAGUID or Scenario?
Post by: Geert Bellekens on December 21, 2023, 09:38:21 pm
No, fragments are executed per object, not per scenario.

Geert
Title: Re: Custom SQL Query passing EAGUID or Scenario?
Post by: meeert on December 21, 2023, 09:40:49 pm
Not even when the 'Scenario' checkbox is enabled within the template?
Title: Re: Custom SQL Query passing EAGUID or Scenario?
Post by: Geert Bellekens on December 21, 2023, 09:53:30 pm
Not even when the 'Scenario' checkbox is enabled within the template?
No, doesn't matter. The only parameter your fragment is getting is the object ID

Geert