Book a Demo

Author Topic: Action: how to get reference for CallBehavior  (Read 3721 times)

Pavel Bunygin

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Action: how to get reference for CallBehavior
« on: April 24, 2015, 11:26:24 pm »
Hi!
I'm trying to find an element that selected in 'Behaviour' field of 'Call' tab for Action from my Add-In.

Can someone help with it?


Thanks in advance

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Action: how to get reference for CallBehavior
« Reply #1 on: April 24, 2015, 11:48:08 pm »
I implemented that for operations in the EA Navigator

If it is a CallOperationAction then it does this:

Code: [Select]
       /// <summary>
        /// The operation to be invoked by the action execution.
        /// </summary>
        public UML.Classes.Kernel.Operation operation {
              get{
                    // first get the operations guid which is stored in the Classifier_guid column
                    XmlDocument operationGUIDxml = this.model.SQLQuery(@"select o.Classifier_guid from t_object o
                                                      where o.Object_ID = " + this.id.ToString());
                    XmlNode operationGUIDNode = operationGUIDxml.SelectSingleNode(this.model.formatXPath("//Classifier_guid"));
                  return this.model.getOperationByGUID(operationGUIDNode.InnerText);
              }
        }

I guess finding out a linked element must be rather similar.

Geert

Pavel Bunygin

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Action: how to get reference for CallBehavior
« Reply #2 on: April 24, 2015, 11:59:03 pm »
You are a genious!
Thank you very much!

It is Element.ClassifierID  \ t_object.Classifier (Classifier_guid)