RCP: How to launch shared tasks on button click?

Technote (troubleshooting)


Problem(Abstract)

How to launch shared tasks on button click?

Resolving the problem

Following are the some approaches for launching shared tasks on button click:

Note: While adding the button on screen through RCP extensibility tool check the validation required flag and use the class for this button extended from YRCExtentionBehavior by following RCP customization guide as a reference:

Code for launching shared tasks on button click should be present in the validateButtonClick(String fieldName) method:

1. Lauching Shared Task with the "YRCPlatformUI.launchSharedTask(taskId)" method:

Sample code is as follows:

---------------------------------------------------------------------------------------------------------------------------------------------------------

public YRCValidationResponse validateButtonClick(String fieldName) {
// TODO Validation required for the following controls.
System.out.println("Inside Validate Button Click");
// Control name: extn_RTT
YRCPlatformUI.launchSharedTask("YCDAddressSharedTask");

// TODO Create and return a response.
return super.validateButtonClick(fieldName);
}

---------------------------------------------------------------------------------------------------------------------------------------------------------
2. Lauching Shared Task with the "YRCPlatformUI.launchSharedTask(taskId, input)" method:

Sample code is as follows:

---------------------------------------------------------------------------------------------------------------------------------------------------------

public YRCValidationResponse validateButtonClick(String fieldName) {
// TODO Validation required for the following controls.

// Control name: extn_WRT
if(fieldName.equals("extn_WRT"))
{
System.out.println("Inside extn_WRT");
try
{
System.out.println("Inside Validate Button Click");

org.w3c.dom.Document inDoc = YRCXmlUtils.createFromFileOrUrl("C:\\userData\\91\\91\\eclipse\\Workspace92\\PLUGIN_MARS\\plugin_mars\\APPS1.xml");

org.w3c.dom.Element eleOut = inDoc.getDocumentElement();

System.out.println(YRCXmlUtils.getString(eleOut));

YRCPlatformUI.launchSharedTask("YCDFOPBrowserSharedTask",eleOut);
}
catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}


}
---------------------------------------------------------------------------------------------------------------------------------------------------------

Below is the entry for APPS1.xml:

<?xml version="1.0" encoding="UTF-8"?>
<MultiApi ServiceName="YCD_Print_Pack_Slip_9.2.0">
<API Name="getSortedShipmentDetails">
<Input>
<Shipment EnterpriseCode="DEFAULT" ShipNode="ABC12" ShipmentKey="20130267221743204869"/>
</Input>
</API>
<API Name="getItemUOMMasterList">
<Input>
<ItemUOMMaster CallingOrganizationCode="ABC12"/>
</Input>
</API>
</MultiApi>

For complete description of the above used methods follow the description from eclipse configured with RCP setup.


Rate this page:

(0 users)Average rating

Document information


More support for:

Sterling Selling and Fulfillment Suite
Sterling Call Center and Store

Software version:

8.5, 9.0, 9.1, 9.2

Operating system(s):

Windows

Software edition:

All Editions

Reference #:

1632125

Modified date:

2013-05-05

Translate my page

Machine Translation

Content navigation