Search in sources :

Example 91 with Process

use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.

the class DataProcessTest method before.

@Before
public void before() {
    process = new Process(TestUtils.createDefaultProperty());
    dataProcess = new DataProcess(process);
    testNode = new Node(testComponent, process);
    //$NON-NLS-1$
    TestProperties testProps = (TestProperties) new TestProperties("test").init();
    testNode.setComponentProperties(testProps);
}
Also used : TestProperties(org.talend.designer.core.utils.TestProperties) INode(org.talend.core.model.process.INode) Node(org.talend.designer.core.ui.editor.nodes.Node) Process(org.talend.designer.core.ui.editor.process.Process) Before(org.junit.Before)

Example 92 with Process

use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.

the class TalendEditorComponentCreationAssist method canCreateAt.

public boolean canCreateAt(Object node, Point location) {
    if (node == null || location == null) {
        MessageDialog.openWarning(graphicControl.getShell(), "Failed", "Component can't be created here");
        return false;
    }
    if (process instanceof Process && node instanceof Node) {
        NodeContainer nc = ((Process) process).loadNodeContainer((Node) node, false);
        boolean canExecute = new CreateNodeContainerCommand((Process) process, nc, location).canExecute();
        if (!canExecute) {
            MessageDialog.openWarning(graphicControl.getShell(), "Failed", "Component can't be created here");
        }
        return canExecute;
    }
    return true;
}
Also used : CreateNodeContainerCommand(org.talend.designer.core.ui.editor.cmd.CreateNodeContainerCommand) Node(org.talend.designer.core.ui.editor.nodes.Node) Process(org.talend.designer.core.ui.editor.process.Process) NodeContainer(org.talend.designer.core.ui.editor.nodecontainer.NodeContainer)

Example 93 with Process

use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.

the class ProcessConvertServiceImpl method getProcessFromItem.

@Override
public IProcess getProcessFromItem(Item item, boolean loadScreenshots) {
    if (ProcessItemImpl.class == item.getClass()) {
        Process process = null;
        process = new Process(item.getProperty());
        process.loadXmlFile(loadScreenshots);
        return process;
    }
    return null;
}
Also used : IProcess(org.talend.core.model.process.IProcess) Process(org.talend.designer.core.ui.editor.process.Process)

Example 94 with Process

use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.

the class DesignerCoreService method getProcessContextFromItem.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.designer.core.IDesignerCoreService#getProcessContextFromItem(org.talend.core.model.properties.Item)
     */
@Override
public IContextManager getProcessContextFromItem(Item item) {
    try {
        Process process = new Process(item.getProperty());
        process.loadContexts();
        return process.getContextManager();
    } catch (Exception e) {
        ExceptionHandler.process(e);
    }
    return null;
}
Also used : IProcess(org.talend.core.model.process.IProcess) CreateProcess(org.talend.designer.core.ui.action.CreateProcess) Process(org.talend.designer.core.ui.editor.process.Process) JavaModelException(org.eclipse.jdt.core.JavaModelException) ProcessorException(org.talend.designer.runprocess.ProcessorException)

Example 95 with Process

use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.

the class Problems method addErrorMark.

