use of org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleE in project tmdm-studio-se by Talend.
the class WSRoutingRuleItemImpl method setWsRoutingRule.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setWsRoutingRule(WSRoutingRuleE newWsRoutingRule) {
WSRoutingRuleE oldWsRoutingRule = wsRoutingRule;
wsRoutingRule = newWsRoutingRule;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, MdmpropertiesPackage.WS_ROUTING_RULE_ITEM__WS_ROUTING_RULE, oldWsRoutingRule, wsRoutingRule));
}
}
use of org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleE in project tmdm-studio-se by Talend.
the class NewTriggerAction method newRoutingRule.
private WSRoutingRuleE newRoutingRule(String key) {
WSRoutingRuleE routingRule = MdmserverobjectFactory.eINSTANCE.createWSRoutingRuleE();
routingRule.setName(key);
// $NON-NLS-1$
routingRule.setDescription("");
routingRule.setSynchronous(false);
// $NON-NLS-1$
routingRule.setConcept("*");
// $NON-NLS-1$
routingRule.setServiceJNDI("");
// $NON-NLS-1$
routingRule.setParameters("");
routingRule.setCondition(null);
routingRule.setDeactive(false);
return routingRule;
}
use of org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleE in project tmdm-studio-se by Talend.
the class TriggerDecorator method decorate.
public void decorate(Object element, IDecoration decoration) {
IRepositoryViewObject viewObj = (IRepositoryViewObject) element;
Item item = RepositoryResourceUtil.getItemFromRepViewObj(viewObj);
if (item != null && item instanceof WSRoutingRuleItem) {
WSRoutingRuleE routing = ((WSRoutingRuleItem) item).getWsRoutingRule();
if (routing.isDeactive()) {
decoration.addOverlay(IMG_TRIGGER_DEACTIVE, IDecoration.BOTTOM_LEFT);
}
}
}
use of org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleE in project tmdm-studio-se by Talend.
the class GenerateJobTriggerAction method createTrigger.
/**
* DOC jsxie Comment method "createTrigger".
*
* @param dialog
* @param jobVersion2
*/
private WSRoutingRuleE createTrigger(String jobName, String jobVersion, JobOptionsDialog dialog) {
WSRoutingRuleE routingRule = MdmserverobjectFactory.eINSTANCE.createWSRoutingRuleE();
try {
// $NON-NLS-1$
String server = "http://localhost:8180";
Execution execution = dialog.getExecution();
// $NON-NLS-1$
String url = "";
switch(execution) {
case EMBEDDED:
// $NON-NLS-1$ //$NON-NLS-2$
url = "ltj://" + jobName + "/" + jobVersion;
break;
case WEB_SERVICE:
url = Messages.bind(Messages.GenerateJobXX_UrlString, server, jobName, jobVersion, jobName);
break;
}
Parameter executionParameter = dialog.getParameter();
// $NON-NLS-1$
String parameter = "";
switch(executionParameter) {
case CONTEXT_VARIABLE:
parameter = // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"<configuration>\n" + "<url>" + url + "</url><contextParam>\n" + "<name>xmlInput</name>\n" + "<value>{exchange_data}</value>\n" + // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"</contextParam>\n" + // $NON-NLS-1$
"</configuration>\n";
break;
case INTEGRATED:
parameter = // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"<configuration>\n" + "<url>" + url + "</url>" + // $NON-NLS-1$
"</configuration>\n";
break;
}
// Generate the job call
// create default CREATE operation express
WSRoutingRuleExpressionE expression1 = MdmserverobjectFactory.eINSTANCE.createWSRoutingRuleExpressionE();
// $NON-NLS-1$
expression1.setName("C1");
// $NON-NLS-1$
expression1.setXpath("Update/OperationType");
expression1.setWsOperator(newContainRoutingRuleOperator());
// $NON-NLS-1$
expression1.setValue("CREATE");
WSRoutingRuleExpressionE expression2 = MdmserverobjectFactory.eINSTANCE.createWSRoutingRuleExpressionE();
// $NON-NLS-1$
expression2.setName("C2");
// $NON-NLS-1$
expression2.setXpath("Update/OperationType");
expression2.setWsOperator(newContainRoutingRuleOperator());
// $NON-NLS-1$
expression2.setValue("UPDATE");
WSRoutingRuleExpressionE expression3 = MdmserverobjectFactory.eINSTANCE.createWSRoutingRuleExpressionE();
// $NON-NLS-1$
expression3.setName("C3");
// $NON-NLS-1$
expression3.setXpath("Update/OperationType");
expression3.setWsOperator(newContainRoutingRuleOperator());
// $NON-NLS-1$
expression3.setValue("DELETE");
routingRule.setName(getNewTriggerName(jobName));
// $NON-NLS-1$
routingRule.setDescription("Trigger that calls the Talend Job: " + jobName);
routingRule.setSynchronous(false);
// $NON-NLS-1$
routingRule.setConcept("Update");
// $NON-NLS-1$
routingRule.setServiceJNDI("amalto/local/service/callJob");
routingRule.setParameters(parameter);
routingRule.setCondition(null);
routingRule.setDeactive(false);
routingRule.getWsRoutingRuleExpressions().add(expression1);
routingRule.getWsRoutingRuleExpressions().add(expression2);
routingRule.getWsRoutingRuleExpressions().add(expression3);
// $NON-NLS-1$
routingRule.setCondition("C1 Or C2 Or C3");
routingRule.setDeactive(false);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return routingRule;
}
Aggregations