check [Solved] defining the collection type for a parameter of an operation

2 weeks 2 days ago - 1 week 2 days ago #5573 by chevaillier
I want to create a script that adds a main method to a class (stereotyped JavaClass). The problem comes with the definition of the parameter (the list of the command line arguments).

In Java the parameter of this method must be a String[] (not List<String>). Thus I need to define the collection to use for this parameter (Array). How can I do this whitin a jython script?
Best regards
Pierre

Please Log in or Create an account to join the conversation.

2 weeks 1 day ago #5574 by phv
Hi Pierre,

The following code should do the trick:

elt.putTagValue("ModelerModule", "Standard.Parameter", "type", "Array")


where 'elt' is the 'args' parameter model element of the 'main' method you are defining.

BR.
PhV

Please Log in or Create an account to join the conversation.

1 week 3 days ago #5577 by chevaillier
Thank you. It works perfectly. I can now go a step forward.
Best regards.

Please Log in or Create an account to join the conversation.

Moderators: chmcma
Time to create page: 0.037 seconds
^ Back to Top