Book a Demo

Author Topic: Determine 'IsReturn' on a sequence connector?  (Read 5334 times)

Chris Tatem

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Determine 'IsReturn' on a sequence connector?
« on: October 17, 2008, 03:18:32 am »
I am attempting to create sequence diagrams through the automation API.  I am "stringing" together several existing diagrams into one long diagram.  I have *most* of it working, but how can I tell if an existing connector (of type Sequence) has been "flagged" as IsReturn?  And then, how could I set that on a new Connector?  I can set that through the client here:
"Is Return checkbox in the Control Flow Type panel"

...I've tried subtype, EventFlafs, subtype and don't see it.

thanks
cwt

jkorman

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Determine 'IsReturn' on a sequence connector?
« Reply #1 on: October 17, 2008, 05:52:07 am »
try Connector.MiscData(3) (PDATA4)
  1 = isReturn

SubType appears to follow Lifecycle
 
Jim

Chris Tatem

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Determine 'IsReturn' on a sequence connector?
« Reply #2 on: October 17, 2008, 08:02:28 am »
Thanks Jim, this correlates with the models that I'm reading!

Takeshi K

  • EA User
  • **
  • Posts: 632
  • Karma: +43/-1
    • View Profile
    • Sparx Systems Japan
Re: Determine 'IsReturn' on a sequence connector?
« Reply #3 on: October 17, 2008, 03:32:24 pm »
For your information, you can get (and maybe update) the value by:

Connector.Properties.Item("IsReturn")

Hope this helps,
--
t-kouno

jkorman

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Determine 'IsReturn' on a sequence connector?
« Reply #4 on: October 18, 2008, 12:13:37 am »
Excellent, thanks.......

I like that better.

Jim

Chris Tatem

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Determine 'IsReturn' on a sequence connector?
« Reply #5 on: October 18, 2008, 01:35:00 am »
I liked the promise of this, but tried it and at least in the following (java) code snippet, didn't seem to work - unless I'm doing something wrong.

Code: [Select]
for (org.sparx.Property p : thisConnector.GetProperties()) {
      System.out.println("Property " + p.GetName() + "=" + p.GetValue() );
}
System.out.println("Misc " + thisConnector.MiscData(3));
org.sparx.Property isR = (thisConnector.GetProperties()).Item("IsReturn");
System.out.print("R" + isR.GetValue() + "?");

produces (for these two example connectors).  The IsReturn property is always null.  The second connector has isReturn selected on the diagram.

Property Name=getCustPayCard()
Property Type=Sequence
Property Kind=Call
Property IsReturn=null
Property IsAsync=null
Misc 0
Rnull?

Property Name=
Property Type=Sequence
Property Kind=Call
Property IsReturn=null
Property IsAsync=null
Misc 1
Rnull?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Determine 'IsReturn' on a sequence connector?
« Reply #6 on: October 18, 2008, 02:07:24 am »
What about the SubType attribute?

If that does not help, check the ConnectorEnd objects. [But I really don't think that's the problem.]
No, you can't have it!