Question & Answer
Question
How do you use the API to access the operation arguments displayed in a call operation preview in IBM Rational Rhapsody?
Cause
I wish to access the modified argument values displayed in the call operation preview which differs from the actual value of the operation's arguments
Answer
To access the modified argument values from the Call Operation preview:
IRPApplication app = RhapsodyAppServer.getActiveRhapsodyApplication();
IRPCallOperation callop = (IRPCallOperation)app.getSelectedElement();
IRPAction action = callop.getTheEntryAction();
if (action instanceof IRPSendAction)
{
IRPSendAction sendAction = (IRPSendAction)action;
List<String> lArgs = sendAction.getArgVals().toList();
for (String arg : lArgs) {
System.out.println(arg);
}
}
To access the actual operation values from the context of the call operation:
IRPApplication app = RhapsodyAppServer.getActiveRhapsodyApplication();
IRPCallOperation callop = (IRPCallOperation)app.getSelectedElement();
List<IRPArgument> lArgs = callop.getOperation().getArguments().toList();
for (IRPArgument arg : lArgs) {
System.out.println(arg.getDefaultValue());
}
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
---|
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21986756