Search in sources :

Example 6 with WSRoutingRuleE

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));
    }
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) WSRoutingRuleE(org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleE)

Example 7 with WSRoutingRuleE

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;
}
Also used : WSRoutingRuleE(org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleE)

Example 8 with WSRoutingRuleE

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);
        }
    }
}
Also used : Item(org.talend.core.model.properties.Item) WSRoutingRuleItem(org.talend.mdm.repository.model.mdmproperties.WSRoutingRuleItem) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) WSRoutingRuleE(org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleE) WSRoutingRuleItem(org.talend.mdm.repository.model.mdmproperties.WSRoutingRuleItem)

Example 9 with WSRoutingRuleE

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;
}
Also used : WSRoutingRuleExpressionE(org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleExpressionE) Execution(org.talend.mdm.repository.ui.dialogs.job.JobOptionsDialog.Execution) Parameter(org.talend.mdm.repository.ui.dialogs.job.JobOptionsDialog.Parameter) WSRoutingRuleE(org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleE)

Aggregations

WSRoutingRuleE (org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleE)9 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)2 WSRoutingRuleItem (org.talend.mdm.repository.model.mdmproperties.WSRoutingRuleItem)2 WSRoutingRuleExpressionE (org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleExpressionE)2 IValidateService (com.amalto.workbench.service.IValidateService)1 WSRoutingRule (com.amalto.workbench.webservices.WSRoutingRule)1 URI (org.eclipse.emf.common.util.URI)1 EObject (org.eclipse.emf.ecore.EObject)1 InternalEObject (org.eclipse.emf.ecore.InternalEObject)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 IEditorPart (org.eclipse.ui.IEditorPart)1 Test (org.junit.Test)1 Item (org.talend.core.model.properties.Item)1 ItemState (org.talend.core.model.properties.ItemState)1 IHashValueCalculator (org.talend.mdm.commmon.util.hash.IHashValueCalculator)1 EObjRoutingRuleHVCalculator (org.talend.mdm.repository.core.hash.routingrule.EObjRoutingRuleHVCalculator)1 WSRoutingRuleHVCalculator (org.talend.mdm.repository.core.hash.routingrule.WSRoutingRuleHVCalculator)1 WSRoutingRuleOperatorE (org.talend.mdm.repository.model.mdmserverobject.WSRoutingRuleOperatorE)1 JobOptionsDialog (org.talend.mdm.repository.ui.dialogs.job.JobOptionsDialog)1