@Override protected String getViewTitle() { return "Processor " + processor.getLocalName(); }
@Override public String getViewTitle() { return "Loop of " + processor.getLocalName(); }
@Override public void refreshView() { contitionView = new JPanel(); contitionView.setBorder(new EmptyBorder(5,5,5,5)); JLabel controlName = new JLabel("Condition: " + condition.getControl().getLocalName() + " -> " + condition.getTarget().getLocalName()); contitionView.add(controlName); }
public void actionPerformed(ActionEvent event) { try { editManager.doDataflowEdit(dataflow, edits.getCreateConditionEdit(control, target)); } catch (EditException e) { logger.debug("Create control link between '" + control.getLocalName() + "' and '" + target.getLocalName() + "' failed"); } }
@Override public String getViewTitle() { return "Control link: " + condition.getControl().getLocalName() + " runs after " + condition.getTarget().getLocalName(); }
@Override public String getViewTitle() { return "Retry of " + retryLayer.getProcessor().getLocalName(); }
public static String getRelativeName(Dataflow df, Activity activity) { String result = ""; if (df != null) { result += df.getLocalName(); Processor p = findProcessor(df, activity); if (p != null) { result += (":" + p.getLocalName()); } } return result; }
public Element conditionsToXML(List<? extends Processor> processors) { Element result = new Element(CONDITIONS, T2_WORKFLOW_NAMESPACE); // gather conditions Set<Condition> conditions = new HashSet<Condition>(); for (Processor p : processors) { for (Condition c : p.getControlledPreconditionList()) { conditions.add(c); } } for (Condition c : conditions) { Element conditionElement = new Element(CONDITION, T2_WORKFLOW_NAMESPACE); conditionElement.setAttribute("control", c.getControl() .getLocalName()); conditionElement.setAttribute("target", c.getTarget() .getLocalName()); result.addContent(conditionElement); } return result; } }
/** * Adds a processor on the DataFlow. * * @param processor * the ProcessorImpl to be added to the Dataflow * @return * @throws NamingException * if a processor already exists with the same local name */ protected synchronized void addProcessor(ProcessorImpl processor) throws NamingException { for (Processor existingProcessor : processors .toArray(new Processor[] {})) { if (existingProcessor.getLocalName().equals( processor.getLocalName())) throw new NamingException("There already is a processor named:" + processor.getLocalName()); } processors.add(processor); }
/** * Adds a processor on the DataFlow. * * @param processor * the ProcessorImpl to be added to the Dataflow * @return * @throws NamingException * if a processor already exists with the same local name */ protected synchronized void addProcessor(ProcessorImpl processor) throws NamingException { for (Processor existingProcessor : processors .toArray(new Processor[] {})) { if (existingProcessor.getLocalName().equals( processor.getLocalName())) throw new NamingException("There already is a processor named:" + processor.getLocalName()); } processors.add(processor); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); //sb.append("Nested workflow"); Collection<Processor> processors = Tools.getProcessorsWithActivity(getParentDataflow(), getNestedDataflow()); if (! processors.isEmpty()) { Processor processor = processors.iterator().next(); //sb.append(' '); sb.append(processor.getLocalName()); sb.append(" in "); // TODO: Is this safe? This might make a loop if a nested workflow has a parent // in a nested workflow.. sb.append(FileManager.getInstance().getDataflowName(getParentDataflow())); } else { sb.append("Nested workflow"); } return sb.toString(); }
public void actionPerformed(ActionEvent e) { String title = "Retries for service " + retryLayer.getProcessor().getLocalName(); final JDialog dialog = new HelpEnabledDialog(owner, title, true); RetryConfigurationPanel retryConfigurationPanel = new RetryConfigurationPanel(retryLayer.getConfiguration()); dialog.add(retryConfigurationPanel, BorderLayout.CENTER); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); JButton helpButton = new JButton(helpAction); buttonPanel.add(helpButton); JButton okButton = new JButton(new OKAction(dialog, retryConfigurationPanel)); buttonPanel.add(okButton); JButton resetButton = new JButton(new ResetAction( retryConfigurationPanel)); buttonPanel.add(resetButton); JButton cancelButton = new JButton(new CancelAction(dialog)); buttonPanel.add(cancelButton); dialog.add(buttonPanel, BorderLayout.SOUTH); dialog.pack(); dialog.setLocationRelativeTo(null); dialog.setVisible(true); }
public AddConditionAction(Dataflow dataflow, Processor control, Processor target, Component component) { super(dataflow, component); this.control = control; this.target = target; Activity<?> activity = control.getActivityList().get(0); Icon activityIcon = ActivityIconManager.getInstance().iconForActivity(activity); putValue(SMALL_ICON, activityIcon); putValue(NAME, control.getLocalName()); }
public static String findName(Port port) { if (port instanceof ProcessorPort) { String sourceProcessorName = ((ProcessorPort)port).getProcessor().getLocalName(); return sourceProcessorName + ":" + port.getName(); } else if (port instanceof MergePort) { String sourceMergeName = ((MergePort)port).getMerge().getLocalName(); return sourceMergeName + ":" + port.getName(); } else { return port.getName(); } } }
private String findName(Port port) { if (port instanceof ProcessorPort) { String sourceProcessorName = ((ProcessorPort)port).getProcessor().getLocalName(); return sourceProcessorName + ":" + port.getName(); } else if (port instanceof MergePort) { String sourceMergeName = ((MergePort)port).getMerge().getLocalName(); return sourceMergeName + ":" + port.getName(); } else { return port.getName(); } } }
@SuppressWarnings("null") @Test public void testBoundPortOverridesDefault() throws Exception { Dataflow dataflow = loadAndTranslateWorkflow("bound_port_overides_default.xml"); assertEquals("there should only be 2 processors",2,dataflow.getProcessors().size()); Processor processor_A=null; Processor processor_B=null; for (Processor p : dataflow.getProcessors()) { if (p.getLocalName().equals("Processor_A")) processor_A=p; if (p.getLocalName().equals("Processor_B")) processor_B=p; } assertNotNull("Could not find processor A",processor_A); assertNotNull("Could not find processor B",processor_B); assertEquals("processor_A should have no inputs",0,processor_A.getInputPorts().size()); assertEquals("processor_A should have 1 output",1,processor_A.getOutputPorts().size()); assertEquals("processor_B should have 1 input",1,processor_B.getInputPorts().size()); assertEquals("processor_B should have 1 input named input_1","input_1",processor_B.getInputPorts().get(0).getName()); assertEquals("processor_B should have 1 output",1,processor_B.getOutputPorts().size()); assertEquals("processor_B should have 1 activity",1,processor_B.getActivityList().size()); Activity<?>activity = processor_B.getActivityList().get(0); assertEquals("activity should have 3 input ports",3,activity.getInputPorts().size()); }
@SuppressWarnings("null") @Test public void testBoundPortOverridesDefault() throws Exception { Dataflow dataflow = loadAndTranslateWorkflow("bound_port_overides_default.xml"); assertEquals("there should only be 2 processors",2,dataflow.getProcessors().size()); Processor processor_A=null; Processor processor_B=null; for (Processor p : dataflow.getProcessors()) { if (p.getLocalName().equals("Processor_A")) processor_A=p; if (p.getLocalName().equals("Processor_B")) processor_B=p; } assertNotNull("Could not find processor A",processor_A); assertNotNull("Could not find processor B",processor_B); assertEquals("processor_A should have no inputs",0,processor_A.getInputPorts().size()); assertEquals("processor_A should have 1 output",1,processor_A.getOutputPorts().size()); assertEquals("processor_B should have 1 input",1,processor_B.getInputPorts().size()); assertEquals("processor_B should have 1 input named input_1","input_1",processor_B.getInputPorts().get(0).getName()); assertEquals("processor_B should have 1 output",1,processor_B.getOutputPorts().size()); assertEquals("processor_B should have 1 activity",1,processor_B.getActivityList().size()); Activity<?>activity = processor_B.getActivityList().get(0); assertEquals("activity should have 3 input ports",3,activity.getInputPorts().size()); }
@SuppressWarnings("null") @Test public void testRemovalOfUnboundPorts() throws Exception { Dataflow dataflow = loadAndTranslateWorkflow("unbound_ports.xml"); Processor processor_A=null; Processor processor_B=null; assertEquals("there should only be 2 processors",2,dataflow.getProcessors().size()); for (Processor p : dataflow.getProcessors()) { if (p.getLocalName().equals("Processor_A")) processor_A=p; if (p.getLocalName().equals("Processor_B")) processor_B=p; } assertNotNull("Could not find processor A",processor_A); assertNotNull("Could not find processor B",processor_B); assertEquals("processor_A should have no inputs",0,processor_A.getInputPorts().size()); assertEquals("processor_A should have 1 output",1,processor_A.getOutputPorts().size()); assertEquals("processor_B should have 1 input",1,processor_B.getInputPorts().size()); assertEquals("processor_B should have 1 input named input_1","input_1",processor_B.getInputPorts().get(0).getName()); assertEquals("processor_B should have 1 output",1,processor_B.getOutputPorts().size()); assertEquals("processor_B should have 1 activity",1,processor_B.getActivityList().size()); Activity<?>activity = processor_B.getActivityList().get(0); assertEquals("activity should have 3 input ports",3,activity.getInputPorts().size()); }
@SuppressWarnings("null") @Test public void testBoundPortOverridesDefault() throws Exception { Dataflow dataflow = loadAndTranslateWorkflow("bound_port_overides_default.xml"); assertEquals("there should only be 2 processors",2,dataflow.getProcessors().size()); Processor processor_A=null; Processor processor_B=null; for (Processor p : dataflow.getProcessors()) { if (p.getLocalName().equals("Processor_A")) processor_A=p; if (p.getLocalName().equals("Processor_B")) processor_B=p; } assertNotNull("Could not find processor A",processor_A); assertNotNull("Could not find processor B",processor_B); assertEquals("processor_A should have no inputs",0,processor_A.getInputPorts().size()); assertEquals("processor_A should have 1 output",1,processor_A.getOutputPorts().size()); assertEquals("processor_B should have 1 input",1,processor_B.getInputPorts().size()); assertEquals("processor_B should have 1 input named input_1","input_1",processor_B.getInputPorts().get(0).getName()); assertEquals("processor_B should have 1 output",1,processor_B.getOutputPorts().size()); assertEquals("processor_B should have 1 activity",1,processor_B.getActivityList().size()); Activity<?>activity = processor_B.getActivityList().get(0); assertEquals("activity should have 3 input ports",3,activity.getInputPorts().size()); }
@Test(expected=NamingException.class) public void testDuplicateName() throws Exception { Dataflow f = new DataflowImpl(); AddProcessorEdit edit = new AddProcessorEdit(f,processor); edit.doEdit(); ProcessorImpl processor2=new ProcessorImpl(); processor2.setName(processor.getLocalName()); AddProcessorEdit edit2 = new AddProcessorEdit(f,processor2); edit2.doEdit(); }