Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » how to setSource&setTarget for ControlFlow in Activity??
how to setSource&setTarget for ControlFlow in Activity?? [message #477072] Wed, 12 March 2008 03:23 Go to next message
xiaoqiang is currently offline xiaoqiangFriend
Messages: 20
Registered: July 2009
Junior Member
Hi all,
I am creating a ControlFlow in Activity Diagram programmatically,
the codes are:
ActionModel am1=new ActionModel();
ActionModel am2=new ActionModel();
org.eclipse.uml2.uml.ControlFlow controlFlow=(ControlFlow)
activity.createEdge(name, UMLPackage.Literals.CONTROL_FLOW);
controlFlow.setSource(am1);
controlFlow.setTarget(am2);

But,the code can't run successfully.I am not very familiar with the UML2
API,so I want the correct code.

Thank you very much! I am appreciated your reply.
-xiaoqiang
Re: how to setSource&setTarget for ControlFlow in Activity?? [message #477084 is a reply to message #477072] Wed, 12 March 2008 19:04 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
What's an 'ActionModel' ? is it an ActivityNode?
If so then your code should work. What is the error you are running into?

- James.


"xiaoqiang" <jqzhao1985@gmail.com> wrote in message
news:fr7ias$fns$1@build.eclipse.org...
> Hi all,
> I am creating a ControlFlow in Activity Diagram programmatically,
> the codes are:
> ActionModel am1=new ActionModel();
> ActionModel am2=new ActionModel();
> org.eclipse.uml2.uml.ControlFlow controlFlow=(ControlFlow)
> activity.createEdge(name, UMLPackage.Literals.CONTROL_FLOW);
> controlFlow.setSource(am1);
> controlFlow.setTarget(am2);
>
> But,the code can't run successfully.I am not very familiar with the UML2
> API,so I want the correct code.
>
> Thank you very much! I am appreciated your reply.
> -xiaoqiang
Re: how to setSource&setTarget for ControlFlow in Activity?? [message #477086 is a reply to message #477084] Thu, 13 March 2008 01:22 Go to previous messageGo to next message
xiaoqiang is currently offline xiaoqiangFriend
Messages: 20
Registered: July 2009
Junior Member
James Bruck 写道:
> What's an 'ActionModel' ? is it an ActivityNode?
> If so then your code should work. What is the error you are running into?
>
> - James.
>
>
> "xiaoqiang" <jqzhao1985@gmail.com> wrote in message
> news:fr7ias$fns$1@build.eclipse.org...
>> Hi all,
>> I am creating a ControlFlow in Activity Diagram programmatically,
>> the codes are:
>> ActionModel am1=new ActionModel();
>> ActionModel am2=new ActionModel();
>> org.eclipse.uml2.uml.ControlFlow controlFlow=(ControlFlow)
>> activity.createEdge(name, UMLPackage.Literals.CONTROL_FLOW);
>> controlFlow.setSource(am1);
>> controlFlow.setTarget(am2);
>>
>> But,the code can't run successfully.I am not very familiar with the UML2
>> API,so I want the correct code.
>>
>> Thank you very much! I am appreciated your reply.
>> -xiaoqiang
>
>
Hi James,
Thank you very much for caring for my question.
Now,'ActionModel' is not an ActivityNode.
I need to set both the ControlFlow's source and target be an action,so,I
want to know the relationship between 'org.eclipse.uml2.uml.Action'
and 'org.eclipse.uml2.uml.ActivityNode'.
Thanks.
-xiaoqiang
Re: how to setSource&setTarget for ControlFlow in Activity?? [message #477087 is a reply to message #477086] Thu, 13 March 2008 01:40 Go to previous message
xiaoqiang is currently offline xiaoqiangFriend
Messages: 20
Registered: July 2009
Junior Member
xiaoqiang 写道:
> James Bruck 写道:
>> What's an 'ActionModel' ? is it an ActivityNode?
>> If so then your code should work. What is the error you are running into?
>>
>> - James.
>>
>>
>> "xiaoqiang" <jqzhao1985@gmail.com> wrote in message
>> news:fr7ias$fns$1@build.eclipse.org...
>>> Hi all,
>>> I am creating a ControlFlow in Activity Diagram programmatically,
>>> the codes are:
>>> ActionModel am1=new ActionModel();
>>> ActionModel am2=new ActionModel();
>>> org.eclipse.uml2.uml.ControlFlow controlFlow=(ControlFlow)
>>> activity.createEdge(name, UMLPackage.Literals.CONTROL_FLOW);
>>> controlFlow.setSource(am1);
>>> controlFlow.setTarget(am2);
>>>
>>> But,the code can't run successfully.I am not very familiar with the UML2
>>> API,so I want the correct code.
>>>
>>> Thank you very much! I am appreciated your reply.
>>> -xiaoqiang
>>
> Hi James,
> Thank you very much for caring for my question.
> Now,'ActionModel' is not an ActivityNode.
> I need to set both the ControlFlow's source and target be an action,so,I
> want to know the relationship between 'org.eclipse.uml2.uml.Action'
> and 'org.eclipse.uml2.uml.ActivityNode'.
> Thanks.
> -xiaoqiang
Hi James,
I have solved this problem by getNode(String name).
I am extremely grateful to you.Thanks to eclipse newsgroup.
Cheers.
-xiaoqiang
Re: how to setSource&setTarget for ControlFlow in Activity?? [message #626211 is a reply to message #477072] Wed, 12 March 2008 19:04 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
What's an 'ActionModel' ? is it an ActivityNode?
If so then your code should work. What is the error you are running into?

- James.


"xiaoqiang" <jqzhao1985@gmail.com> wrote in message
news:fr7ias$fns$1@build.eclipse.org...
> Hi all,
> I am creating a ControlFlow in Activity Diagram programmatically,
> the codes are:
> ActionModel am1=new ActionModel();
> ActionModel am2=new ActionModel();
> org.eclipse.uml2.uml.ControlFlow controlFlow=(ControlFlow)
> activity.createEdge(name, UMLPackage.Literals.CONTROL_FLOW);
> controlFlow.setSource(am1);
> controlFlow.setTarget(am2);
>
> But,the code can't run successfully.I am not very familiar with the UML2
> API,so I want the correct code.
>
> Thank you very much! I am appreciated your reply.
> -xiaoqiang
Re: how to setSource&setTarget for ControlFlow in Activity?? [message #626214 is a reply to message #477084] Thu, 13 March 2008 01:22 Go to previous message
xiaoqiang is currently offline xiaoqiangFriend
Messages: 20
Registered: July 2009
Junior Member
James Bruck 写道:
> What's an 'ActionModel' ? is it an ActivityNode?
> If so then your code should work. What is the error you are running into?
>
> - James.
>
>
> "xiaoqiang" <jqzhao1985@gmail.com> wrote in message
> news:fr7ias$fns$1@build.eclipse.org...
>> Hi all,
>> I am creating a ControlFlow in Activity Diagram programmatically,
>> the codes are:
>> ActionModel am1=new ActionModel();
>> ActionModel am2=new ActionModel();
>> org.eclipse.uml2.uml.ControlFlow controlFlow=(ControlFlow)
>> activity.createEdge(name, UMLPackage.Literals.CONTROL_FLOW);
>> controlFlow.setSource(am1);
>> controlFlow.setTarget(am2);
>>
>> But,the code can't run successfully.I am not very familiar with the UML2
>> API,so I want the correct code.
>>
>> Thank you very much! I am appreciated your reply.
>> -xiaoqiang
>
>
Hi James,
Thank you very much for caring for my question.
Now,'ActionModel' is not an ActivityNode.
I need to set both the ControlFlow's source and target be an action,so,I
want to know the relationship between 'org.eclipse.uml2.uml.Action'
and 'org.eclipse.uml2.uml.ActivityNode'.
Thanks.
-xiaoqiang
Re: how to setSource&setTarget for ControlFlow in Activity?? [message #626216 is a reply to message #477086] Thu, 13 March 2008 01:40 Go to previous message
xiaoqiang is currently offline xiaoqiangFriend
Messages: 20
Registered: July 2009
Junior Member
xiaoqiang 写道:
> James Bruck 写道:
>> What's an 'ActionModel' ? is it an ActivityNode?
>> If so then your code should work. What is the error you are running into?
>>
>> - James.
>>
>>
>> "xiaoqiang" <jqzhao1985@gmail.com> wrote in message
>> news:fr7ias$fns$1@build.eclipse.org...
>>> Hi all,
>>> I am creating a ControlFlow in Activity Diagram programmatically,
>>> the codes are:
>>> ActionModel am1=new ActionModel();
>>> ActionModel am2=new ActionModel();
>>> org.eclipse.uml2.uml.ControlFlow controlFlow=(ControlFlow)
>>> activity.createEdge(name, UMLPackage.Literals.CONTROL_FLOW);
>>> controlFlow.setSource(am1);
>>> controlFlow.setTarget(am2);
>>>
>>> But,the code can't run successfully.I am not very familiar with the UML2
>>> API,so I want the correct code.
>>>
>>> Thank you very much! I am appreciated your reply.
>>> -xiaoqiang
>>
> Hi James,
> Thank you very much for caring for my question.
> Now,'ActionModel' is not an ActivityNode.
> I need to set both the ControlFlow's source and target be an action,so,I
> want to know the relationship between 'org.eclipse.uml2.uml.Action'
> and 'org.eclipse.uml2.uml.ActivityNode'.
> Thanks.
> -xiaoqiang
Hi James,
I have solved this problem by getNode(String name).
I am extremely grateful to you.Thanks to eclipse newsgroup.
Cheers.
-xiaoqiang
Previous Topic:Sequence Diagrams - creating a message which source and target is the same lifeline
Next Topic:Adding a menu entry to the UML Editor Menu
Goto Forum:
  


Current Time: Thu Apr 18 02:32:45 GMT 2024

Powered by FUDForum. Page generated in 0.01886 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top