How do you specify a Type when calling Parameter.setType(Type)? [message #652428] |
Thu, 03 February 2011 20:54 |
Ian Goodsell Messages: 2 Registered: February 2011 |
Junior Member |
|
|
I am attempting to programmatically create an operation on an interface in my model. I have been successful adding the operation to the interface, and adding parameters to the operation, but I am having difficulty setting the parameter type. I am kind of new at this, so please forgive me if I am missing something basic.
For example, the operation I was trying to create on the interface has the signature:
bool recordExists( int recordId );
I was hoping to be able to do something like this (using a Package in a model named 'aPackage'):
// add an interface to the package
Interface iRecordManager = (Interface)aPackage.createOwnedInterface("recordManager");
// add an operation to the interface
Operation recordExists = (Operation)iRecordManager.createOwnedOperation("recordExists ", null, null, null);
Now I would like to add the parameter and the return value to the operation, doing something like this:
Parameter param = (Parameter)recordExists.createOwnedParameter("recordId", null);
param.setVisibility(VisibilityKind.PRIVATE_LITERAL);
param.setType(null);
Parameter retParam = (Parameter)recordExists.createReturnResult("ret", null);
How do I specify the type to param.setType(Type) and recordExists.createReturnResult(String, Type)? I've done a lot of searching on how to do this, but I haven't been able to find anything.
Hope someone could point me in the right direction.
Thanks, all --
Ian
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02762 seconds