Search in sources :

Example 11 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class JobGraph method delSelected.

public void delSelected(JobEntryCopy clickedEntry) {
    List<JobEntryCopy> copies = jobMeta.getSelectedEntries();
    int nrsels = copies.size();
    if (nrsels == 0) {
        if (clickedEntry != null) {
            spoon.deleteJobEntryCopies(jobMeta, clickedEntry);
        }
        return;
    }
    JobEntryCopy[] jobEntries = copies.toArray(new JobEntryCopy[copies.size()]);
    spoon.deleteJobEntryCopies(jobMeta, jobEntries);
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Example 12 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class JobGraph method replayJob.

public void replayJob() {
    List<JobEntryCopy> selectedEntries = jobMeta.getSelectedEntries();
    if (selectedEntries.size() != 1) {
        MessageBox box = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.CLOSE);
        box.setText(BaseMessages.getString(PKG, "JobGraph.ReplayJob.SelectOneEntryToStartFrom.Title"));
        box.setMessage(BaseMessages.getString(PKG, "JobGraph.ReplayJob.SelectOneEntryToStartFrom.Message"));
        box.open();
        return;
    }
    JobEntryCopy copy = selectedEntries.get(0);
    spoon.executeJob(jobMeta, true, false, null, false, copy.getName(), copy.getNr());
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) MessageBox(org.eclipse.swt.widgets.MessageBox)

Example 13 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class JobGraph method addCandidateAsHop.

private void addCandidateAsHop() {
    if (hop_candidate != null) {
        if (!hop_candidate.getFromEntry().evaluates() && hop_candidate.getFromEntry().isUnconditional()) {
            hop_candidate.setUnconditional();
        } else {
            hop_candidate.setConditional();
            int nr = jobMeta.findNrNextJobEntries(hop_candidate.getFromEntry());
            // vice-versa)
            if (nr == 1) {
                JobEntryCopy jge = jobMeta.findNextJobEntry(hop_candidate.getFromEntry(), 0);
                JobHopMeta other = jobMeta.findJobHop(hop_candidate.getFromEntry(), jge);
                if (other != null) {
                    hop_candidate.setEvaluation(!other.getEvaluation());
                }
            }
        }
        if (checkIfHopAlreadyExists(jobMeta, hop_candidate)) {
            boolean cancel = false;
            jobMeta.addJobHop(hop_candidate);
            if (jobMeta.hasLoop(hop_candidate.getToEntry())) {
                MessageBox mb = new MessageBox(spoon.getShell(), SWT.OK | SWT.CANCEL | SWT.ICON_WARNING);
                mb.setMessage(BaseMessages.getString(PKG, "JobGraph.Dialog.HopCausesLoop.Message"));
                mb.setText(BaseMessages.getString(PKG, "JobGraph.Dialog.HopCausesLoop.Title"));
                int choice = mb.open();
                if (choice == SWT.CANCEL) {
                    jobMeta.removeJobHop(hop_candidate);
                    cancel = true;
                }
            }
            if (!cancel) {
                spoon.addUndoNew(jobMeta, new JobHopMeta[] { hop_candidate }, new int[] { jobMeta.indexOfJobHop(hop_candidate) });
            }
            spoon.refreshTree();
            clearSettings();
            redraw();
        }
    }
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) JobHopMeta(org.pentaho.di.job.JobHopMeta) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) MessageBox(org.eclipse.swt.widgets.MessageBox)

Example 14 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class JobGraph method selectInRect.

public void selectInRect(JobMeta jobMeta, org.pentaho.di.core.gui.Rectangle rect) {
    int i;
    for (i = 0; i < jobMeta.nrJobEntries(); i++) {
        JobEntryCopy je = jobMeta.getJobEntry(i);
        Point p = je.getLocation();
        if (((p.x >= rect.x && p.x <= rect.x + rect.width) || (p.x >= rect.x + rect.width && p.x <= rect.x)) && ((p.y >= rect.y && p.y <= rect.y + rect.height) || (p.y >= rect.y + rect.height && p.y <= rect.y))) {
            je.setSelected(true);
        }
    }
    for (i = 0; i < jobMeta.nrNotes(); i++) {
        NotePadMeta ni = jobMeta.getNote(i);
        Point a = ni.getLocation();
        Point b = new Point(a.x + ni.width, a.y + ni.height);
        if (rect.contains(a.x, a.y) && rect.contains(b.x, b.y)) {
            ni.setSelected(true);
        }
    }
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) NotePadMeta(org.pentaho.di.core.NotePadMeta) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Example 15 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class JobGraph method enableDisableNextHops.

