Example of conditional invocation
Created: 2012-04-05 16:42:56
Last updated: 2012-04-05 16:42:57
This workflow demonstrates how nested workflows can be conditionally invoked
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Example of conditional invocation |
Descriptions (1)
This workflow demonstrates how nested workflows can be conditionally invoked |
Dependencies (0)
Inputs (1)
Name |
Description |
condition |
The condition that determines which of the two nested workflows is invoked
|
Processors (5)
Name |
Type |
Description |
condition_checker |
beanshell |
This service checks if the condition is "true" and if so outputs a value in the pass_flags list and
leaves the fail_flags empty. If the condition is not true then the service outputs a value in the
fail_flags list and leaves the pass_flags empty. Scriptimport java.util.ArrayList;
ArrayList pass_flags = new ArrayList();
ArrayList fail_flags = new ArrayList();
if (condition.equals("true")) {
pass_flags.add(condition);
} else {
fail_flags.add(condition);
}
|
if_condition_passed |
workflow |
|
if_condition_failed |
workflow |
|
Flatten_List |
localworker |
Scriptflatten(inputs, outputs, depth) {
for (i = inputs.iterator(); i.hasNext();) {
element = i.next();
if (element instanceof Collection && depth > 0) {
flatten(element, outputs, depth - 1);
} else {
outputs.add(element);
}
}
}
outputlist = new ArrayList();
flatten(inputlist, outputlist, 1); |
Merge_String_List_to_a_String |
localworker |
ScriptString seperatorString = "\n";
if (seperator != void) {
seperatorString = seperator;
}
StringBuffer sb = new StringBuffer();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
sb.append(item);
if (i.hasNext()) {
sb.append(seperatorString);
}
}
concatenated = sb.toString();
|
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
condition_checker |
This service checks if the condition is "true" and if so outputs a value in the pass_flags list and
leaves the fail_flags empty. If the condition is not true then the service outputs a value in the
fail_flags list and leaves the pass_flags empty. |
condition
|
pass_flags
fail_flags
|
Datalinks (7)
Source |
Sink |
condition |
condition_checker:condition |
condition_checker:pass_flags |
if_condition_passed:sentinel |
condition_checker:fail_flags |
if_condition_failed:sentinel |
Flatten_List:outputlist |
Merge_String_List_to_a_String:stringlist |
if_condition_passed:message |
Flatten_List:inputlist |
if_condition_failed:message |
Flatten_List:inputlist |
Merge_String_List_to_a_String:concatenated |
message |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (2)
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment