use of org.talend.designer.runprocess.ProcessorException in project tdi-studio-se by Talend.
the class RowGenProcessMain method runPreviewCode.
/**
* qzhang Comment method "runPreviewCode".
*/
public Process runPreviewCode() {
getProcess();
if (jobContextManager == null) {
// proc.getContextManager().setListContext(component.getProcess().getContextManager().getListContext());
proc.getContextManager().setDefaultContext(component.getProcess().getContextManager().getDefaultContext());
} else {
// proc.getContextManager().setListContext(jobContextManager.getListContext());
proc.getContextManager().setDefaultContext(jobContextManager.getDefaultContext());
}
// IContext context2 = new org.talend.core.model.context.JobContext(PREVIEW);
// if (UIManager.isJavaProject()) {
// List<IContextParameter> params = new ArrayList<IContextParameter>();
// JobContextParameter contextParameter = new JobContextParameter();
// contextParameter.setContext(context2);
// contextParameter.setName(PREVIEW);
// contextParameter.setValue(PREVIEW);
// contextParameter.setType("String");
// params.add(contextParameter);
// context2.setContextParameterList(params);
// }
// generate context files.
IProcessor contextProcessor = ProcessorUtilities.getProcessor(proc, null);
contextProcessor.setContext(proc.getContextManager().getDefaultContext());
try {
contextProcessor.cleanBeforeGenerate(TalendProcessOptionConstants.CLEAN_CONTEXTS);
contextProcessor.generateContextCode();
} catch (ProcessorException pe) {
ExceptionHandler.process(pe);
}
IProcessor processor = ProcessorUtilities.getProcessor(proc, null, proc.getContextManager().getDefaultContext());
try {
return processor.run(IProcessor.NO_STATISTICS, IProcessor.NO_TRACES, null);
} catch (Exception e) {
ExceptionHandler.process(e);
return null;
}
}
use of org.talend.designer.runprocess.ProcessorException in project tmdm-studio-se by Talend.
the class DeployOnMDMExportWizardPage method generateProcess.
private boolean generateProcess(ExportFileResource p, IProgressMonitor monitor) {
String label = getProcessName(p);
monitor.setTaskName(Messages.bind(Messages.DeployOnMDMExportWizardPage_Generating, label));
ProcessItem processItem = (ProcessItem) p.getItem();
try {
ProcessorUtilities.generateCode(processItem, processItem.getProcess().getDefaultContext(), false, false);
monitor.worked(W_GENERATE_PROCESS);
} catch (ProcessorException e) {
MessageBoxExceptionHandler.process(e);
setDeploySucceed(false);
return false;
}
return true;
}
use of org.talend.designer.runprocess.ProcessorException in project tmdm-studio-se by Talend.
the class DeployOnMDMExportWizardPage method exportJob.
private boolean exportJob(ExportFileResource p, boolean needContextScript, IProgressMonitor monitor) {
String label = getProcessName(p);
monitor.setTaskName(Messages.bind(Messages.DeployOnMDMExportWizardPage_exporting, label));
if (!ensureTargetIsValid(p)) {
setDeploySucceed(false);
return false;
}
List<ExportFileResource> resourcesToExport = null;
try {
resourcesToExport = getExportResources(p);
} catch (ProcessorException e) {
MessageBoxExceptionHandler.process(e);
setDeploySucceed(false);
return false;
}
String topFolder = getRootFolderName(p);
setTopFolder(resourcesToExport, topFolder);
ArchiveFileExportOperationFullPath exporterOperation = getExporterOperation(p, resourcesToExport);
boolean ok = executeExportOperation(exporterOperation);
// TODO What if not ok ????
// path can like name/name
manager.deleteTempFiles();
ProcessorUtilities.resetExportConfig();
monitor.worked(W_EXPORT_PROCESS);
return true;
}
Aggregations