Search in sources :

Example 1 with WorkflowJGraphProxy

use of org.vcell.vmicro.workflow.jgraphx.WorkflowJGraphProxy in project vcell by virtualcell.

the class WorkflowFileTest 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 {
        File workingDirectory = new File(args[0]);
        LocalWorkspace localWorkspace = new LocalWorkspace(workingDirectory);
        String workflowLanguageText = BeanUtils.readBytesFromFile(new File(args[1]), null);
        Repository repository = new MemoryRepository();
        Workflow workflow = Workflow.parse(repository, localWorkspace, workflowLanguageText);
        TaskContext taskContext = new TaskContext(workflow, repository, localWorkspace);
        WorkflowUtilities.displayWorkflowGraph(taskContext.getWorkflow());
        WorkflowUtilities.displayWorkflowTable(taskContext);
        WorkflowUtilities.displayWorkflowGraphJGraphX(new WorkflowJGraphProxy(taskContext));
        ArrayList<Issue> issues = new ArrayList<Issue>();
        taskContext.getWorkflow().reportIssues(issues, Issue.SEVERITY_INFO, true);
        // 
        // execute the workflow
        // 
        taskContext.getWorkflow().compute(taskContext, new WorkflowUtilities.Progress());
    } catch (Exception e) {
        e.printStackTrace(System.out);
    }
}
Also used : LocalWorkspace(org.vcell.vmicro.workflow.data.LocalWorkspace) TaskContext(org.vcell.workflow.TaskContext) Issue(org.vcell.util.Issue) ArrayList(java.util.ArrayList) Workflow(org.vcell.workflow.Workflow) WorkflowJGraphProxy(org.vcell.vmicro.workflow.jgraphx.WorkflowJGraphProxy) Repository(org.vcell.workflow.Repository) MemoryRepository(org.vcell.workflow.MemoryRepository) MemoryRepository(org.vcell.workflow.MemoryRepository) File(java.io.File)

Aggregations

File (java.io.File)1 ArrayList (java.util.ArrayList)1 Issue (org.vcell.util.Issue)1 LocalWorkspace (org.vcell.vmicro.workflow.data.LocalWorkspace)1 WorkflowJGraphProxy (org.vcell.vmicro.workflow.jgraphx.WorkflowJGraphProxy)1 MemoryRepository (org.vcell.workflow.MemoryRepository)1 Repository (org.vcell.workflow.Repository)1 TaskContext (org.vcell.workflow.TaskContext)1 Workflow (org.vcell.workflow.Workflow)1