public class TaskGraphUtils
extends java.lang.Object
Constructor and Description |
---|
TaskGraphUtils() |
Modifier and Type | Method and Description |
---|---|
static Task |
cloneTask(Task task,
boolean preserveinst)
Creates a non-runnable clone of the specfied task, optionally preserving the instance id.
|
static TaskGraph |
cloneTaskGraph(TaskGraph taskgraph,
java.lang.String factorytype)
Creates a full clone of the taskgraph, preserving the instances of the clone and all the tasks within the clone.
|
static TaskGraph |
cloneTaskGraph(TaskGraph taskgraph,
TaskGraph parent,
boolean preserveinst)
Creates a clone of the specified taskgraph within the parent, optionally preserving the instance ids of the
cloned task.
|
static Tool |
cloneTool(Tool tool)
Creates a non-runnable clone of the specfied tool.
|
static void |
connectControlTask(TaskGraph taskgraph)
Sets up the connections for the loop task.
|
static TaskGraph |
copyTaskGraph(TaskGraph taskgraph,
java.lang.String factorytype)
Creates a copy of the taskgraph, not preserving the instance id of the clone or the tasks within the clone.
|
static Tool |
createPlaceHolderTool(Tool tool)
Creates a place holder tool, which is a copy of only the nodes and tool classes of the specified tool.
|
static Task[] |
createTasks(Tool[] tools,
TaskGraph taskgraph,
boolean preserveinst)
Create new tasks in the specified taskgraph taskgraph, optionally preserving the original instance ids in the new
tasks.
|
static void |
disconnectControlTask(TaskGraph taskgraph)
Removes the connections for the loop task.
|
static void |
disposeTool(Tool tool)
Disposes of the specified tool if no longer required
|
static Task |
dummyCloneTask(Task task,
boolean preserveinst)
Creates a clone of the task.
|
static Tool |
dummyCloneTool(Tool tool)
Creates a clone of the tool.
|
static java.lang.String[] |
getAllDataInputTypes(Tool tool) |
static java.lang.String[] |
getAllDataOutputTypes(Tool tool) |
static int |
getAllTasksCount(TaskGraph taskGraph,
boolean includecontrol) |
static Task[] |
getAllTasksRecursive(TaskGraph taskGraph,
boolean includecontrol) |
static void |
getAllTasksRecursive(TaskGraph taskGraph,
java.util.Vector copy,
boolean includecontrol)
Recursively copy all the non-group tasks into the vector
|
static Cable[] |
getConnectedCables(Task task) |
static Cable[] |
getConnectedCables(Task[] tasklist) |
static Task[] |
getConnectedTasks(Task task) |
static Cable[] |
getExternalCables(Task[] tasklist) |
static Task[] |
getInputTasks(Task task) |
static Cable[] |
getInternalCables(Task[] tasklist) |
static java.util.List<Task> |
getLeafTasks(TaskGraph taskgraph) |
static Task[] |
getOutputTasks(Task task) |
static java.util.List<Task> |
getPredecessors(Task t) |
static Task[] |
getRemainingWorkflow(Task task,
boolean include) |
static java.util.List<Task> |
getRootTasks(TaskGraph taskgraph) |
static Node |
getSourceNode(Node node) |
static java.util.List<Task> |
getSuccessors(Task t) |
static boolean |
isConnectedCable(Cable cable,
Task task) |
static boolean |
isConnectedCable(Cable cable,
Task[] tasklist)
Checks if a cable is connected to any task in an array of tasks
|
static boolean |
isControlTask(Task task) |
static boolean |
isExternalCable(Cable cable,
Task[] tasklist)
Checks to see if a given cable is external to a set of tasks, i.e.
|
static boolean |
isInternalCable(Cable cable,
Task[] tasklist)
Checks to see if a given cable is internal to a set of tasks, i.e.
|
static Task |
replaceTask(Task curtask,
Tool newtool,
boolean rename)
Replaces a current task with a new tool (instance id is preserved)
|
static Task |
replaceTask(Task curtask,
Tool newtool,
boolean rename,
boolean preserveinst)
Replaces a current task with a new tool.
|
static TaskGraph |
semiCloneTaskGraph(TaskGraph taskgraph,
java.lang.String factorytype)
Creates a semi-clone of the taskgraph, preserving the instances of the tasks within the the clone, but not the
clone itself (i.e.
|
public static boolean isControlTask(Task task)
public static Tool cloneTool(Tool tool) throws TaskException
TaskException
public static Task cloneTask(Task task, boolean preserveinst) throws TaskException
TaskException
public static Tool dummyCloneTool(Tool tool) throws TaskException
TaskException
public static Task dummyCloneTask(Task task, boolean preserveinst) throws TaskException
TaskException
public static Tool createPlaceHolderTool(Tool tool) throws TaskException
TaskException
public static TaskGraph cloneTaskGraph(TaskGraph taskgraph, TaskGraph parent, boolean preserveinst) throws TaskGraphException
TaskGraphException
public static TaskGraph cloneTaskGraph(TaskGraph taskgraph, java.lang.String factorytype) throws TaskGraphException
TaskGraphException
public static TaskGraph semiCloneTaskGraph(TaskGraph taskgraph, java.lang.String factorytype) throws TaskGraphException
TaskGraphException
public static TaskGraph copyTaskGraph(TaskGraph taskgraph, java.lang.String factorytype) throws TaskGraphException
TaskGraphException
public static Task[] createTasks(Tool[] tools, TaskGraph taskgraph, boolean preserveinst) throws TaskException, CableException
TaskException
CableException
public static Task replaceTask(Task curtask, Tool newtool, boolean rename) throws TaskGraphException
TaskGraphException
public static Task replaceTask(Task curtask, Tool newtool, boolean rename, boolean preserveinst) throws TaskGraphException
curtask
- the task being replacednewtool
- the tool used to replace the existing taskrename
- true if the new task should take the same name as the existing taskpreserveinst
- true if the new task should preseve the instance id of newtoolTaskGraphException
public static void disposeTool(Tool tool)
public static Cable[] getConnectedCables(Task task)
public static Cable[] getConnectedCables(Task[] tasklist)
public static boolean isConnectedCable(Cable cable, Task task)
public static boolean isConnectedCable(Cable cable, Task[] tasklist)
public static Cable[] getInternalCables(Task[] tasklist)
public static boolean isInternalCable(Cable cable, Task[] tasklist)
public static Cable[] getExternalCables(Task[] tasklist)
public static boolean isExternalCable(Cable cable, Task[] tasklist)
public static Task[] getInputTasks(Task task)
public static Task[] getOutputTasks(Task task)
public static Task[] getConnectedTasks(Task task)
public static Task[] getRemainingWorkflow(Task task, boolean include)
public static void connectControlTask(TaskGraph taskgraph) throws TaskGraphException
TaskGraphException
public static void disconnectControlTask(TaskGraph taskgraph) throws TaskGraphException
TaskGraphException
public static Node getSourceNode(Node node)
public static int getAllTasksCount(TaskGraph taskGraph, boolean includecontrol)
public static Task[] getAllTasksRecursive(TaskGraph taskGraph, boolean includecontrol)
public static void getAllTasksRecursive(TaskGraph taskGraph, java.util.Vector copy, boolean includecontrol)
public static java.lang.String[] getAllDataInputTypes(Tool tool)
public static java.lang.String[] getAllDataOutputTypes(Tool tool)