use of org.talend.mdm.repository.ui.dialogs.job.JobOptionsDialog in project tmdm-studio-se by Talend.
the class GenerateJobTriggerAction method doRun.
@Override
protected void doRun() {
selectObj = getSelectedObject().get(0);
JobOptionsDialog dialog = new JobOptionsDialog(getShell(), Messages.JobProcesssDialogTiggerTitle_title, Execution.EMBEDDED);
dialog.setBlockOnOpen(true);
int ret = dialog.open();
if (ret == Dialog.CANCEL) {
return;
}
// $NON-NLS-1$
String jobName = "";
// $NON-NLS-1$
String jobVersion = "";
if (selectObj instanceof IRepositoryViewObject) {
jobName = ((IRepositoryViewObject) selectObj).getProperty().getLabel();
jobVersion = ((IRepositoryViewObject) selectObj).getProperty().getVersion();
}
// check exist
IValidateService validateService = (IValidateService) GlobalServiceRegister.getDefault().getService(IValidateService.class);
if (validateService != null) {
boolean result = validateService.validateAndAlertObjectExistence(IServerObjectRepositoryType.TYPE_ROUTINGRULE, getNewTriggerName(jobName), null);
if (!result) {
return;
}
}
//
WSRoutingRuleE routingRule = createTrigger(jobName, jobVersion, dialog);
// if the new objectect is opened ,than close it before regenerating
IRepositoryViewObject toDelete = RepositoryResourceUtil.findViewObjectByName(IServerObjectRepositoryType.TYPE_ROUTINGRULE, PREFIX + jobName);
if (toDelete != null) {
IEditorPart openedEditor = UIUtil.findOpenedEditor(toDelete);
if (openedEditor != null) {
UIUtil.closeEditor(openedEditor, false);
}
// delete directly
RepositoryResourceUtil.removeViewObjectPhysically(toDelete, jobVersion);
}
AttachToTriggerView(jobName, routingRule);
}
use of org.talend.mdm.repository.ui.dialogs.job.JobOptionsDialog in project tmdm-studio-se by Talend.
the class GenerateJobTransformerAction method doRun.
@Override
protected void doRun() {
selectObj = getSelectedObject().get(0);
JobOptionsDialog dialog = new JobOptionsDialog(getShell(), Messages.JobProcesssOptionsDialogTitle_title, Execution.EMBEDDED);
dialog.setBlockOnOpen(true);
int ret = dialog.open();
if (ret == Dialog.CANCEL) {
return;
}
// $NON-NLS-1$
String jobName = "";
// $NON-NLS-1$
String jobVersion = "";
// $NON-NLS-1$
String path = "/other";
if (selectObj instanceof IRepositoryViewObject) {
Property property = ((IRepositoryViewObject) selectObj).getProperty();
if (property != null) {
jobName = property.getLabel();
jobVersion = property.getVersion();
}
}
// check exist
IValidateService validateService = (IValidateService) GlobalServiceRegister.getDefault().getService(IValidateService.class);
if (validateService != null) {
boolean result = validateService.validateAndAlertObjectExistence(IServerObjectRepositoryType.TYPE_TRANSFORMERV2, getNewProcessName(jobName), null);
if (!result) {
return;
}
}
WSTransformerV2E transformer = createTransformer(jobName, jobVersion, dialog);
// if the new objectect is opened ,than close it before regenerating
IRepositoryViewObject toDelete = RepositoryResourceUtil.findViewObjectByName(IServerObjectRepositoryType.TYPE_TRANSFORMERV2, PREFIX + jobName);
if (toDelete != null) {
IEditorPart openedEditor = UIUtil.findOpenedEditor(toDelete);
if (openedEditor != null) {
UIUtil.closeEditor(openedEditor, false);
}
// delete directly
RepositoryResourceUtil.removeViewObjectPhysically(toDelete, jobVersion);
}
AttachToProcessView(jobName, transformer);
}
Aggregations