public static void addErrorMark() {
    nodeList.clear();
    String befor = "Error in the component's properties:";
    for (IProcess process : openJobs) {
        if (((Process) process).isActivate()) {
            for (INode inode : ((Process) process).getGraphicalNodes()) {
                if (inode instanceof Node) {
                    Node node = (Node) inode;
                    if (problemList.getProblemList().size() > 0) {
                        for (int i = 0; i < problemList.getProblemList().size(); i++) {
                            Problem problem = problemList.getProblemList().get(i);
                            if (node.isActivate()) {
                                if (problem.getStatus().equals(ProblemStatus.ERROR)) {
                                    if (problem instanceof TalendProblem) {
                                        TalendProblem tProblem = (TalendProblem) problem;
                                        if (!tProblem.getJavaUnitName().equals(node.getProcess().getName())) {
                                            continue;
                                        }
                                        if (tProblem.getVersion() != null) {
                                            if (!tProblem.getVersion().equals(node.getProcess().getVersion())) {
                                                continue;
                                            }
                                        }
                                        if (tProblem.getUnitName() != null && tProblem.getUnitName().equals(node.getUniqueName())) {
                                            // nodeList.add(node);
                                            if (nodeList.get(node) != null) {
                                                nodeList.get(node).append("\r\n");
                                                nodeList.get(node).append(tProblem.getDescription());
                                            } else {
                                                nodeList.put(node, new StringBuffer(tProblem.getDescription()));
                                            }
                                        } else {
                                            if (node.isErrorFlag() == true) {
                                                node.setErrorFlag(false);
                                                node.setCompareFlag(false);
                                                node.setErrorInfo(befor + tProblem.getDescription());
                                                //$NON-NLS-1$
                                                node.getNodeError().updateState("UPDATE_STATUS", false);
                                                //$NON-NLS-1$
                                                node.setErrorInfoChange("ERRORINFO", false);
                                            } else {
                                                continue;
                                            }
                                        }
                                    }
                                } else {
                                    if (node.isErrorFlag() == true) {
                                        node.setErrorFlag(false);
                                        node.setCompareFlag(false);
                                        //$NON-NLS-1$
                                        node.setErrorInfoChange("ERRORINFO", false);
                                    } else {
                                        continue;
                                    }
                                }
                            } else {
                                continue;
                            }
                        }
                    } else {
                        if (node.isErrorFlag() == true) {
                            node.setErrorFlag(false);
                            node.setCompareFlag(false);
                            node.setErrorInfo(null);
                            //$NON-NLS-1$
                            node.getNodeError().updateState("UPDATE_STATUS", false);
                            //$NON-NLS-1$
                            node.setErrorInfoChange("ERRORINFO", false);
                        } else {
                            continue;
                        }
                    }
                }
            }
        } else {
            continue;
        }
    }
    Iterator<Entry<Node, StringBuffer>> set = nodeList.entrySet().iterator();
    while (set.hasNext()) {
        Entry<Node, StringBuffer> en = set.next();
        Node node = en.getKey();
        String des = en.getValue().toString();
        if (node.isErrorFlag() == false) {
            node.setErrorFlag(true);
            node.setCompareFlag(false);
            node.setErrorInfo(befor + des);
            //$NON-NLS-1$
            node.getNodeError().updateState("UPDATE_STATUS", false);
            //$NON-NLS-1$
            node.setErrorInfoChange("ERRORINFO", true);
        }
    }
}
Also used : INode(org.talend.core.model.process.INode) Entry(java.util.Map.Entry) TalendProblem(org.talend.core.model.process.TalendProblem) Node(org.talend.designer.core.ui.editor.nodes.Node) INode(org.talend.core.model.process.INode) IProcess(org.talend.core.model.process.IProcess) Process(org.talend.designer.core.ui.editor.process.Process) Problem(org.talend.core.model.process.Problem) IProblem(org.eclipse.jdt.core.compiler.IProblem) TalendProblem(org.talend.core.model.process.TalendProblem) IProcess(org.talend.core.model.process.IProcess)

Aggregations

Process (org.talend.designer.core.ui.editor.process.Process)119 Node (org.talend.designer.core.ui.editor.nodes.Node)69 INode (org.talend.core.model.process.INode)48 ArrayList (java.util.ArrayList)45 IComponent (org.talend.core.model.components.IComponent)36 IElementParameter (org.talend.core.model.process.IElementParameter)28 Test (org.junit.Test)26 List (java.util.List)25 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)25 IProcess (org.talend.core.model.process.IProcess)24 Connection (org.talend.designer.core.ui.editor.connections.Connection)24 Property (org.talend.core.model.properties.Property)23 INodeConnector (org.talend.core.model.process.INodeConnector)22 IConnection (org.talend.core.model.process.IConnection)20 NodeContainer (org.talend.designer.core.ui.editor.nodecontainer.NodeContainer)20 FakePropertyImpl (org.talend.core.model.repository.FakePropertyImpl)15 ProcessItem (org.talend.core.model.properties.ProcessItem)12 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)11 HashMap (java.util.HashMap)10 Before (org.junit.Before)9