use of com.amalto.workbench.webservices.WSRoutingRulePKArray in project tmdm-studio-se by Talend.
the class TestTriggerAction method test.
protected void test() {
try {
String dataCluster = dialog.getDataContainer();
String concept = dialog.getConcept();
String[] recordIds = dialog.getRecordIds();
if (recordIds == null || recordIds.length == 0) {
MessageDialog.openError(getShell(), Messages._Error, Messages.RoutingRuleMainPage2_NoRecordSelected);
return;
}
WSRoutingRulePKArray routeItemV2 = service.routeItemV2(new WSRouteItemV2(new WSItemPK(concept, Arrays.asList(recordIds), new WSDataClusterPK(dataCluster))));
if (routeItemV2 == null || routeItemV2.getWsRoutingRulePKs() == null || routeItemV2.getWsRoutingRulePKs().size() == 0) {
MessageDialog.openInformation(getShell(), Messages.RoutingRuleMainPage2_Success, Messages.RoutingRuleMainPage2_noTriggerExecuted);
return;
}
List<WSRoutingRulePK> wsRoutingRulePKs = routeItemV2.getWsRoutingRulePKs();
StringBuilder builder = new StringBuilder(wsRoutingRulePKs.get(0).getPk());
for (int i = 1; i < wsRoutingRulePKs.size(); i++) {
// $NON-NLS-1$
builder.append("," + wsRoutingRulePKs.get(i).getPk());
}
MessageDialog.openInformation(getShell(), Messages.RoutingRuleMainPage2_Success, Messages.bind(Messages.RoutingRuleMainPage2_ExecuteTriggerSuccess, builder.toString()));
} catch (Exception e) {
log.error(e.getMessage(), e);
MessageDialog.openError(getShell(), Messages._Error, Messages.RoutingRuleMainPage2_ErrorTestTrigger);
}
}
Aggregations