use of org.vcell.workflow.Repository in project vcell by virtualcell.
the class KenworthyTest method main.
public static void main(String[] args) {
if (args.length != 2) {
System.out.println("expecting 2 arguments");
System.out.println("usage: java " + Workflow.class.getSimpleName() + " workingdir workflowInputFile");
System.out.println("workingdir example: " + "D:\\developer\\eclipse\\workspace\\VCell_5.4_vmicro\\datadir");
System.out.println("workflowInputFile example: " + "D:\\developer\\eclipse\\workspace\\VCell_5.4_vmicro\\workflow1.txt");
System.exit(1);
}
try {
// PropertyLoader.loadProperties();
// workflowInputFile "C:\\developer\\eclipse\\workspace\\VCell_5.3_vmicro\\workflow1.txt"
File workingDirectory = new File(args[0]);
LocalWorkspace localWorkspace = new LocalWorkspace(workingDirectory);
Repository repository = new MemoryRepository();
// String workflowLanguageText = BeanUtils.readBytesFromFile(new File(args[1]), null);
// Workflow workflow = Workflow.parse(localWorkspace, workflowLanguageText);
System.err.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> using hard-coded example instead <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
File vfrapFile = new File("D:\\Developer\\eclipse\\workspace_refactor\\VCell_5.4_vmicro\\3D_FRAP_2_ZProjection_Simulation1.vfrap");
// Workflow workflow = getVFrapSimpleExample(workingDirectory, vfrapFile);
// Workflow workflow = getFakeDataExample(workingDirectory);
Workflow workflow = getInteractiveModelWorkflow(repository, workingDirectory);
TaskContext taskContext = new TaskContext(workflow, repository, localWorkspace);
ArrayList<Issue> issues = new ArrayList<Issue>();
IssueContext issueContext = new IssueContext();
workflow.gatherIssues(issueContext, issues);
// WorkflowJGraphProxy workflowJGraphProxy = new WorkflowJGraphProxy(workflow);
// displayWorkflowGraphJGraphX(workflowJGraphProxy);
WorkflowUtilities.displayWorkflowGraph(workflow);
WorkflowUtilities.displayWorkflowTable(taskContext);
workflow.reportIssues(issues, Issue.SEVERITY_INFO, true);
//
// execute the workflow
//
workflow.compute(taskContext, new WorkflowUtilities.Progress());
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
use of org.vcell.workflow.Repository in project vcell by virtualcell.
the class WorkflowObjectsTableModel method setValueAt.
public void setValueAt(Object value, int row, int col) {
if (value == null) {
return;
}
try {
String inputValue = (String) value;
inputValue = inputValue.trim();
WorkflowObject workflowObject = getValueAt(row);
switch(col) {
case COLUMN_VALUE:
{
if (inputValue.length() == 0) {
return;
}
if (workflowObject instanceof WorkflowParameter) {
WorkflowParameter dataHolder = (WorkflowParameter) workflowObject;
Class dataClass = dataHolder.getType();
Repository repository = taskContext.getRepository();
Workflow workflow = taskContext.getWorkflow();
if (dataClass.equals(Double.class)) {
repository.setData(dataHolder, Double.valueOf(inputValue));
workflow.refreshStatus();
} else if (dataClass.equals(Float.class)) {
repository.setData(dataHolder, Float.valueOf(inputValue));
workflow.refreshStatus();
} else if (dataClass.equals(Integer.class)) {
repository.setData(dataHolder, Integer.valueOf(inputValue));
workflow.refreshStatus();
} else if (dataClass.equals(Boolean.class)) {
repository.setData(dataHolder, Boolean.valueOf(inputValue));
workflow.refreshStatus();
} else if (dataClass.equals(String.class)) {
repository.setData(dataHolder, inputValue);
workflow.refreshStatus();
} else {
System.out.println("type " + dataClass.getSimpleName() + " not supported");
}
}
break;
}
}
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
Aggregations