Book a Demo

Author Topic: Generate Operations with Parameters with SQL in custom RTF Template  (Read 4263 times)

cheskett

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
I'm could use some assistance getting the desired output from a custom RTF template for my model.

I have classes that contain both activities and operations, and using a custom RTF template with SQL I'm trying to select each operation (method) WITH ITS PARAMETERS (this has been the tricky part) for each operation for which there is no activity associated with it.

I'm basically trying to achieve this format:

Operation Name1
    Parameter1
    Parameter2
    ...

Operation Name2
    Parameter1
    Parameter2
    ...

Here's a screenshot of the class I'm working with in the project browser:



The query (or queries) I'm trying to create in this case would pick up G4PS_DISCRETE_Set_No_Behavior_1 with its list of parameters but not G4PS_DISCRETE_Set_State, since it is associated with an activity diagram.

I've been successfully able to select all of the operations with no activity diagrams, but getting the parameters inserted directly below each operation has been giving me difficulties since the #OBJECTID# macro doesn't dig down to the operation level, just class level. This means there is no way to directly reference the last operation that has been processed.

Do any of you have any suggestions of how I could get this formatted correctly?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate Operations with Parameters with SQL in custom RTF Template
« Reply #1 on: March 01, 2016, 03:52:00 pm »
Why would you want to use an SQL fragment?
Operation (method) and parameter are available in the regular template field selector.

When doing with an SQL fragment anyway you'll have to join t_operationparams a fixed number of times and get all of them in a single row.
So for things like this it would be better to use a script fragment.

Geert