Book a Demo

Author Topic: Port Initial value  (Read 4822 times)

Daniel P

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Port Initial value
« on: October 09, 2015, 02:34:31 am »
Hello,

Using element SetPropertyType I can set property type of a port (which can be found by double clicking a port and then clicking on Property right under General).

But I cannot find how I set the initial value using the java automation library

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Port Initial value
« Reply #1 on: October 09, 2015, 07:55:07 am »
Gosh! All those strange things. EA creates an entry in PDATA1. For my test I create an Int=7 and it created {EAINT000-B653-4f3c-A010-30205D67F5F5}. So the INT is probably not the Int but means INTernal (I guess). But then, what does it mean? Even stranger: when changing to Int=8 this guid-thing stayed the same. Mystery files, the series.

Next, please. Passing to Sparx.

q.
« Last Edit: October 09, 2015, 07:58:46 am by qwerty »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Port Initial value
« Reply #2 on: October 09, 2015, 08:33:35 am »
I don't know where the initial value is stored. Try the linked xrefs.

As for that guid, although it's not relevant to the original question. From memory we needed a way to refer to the standard UML primitive types. They aren't represented in user models directly, and the only reference to a port type is the guid. If you try using one of the other primitive types you'll see that INT doesn't mean internal.

Daniel P

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Port Initial value
« Reply #3 on: October 09, 2015, 06:44:34 pm »
Quote
I don't know where the initial value is stored. Try the linked xrefs.

As for that guid, although it's not relevant to the original question. From memory we needed a way to refer to the standard UML primitive types. They aren't represented in user models directly, and the only reference to a port type is the guid. If you try using one of the other primitive types you'll see that INT doesn't mean internal.

Thanks, I found the CustomProperty in the t_xref but now I see I cannot add a new CustomProperty. My java code is:

Collection<CustomProperty> properties = element.GetCustomProperties();
CustomProperty property = properties.AddNew("Name", "@PROP=@NAME=default@ENDNAME;@TYPE=String@ENDTYPE;@VALU=100@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;");
properties.Refresh();
                  
element.Update();


Nothing happens

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Port Initial value
« Reply #4 on: October 09, 2015, 08:20:22 pm »
My bad (was probably too late). You can create the entry in t_xref yourself. Use Repository.Execute to create an entry. The primary key guid is just a random guid.

q.

Daniel P

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Port Initial value
« Reply #5 on: October 09, 2015, 11:19:14 pm »
Quote
My bad (was probably too late). You can create the entry in t_xref yourself. Use Repository.Execute to create an entry. The primary key guid is just a random guid.

q.

Yeah, I did that eventually