Package de.danet.an.workflow.api

Examples of de.danet.an.workflow.api.ProcessDefinitionDirectory


    /**
     * Import the process definitions from a XPDL file
     * unsing the ProcessDefinitionDirectory bean.
     */
    public void importProcessDefinitions() throws Exception {
  ProcessDefinitionDirectory pdd
      = workflowService().processDefinitionDirectory();
  InputStream is = getClass()
            .getResourceAsStream("/process/testXPDL.xml");
  assertTrue (is != null);
  BufferedReader br = new BufferedReader
      (new InputStreamReader(is, "ISO-8859-1"));
  StringBuffer sb = new StringBuffer();
  String st;
  while ((st = br.readLine()) != null) {
      sb.append(st + "\n");
  }
  pdd.importProcessDefinitions(sb.toString());
  Collection processDefinitions = pdd.processDefinitions();
  assertTrue (processDefinitions.size() > 0)
    }
View Full Code Here


    }

    private WfProcess createProcess
  (String pkgId, String prcId, WfRequester req)
        throws Exception {
  ProcessDefinitionDirectory pdd
      = workflowService().processDefinitionDirectory();
  WfProcessMgr pmgr = pdd.processMgr(pkgId, prcId);
  return pmgr.createProcess (req);
    }
View Full Code Here

     * Import the process definitions from a XPDL file
     * unsing the ProcessDefinitionDirectory bean.
     */
    public void importProcessDefinitions() throws Exception {
  // Create process definition directory bean
  ProcessDefinitionDirectory pdd
      = workflowService.processDefinitionDirectory();

  InputStream is = getClass().getResourceAsStream("/tools/timing.xml");
  assertTrue (is != null);
  BufferedReader br = new BufferedReader
      (new InputStreamReader(is, "ISO-8859-1"));
  StringBuffer sb = new StringBuffer();
  String st;
  while ((st = br.readLine()) != null) {
      sb.append(st + "\n");
  }
  pdd.importProcessDefinitions(sb.toString());
  Collection processDefinitions = pdd.processDefinitions();
  assertTrue (processDefinitions.size() > 0);
    }
View Full Code Here

    /**
     * Test.
     */
    public void waitTest1() throws Exception {
  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("timing", "wait_test1");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
View Full Code Here

    /**
     * Test.
     */
    public void waitTest2() throws Exception {
  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("timing", "wait_test2");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
View Full Code Here

    /**
     * Test.
     */
    public void simpleTest() throws Exception {
  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("timing", "simple_test");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
View Full Code Here

    /**
     * Test.
     */
    public void expiredTest() throws Exception {
  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("timing", "expired_test");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
View Full Code Here

    /**
     * Test.
     */
    public void cancelTest() throws Exception {
  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("timing", "cancel_test");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
View Full Code Here

    }

    private WfProcess createProcess
  (String pkgId, String prcId, WfRequester req)
        throws Exception {
  ProcessDefinitionDirectory procDir = null;
  try {
      procDir = workflowService.processDefinitionDirectory();
      ProcessMgr pmgr = procDir.processMgr(pkgId, prcId);
      return pmgr.createProcess (req);
  } finally {
      workflowService.release (procDir);
  }
    }
View Full Code Here

  String st;
  while ((st = br.readLine()) != null) {
      toParse.append(st + "\n");
  }

  ProcessDefinitionDirectory pdd
            = workflowService().processDefinitionDirectory();
  if (!pdd.processDefinitionExists("ut-ras", "ras_test")) {
      pdd.importProcessDefinitions(toParse.toString());
  }
    }
View Full Code Here

TOP

Related Classes of de.danet.an.workflow.api.ProcessDefinitionDirectory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.