Skip to main content



      Home
Home » Eclipse Projects » Sirius » Use External Java Action in Create Instance(Use External Java Action in Create Instance)
Use External Java Action in Create Instance [message #1775788] Mon, 06 November 2017 07:29 Go to next message
Eclipse UserFriend
Hello Community,

Is it possible to call an external Java Action unter Create Instance.
I want to set some value to the newly created Instance programmatically using an external java action.

How can I access the created instance in the java action?

Thanks in advance.

[Updated on: Mon, 06 November 2017 07:30] by Moderator

Re: Use External Java Action in Create Instance [message #1775858 is a reply to message #1775788] Tue, 07 November 2017 05:34 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

If you mean External Java Actions as described in https://www.eclipse.org/sirius/doc/specifier/general/Model_Operations.html#external_java_action, the current element ("self") on which the action is invoked is available in the first argument of your Java class's execute() method. If you defined your action as a child of the "Create Instance" operation, the current element for the operation will be the newly created instance.

Note that External Java Actions are an older mechanism which should probably be deprecated at some point. Plain Java services are much more flexible. In your case, you could simply use a "Set" operation, with the "Value Expression" returning the value you want for the element's feature. The value expression can be as simple as a plain AQL expression, and can also invoke Java code if needed (see https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods).

Regards,
Re: Use External Java Action in Create Instance [message #1775860 is a reply to message #1775858] Tue, 07 November 2017 05:40 Go to previous message
Eclipse UserFriend
thanks for the reply.

the AQL Expression seems to be a good option. I'll look into it.
Previous Topic:Depth-first traversal problem in large-scale model
Next Topic:Relation-Based Edges Path Format
Goto Forum:
  


Current Time: Sun Jul 06 09:13:01 EDT 2025

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

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

Back to the top