private Set<JobEntryCopy> enableDisableNextHops(JobEntryCopy from, boolean enabled, Set<JobEntryCopy> checkedEntries) {
    checkedEntries.add(from);
    jobMeta.getJobhops().stream().filter(hop -> from.equals(hop.getFromEntry())).forEach(hop -> {
        if (hop.isEnabled() != enabled) {
            JobHopMeta before = (JobHopMeta) hop.clone();
            hop.setEnabled(enabled);
            JobHopMeta after = (JobHopMeta) hop.clone();
            spoon.addUndoChange(jobMeta, new JobHopMeta[] { before }, new JobHopMeta[] { after }, new int[] { jobMeta.indexOfJobHop(hop) });
        }
        if (!checkedEntries.contains(hop.getToEntry())) {
            enableDisableNextHops(hop.getToEntry(), enabled, checkedEntries);
        }
    });
    return checkedEntries;
}
Also used : RepositoryExplorerDialog(org.pentaho.di.ui.repository.dialog.RepositoryExplorerDialog) SashForm(org.eclipse.swt.custom.SashForm) MouseMoveListener(org.eclipse.swt.events.MouseMoveListener) XulException(org.pentaho.ui.xul.XulException) DefaultToolTip(org.eclipse.jface.window.DefaultToolTip) AbstractGraph(org.pentaho.di.ui.spoon.AbstractGraph) Point(org.pentaho.di.core.gui.Point) DND(org.eclipse.swt.dnd.DND) RepositorySecurityUI(org.pentaho.di.ui.repository.RepositorySecurityUI) XulToolbarbutton(org.pentaho.ui.xul.components.XulToolbarbutton) DropTargetEvent(org.eclipse.swt.dnd.DropTargetEvent) JobAdapter(org.pentaho.di.job.JobAdapter) XulSpoonResourceBundle(org.pentaho.di.ui.spoon.XulSpoonResourceBundle) TabMapEntry(org.pentaho.di.ui.spoon.TabMapEntry) Composite(org.eclipse.swt.widgets.Composite) Map(java.util.Map) KeyEvent(org.eclipse.swt.events.KeyEvent) Job(org.pentaho.di.job.Job) ConstUI(org.pentaho.di.ui.core.ConstUI) TabItemInterface(org.pentaho.di.ui.spoon.TabItemInterface) TimerTask(java.util.TimerTask) JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) KeyAdapter(org.eclipse.swt.events.KeyAdapter) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) LogParentProvidedInterface(org.pentaho.di.core.logging.LogParentProvidedInterface) CTabFolder(org.eclipse.swt.custom.CTabFolder) Device(org.eclipse.swt.graphics.Device) JobEntryResult(org.pentaho.di.job.JobEntryResult) JfaceMenupopup(org.pentaho.ui.xul.jface.tags.JfaceMenupopup) Set(java.util.Set) PropsUI(org.pentaho.di.ui.core.PropsUI) CheckBoxToolTipListener(org.pentaho.di.ui.core.widget.CheckBoxToolTipListener) ToolItem(org.eclipse.swt.widgets.ToolItem) Utils(org.pentaho.di.core.util.Utils) JobEntryInterface(org.pentaho.di.job.entry.JobEntryInterface) Transfer(org.eclipse.swt.dnd.Transfer) LogChannel(org.pentaho.di.core.logging.LogChannel) MouseEvent(org.eclipse.swt.events.MouseEvent) Redrawable(org.pentaho.di.core.gui.Redrawable) JobEntryListener(org.pentaho.di.job.JobEntryListener) MenuItem(org.eclipse.swt.widgets.MenuItem) SWT(org.eclipse.swt.SWT) JfaceMenuitem(org.pentaho.ui.xul.jface.tags.JfaceMenuitem) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) SWTGC(org.pentaho.di.ui.spoon.SWTGC) PaintListener(org.eclipse.swt.events.PaintListener) NotePadDialog(org.pentaho.di.ui.spoon.dialog.NotePadDialog) JobHopMeta(org.pentaho.di.job.JobHopMeta) SnapAllignDistribute(org.pentaho.di.core.gui.SnapAllignDistribute) Callable(java.util.concurrent.Callable) EngineMetaInterface(org.pentaho.di.core.EngineMetaInterface) DragAndDropContainer(org.pentaho.di.core.dnd.DragAndDropContainer) ArrayList(java.util.ArrayList) Spoon(org.pentaho.di.ui.spoon.Spoon) AreaType(org.pentaho.di.core.gui.AreaOwner.AreaType) LoggingObjectType(org.pentaho.di.core.logging.LoggingObjectType) RepositoryObjectType(org.pentaho.di.repository.RepositoryObjectType) ResourceBundle(java.util.ResourceBundle) Const(org.pentaho.di.core.Const) GCInterface(org.pentaho.di.core.gui.GCInterface) JobExecutionConfiguration(org.pentaho.di.job.JobExecutionConfiguration) Document(org.pentaho.ui.xul.dom.Document) GridData(org.eclipse.swt.layout.GridData) EnterTextDialog(org.pentaho.di.ui.core.dialog.EnterTextDialog) XulEventHandler(org.pentaho.ui.xul.impl.XulEventHandler) JobDialog(org.pentaho.di.ui.job.dialog.JobDialog) Shell(org.eclipse.swt.widgets.Shell) SimpleLoggingObject(org.pentaho.di.core.logging.SimpleLoggingObject) FormLayout(org.eclipse.swt.layout.FormLayout) Repository(org.pentaho.di.repository.Repository) SharedObjects(org.pentaho.di.shared.SharedObjects) FormData(org.eclipse.swt.layout.FormData) JobMeta(org.pentaho.di.job.JobMeta) KettleRepositoryLostException(org.pentaho.di.repository.KettleRepositoryLostException) LogChannelInterface(org.pentaho.di.core.logging.LogChannelInterface) SpoonPluginManager(org.pentaho.di.ui.spoon.SpoonPluginManager) RepositoryRevisionBrowserDialogInterface(org.pentaho.di.ui.repository.dialog.RepositoryRevisionBrowserDialogInterface) RowMetaAndData(org.pentaho.di.core.RowMetaAndData) Color(org.eclipse.swt.graphics.Color) MessageBox(org.eclipse.swt.widgets.MessageBox) ToolTip(org.eclipse.jface.window.ToolTip) JobEntryTrans(org.pentaho.di.job.entries.trans.JobEntryTrans) XulDomContainer(org.pentaho.ui.xul.XulDomContainer) ExtensionPointHandler(org.pentaho.di.core.extension.ExtensionPointHandler) ObjectType(org.pentaho.di.ui.spoon.TabMapEntry.ObjectType) Trans(org.pentaho.di.trans.Trans) DisposeEvent(org.eclipse.swt.events.DisposeEvent) KettleLogStore(org.pentaho.di.core.logging.KettleLogStore) XulToolbar(org.pentaho.ui.xul.containers.XulToolbar) DisposeListener(org.eclipse.swt.events.DisposeListener) ToolBar(org.eclipse.swt.widgets.ToolBar) GUIResource(org.pentaho.di.ui.core.gui.GUIResource) Timer(java.util.Timer) KettleVFS(org.pentaho.di.core.vfs.KettleVFS) GC(org.eclipse.swt.graphics.GC) JobEntryJob(org.pentaho.di.job.entries.job.JobEntryJob) PaintEvent(org.eclipse.swt.events.PaintEvent) TransMeta(org.pentaho.di.trans.TransMeta) NotePadMeta(org.pentaho.di.core.NotePadMeta) Widget(org.eclipse.swt.widgets.Widget) BaseMessages(org.pentaho.di.i18n.BaseMessages) TransPainter(org.pentaho.di.trans.TransPainter) DropTarget(org.eclipse.swt.dnd.DropTarget) JobPainter(org.pentaho.di.job.JobPainter) MouseWheelListener(org.eclipse.swt.events.MouseWheelListener) UUID(java.util.UUID) Display(org.eclipse.swt.widgets.Display) CheckBoxToolTip(org.pentaho.di.ui.core.widget.CheckBoxToolTip) AreaOwner(org.pentaho.di.core.gui.AreaOwner) List(java.util.List) MouseListener(org.eclipse.swt.events.MouseListener) MouseTrackListener(org.eclipse.swt.events.MouseTrackListener) SwtScrollBar(org.pentaho.di.ui.spoon.SwtScrollBar) ResultFile(org.pentaho.di.core.ResultFile) MouseAdapter(org.eclipse.swt.events.MouseAdapter) Label(org.eclipse.swt.widgets.Label) Result(org.pentaho.di.core.Result) XulMenuitem(org.pentaho.ui.xul.components.XulMenuitem) HasLogChannelInterface(org.pentaho.di.core.logging.HasLogChannelInterface) KettleException(org.pentaho.di.core.exception.KettleException) Image(org.eclipse.swt.graphics.Image) Rectangle(org.eclipse.swt.graphics.Rectangle) HashMap(java.util.HashMap) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) HashSet(java.util.HashSet) XulMenu(org.pentaho.ui.xul.containers.XulMenu) XulSpoonSettingsManager(org.pentaho.di.ui.spoon.XulSpoonSettingsManager) MessageDialogWithToggle(org.eclipse.jface.dialogs.MessageDialogWithToggle) Canvas(org.eclipse.swt.widgets.Canvas) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph) FillLayout(org.eclipse.swt.layout.FillLayout) RepositoryDirectoryInterface(org.pentaho.di.repository.RepositoryDirectoryInterface) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) Props(org.pentaho.di.core.Props) Combo(org.eclipse.swt.widgets.Combo) Iterator(java.util.Iterator) DropTargetListener(org.eclipse.swt.dnd.DropTargetListener) XulMenupopup(org.pentaho.ui.xul.containers.XulMenupopup) Action(org.eclipse.jface.action.Action) FormAttachment(org.eclipse.swt.layout.FormAttachment) CTabItem(org.eclipse.swt.custom.CTabItem) DelayListener(org.pentaho.di.ui.spoon.trans.DelayListener) RepositoryOperation(org.pentaho.di.repository.RepositoryOperation) XMLTransfer(org.pentaho.di.core.dnd.XMLTransfer) DelayTimer(org.pentaho.di.ui.spoon.trans.DelayTimer) KeyListener(org.eclipse.swt.events.KeyListener) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Menu(org.eclipse.swt.widgets.Menu) Control(org.eclipse.swt.widgets.Control) JobHopMeta(org.pentaho.di.job.JobHopMeta)

Aggregations

JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)149 Point (org.pentaho.di.core.gui.Point)54 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)51 JobMeta (org.pentaho.di.job.JobMeta)47 KettleException (org.pentaho.di.core.exception.KettleException)30 Test (org.junit.Test)28 JobEntryInterface (org.pentaho.di.job.entry.JobEntryInterface)28 NotePadMeta (org.pentaho.di.core.NotePadMeta)24 JobHopMeta (org.pentaho.di.job.JobHopMeta)24 ArrayList (java.util.ArrayList)18 Job (org.pentaho.di.job.Job)18 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)16 JobEntryTrans (org.pentaho.di.job.entries.trans.JobEntryTrans)15 MessageBox (org.eclipse.swt.widgets.MessageBox)13 PluginInterface (org.pentaho.di.core.plugins.PluginInterface)10 Result (org.pentaho.di.core.Result)8 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)8 AreaOwner (org.pentaho.di.core.gui.AreaOwner)8 JobEntrySpecial (org.pentaho.di.job.entries.special.JobEntrySpecial)8 Before (org.junit.Before)7