Author Topic: Action Operation in object model  (Read 757 times)

bilon

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Action Operation in object model
« on: August 30, 2013, 02:11:53 am »
I've created action by dragging element operation into process diagram. I need to manipulate such a actions by vbs script, but I'm not able to find source operation for the action in object model. Does anybody know how to do it?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8030
  • Karma: +183/-22
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Action Operation in object model
« Reply #1 on: August 30, 2013, 03:45:28 pm »
So you mean it creates an CallOperationAction and you want to retrieve the operation it calls?
My EA Navigator does exactly that.
Here the relevant code from CallOperationAction.cs
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("//Classifier_guid");
                  return this.model.getOperationByGUID(operationGUIDNode.InnerText);
              }
              set{
                    // no API method available, so we need to update the database directly
//                    this.model.executeSQL(@"update t_object
//                                                        set Classifier_guid = "+ ((Operation)value).GUID
//                                          + "where Object_ID = " + this.id.ToString();
                        //TODO add GUID property to Operation
                        throw new NotImplementedException();
                    }
        }

Geert

bilon

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Action Operation in object model
« Reply #2 on: August 30, 2013, 05:29:14 pm »
Thanks for yor replay. I've already investigated EA repository, so I know, that operation refence is stored in Classifier_GUID column of T_Object table. So I think your solution definitely works. But it is a bit "obscure". I suppose, there must be some method how to get the operation just by traversing properties and methods of EA objects .

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8030
  • Karma: +183/-22
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Action Operation in object model
« Reply #3 on: August 30, 2013, 05:57:59 pm »
Quote
Thanks for yor replay. I've already investigated EA repository, so I know, that operation refence is stored in Classifier_GUID column of T_Object table. So I think your solution definitely works. But it is a bit "obscure". I suppose, there must be some method how to get the operation just by traversing properties and methods of EA objects .
Believe me, if there was such a method I would be using it.
Unfortunately we have to resort to such methods all too often :-/

Geert