Book a Demo

Author Topic: UI Inteface  (Read 7006 times)

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
UI Inteface
« on: April 08, 2015, 06:19:34 pm »
Hello!

I am looking for any practices in order to build a UI for the user to act in EA (to modify items or such)
Any piece of advice is accepted!

What i have done right now it to use ActiveXObject as an InputBox (really simple and usefull).


I am now trying something a bit more complicated.
Reorder an EA collection the way i want it (is that even possible? it should be as you can getAt(i))



The target is modify a list the way i want it in the order i want it.
(WHO TALKED ABOUT TESTING?  :D :D)

thanks community!

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: UI Inteface
« Reply #1 on: April 09, 2015, 01:02:59 am »
EDIT : Found one way to do it, but i do not like it.
I use excel and vb macro.  :'( :'(

Does not work.
[size=16]
How can we reorder an Ea.collection?
[/size]
What if we want to handle elements in a certain specific order wich do not correspond with the way EA order them?
actually, how does EA order his element? it does not seem to be by name... by GUID maybe?


if you got better something, i'd love to hear it out.  :-* :-*

No can do with EA collection, used a guid arraylist, and an inputbox... still not as clean as i wanted.
Code: [Select]
!INC Local Scripts.EAConstants-JScript
!INC Shared Scripts.INPUTBOX:Library

function main()
{
      // TODO: Enter script code here!
      Session.Output ( "START")
      var coll as EA.Collection
      //KO//var newColl as EA.Collection
      var List = [];
      var orderedList=[];
      var el as EA.Element
      
      coll = Repository.GetTreeSelectedElements
      Session.Output("Number : "+      coll.Count)
      for (i=0;i<coll.Count;i++)
            {el= coll.GetAt(i)
                  //Session.Output ( "That field " + i + " : "+ el.ElementGUID)
                  //Session.Output ( "That field " + i + " : "+ el.Name)
                  //Session.Output ( "That field " + i + " : "+ el.Type)
                  List[i] = el.ElementGUID;
                  Session.Output ( "That field " + i + " : " +List[i])
            }
            
            Session.Output ( "List.length : " + List.length)
      for ( i = 0; i<List.length; i++)
      {
            el = Repository.GetElementByGuid(List[i])
            var k = InputBox("Merci de saisir la position de l'objet " +el.Name + " en position " + i + " a ce jour" ,"List");
            orderedList[k] = el.ElementGUID            
            }
            
      Session.Output ( "orderedList.length : " + orderedList.length)
      Session.Output ( "Ordre final : ")
            
      for ( i = 0; i<orderedList.length; i++)
      {
            el = Repository.GetElementByGuid(orderedList[i])
            Session.Output(i + "    " + orderedList[i])
            Session.Output("Element " +el.Name + " va etre traité en  " + i + " position")
            orderedList[k] = el.ElementGUID            
            }
      
      Session.Output ( "END")
      
      
}

Repository.EnsureOutputVisible( "Script" );
Repository.ClearOutput("Script");
main();
« Last Edit: April 09, 2015, 06:48:49 pm by damien.reche »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: UI Inteface
« Reply #2 on: April 09, 2015, 06:59:01 pm »
I'd say that you simply write a SortedCollection that can sort a collection according to your criteria. You're likely better served on StackOverflow with that kind of questions.

q.

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: UI Inteface
« Reply #3 on: April 09, 2015, 07:01:45 pm »
<3 Thank you Q!

I'll start looking that way.
But, the problem is, there is no defined criteria (other than tester's knowledge).
Lets say there are 3 step.
1
2
3
Execution can be (and corresponding results order):
1      or       1    or   2  or     2   or  3   or 3
2               3            1                3          2      1
3              2            3                1        1          2

That's why i was trying to create that UI.
The only solution for sorting i saw online was using name/tag value
http://www.umlchannel.com/en/component/k2/item/91-sparxsystems-enterprise-architect-project-browser-script-sort-by-alias-sort-by-tagged-value
« Last Edit: April 09, 2015, 07:29:16 pm by damien.reche »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: UI Inteface
« Reply #4 on: April 09, 2015, 07:40:23 pm »
That rather looks like you want to have all possible permutations?

q.

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: UI Inteface
« Reply #5 on: April 09, 2015, 07:48:20 pm »
Test can be ordered in ANY way tester want to execute.
It is defined manually (if you have 1000 tests maybe only the 2 first are switched)

that's why i was trying to do the interface on my first post.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: UI Inteface
« Reply #6 on: April 10, 2015, 03:25:43 am »
I don't really get it what it has to do with sorting. Can't you simply use the green arrow to place the elements in the order you want them?

q.

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: UI Inteface
« Reply #7 on: April 10, 2015, 05:10:42 pm »
Yes, that work on the tree view. But how sort the Ea.collection then?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: UI Inteface
« Reply #8 on: April 10, 2015, 06:28:19 pm »
Use the TreePos property then.

q.