how can I create an ActionState ??

how can I create an ActionState ??

Postby Guest » Mon Sep 20, 2004 5:32 pm

What is the code to create an ActionState ??

I need an Action and and ActionExpression.

ActionState actionSt = ModelElementFactory.createActionState(acStId, acId, acExId);

But I dot not understand the parameters to create an action :
public Action createAction(SmId id, Class actionClass)
Guest
 

Re: how can I create an ActionState ??

Postby [gw] Thorsten Sturm » Tue Sep 21, 2004 8:39 am

The operation createAction needs a new SmId for the created action and the type of action that should be created. Most common for activity diagrams are CallActions. Please refer to the online documentation for details about action classes .

Thorsten
Thorsten Sturm
[gw] Thorsten Sturm
 
Posts: 185
Joined: Sat Jan 18, 2003 10:03 am

Re: how can I create an ActionState ??

Postby Guest » Tue Sep 21, 2004 1:04 pm

Ok I try that :
SmId acId = projet.getNextSmId();
Action actionEnt = ModelElementFactory.createAction(acId,CallActionImpl.class);

but I have this exception :
2004-09-21 14:02:39,147 ERROR [main ]: javax.jmi.reflect.InvalidNameException
2004-09-21 14:02:39,147 ERROR [main ]: at org.omg.uml.behavioralelements.commonbehavior.CommonBehaviorPackage$Impl._getClass(Unknown Source)
2004-09-21 14:02:39,147 ERROR [main ]: at org.netbeans.mdr.handlers.PackageProxyHandler.refClass(PackageProxyHandler.java:241)
2004-09-21 14:02:39,147 ERROR [main ]: at com.gentleware.poseidon.uml.model_management.ModelElementFactory.A(Unknown Source)
2004-09-21 14:02:39,147 ERROR [main ]: at com.gentleware.poseidon.uml.model_management.ModelElementFactory.createAction(Unknown Source)
2004-09-21 14:02:39,147 ERROR [main ]: at com.gentleware.poseidon.uml.model_management.ModelElementFactory.createAction(Unknown Source)
2004-09-21 14:02:39,162 ERROR [main ]: at module.a5sys.global.op.diagactivity.OpActionState.newActionState(OpActionState.java:74)
2004-09-21 14:02:39,162 ERROR [main ]: at test.Test.main(Test.java:52)
Guest
 

Re: how can I create an ActionState ??

Postby [gw] Thorsten Sturm » Tue Sep 21, 2004 1:19 pm

Try again using ClassAction.class.

Thorsten
Thorsten Sturm
[gw] Thorsten Sturm
 
Posts: 185
Joined: Sat Jan 18, 2003 10:03 am

Re: how can I create an ActionState ??

Postby Guest » Tue Sep 21, 2004 1:34 pm

Sorry, I do not have access to this class.
What is the library of "ClassAction" ??
Guest
 

Re: how can I create an ActionState ??

Postby [gw] Thorsten Sturm » Tue Sep 21, 2004 2:11 pm

It is a UML class and therefore part of the uml14.jar or uml14di.jar (depending on what version of Poseidon you are using). BTW, this jar contains all classes for UML elements as interface definitions.

Thorsten
Thorsten Sturm
[gw] Thorsten Sturm
 
Posts: 185
Joined: Sat Jan 18, 2003 10:03 am

Re: how can I create an ActionState ??

Postby Guest » Wed Sep 22, 2004 12:33 pm

Sorry but the library "uml14.jar" does not contain the class "ClassAction.class"

but "ActionClass.class" --> yes
I try this class and I have the same problem ...
Guest
 

Re: how can I create an ActionState ??

Postby [gw] Thorsten Sturm » Wed Sep 22, 2004 1:21 pm

I'm sorry. I just noticed the real problem. One of my postings contained a typo. Of course, there is no ClassAction in UML because what I really meant was CallAction.

I'm pretty sure that CallAction.class is in the jar.

Thorsten
Thorsten Sturm
[gw] Thorsten Sturm
 
Posts: 185
Joined: Sat Jan 18, 2003 10:03 am

Re: how can I create an ActionState ??

Postby Guest » Thu Sep 23, 2004 9:04 am

That's OK !

Thank you
Guest
 


Return to Plug-Ins

Who is online

Users browsing this forum: No registered users and 1 guest

cron