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] Tue, 11 March 2008 23:23 Go to next message
xiaoqiang is currently offline xiaoqiang
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 15:04 Go to previous messageGo to next message
james bruck is currently offline james bruck
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] Wed, 12 March 2008 21:22 Go to previous messageGo to next message
xiaoqiang is currently offline xiaoqiang
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] Wed, 12 March 2008 21:40 Go to previous message
xiaoqiang is currently offline xiaoqiang
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 15:04 Go to previous message
james bruck is currently offline james bruck
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] Wed, 12 March 2008 21:22 Go to previous message
xiaoqiang is currently offline xiaoqiang
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] Wed, 12 March 2008 21:40 Go to previous message
xiaoqiang is currently offline xiaoqiang
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 Jul 31 19:47:12 EDT 2014

Powered by FUDForum. Page generated in 0.07313 seconds