Package de.danet.an.workflow.api

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


   // Create process definition directory bean
  ProcessDefinitionDirectoryHome pddh
      = (ProcessDefinitionDirectoryHome)EJBUtil.lookupEJBHome
      (ProcessDefinitionDirectoryHome.class,
       "ejb/de.danet.an.wfdemo.ProcessDefinitionDirectory");
  ProcessDefinitionDirectory pdd = pddh.create();
  InputStream is = JSTest2.class.getResourceAsStream(filename);
  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


            JSFUtil.addMessage(FacesMessage.SEVERITY_ERROR, L10N_MSGS,
                    "missingProcDefFile", null);
            return "OK";
        }
        FileItem fileItem = (FileItem)fileItems.get("file");
        ProcessDefinitionDirectory pdd = null;
        try {
            pdd = wsc.getWorkflowService().processDefinitionDirectory();
            if (logger.isDebugEnabled ()) {
                logger.debug ("Importing from " + fileItem.getName());
            }
            InputStream is = fileItem.getInputStream();
            ByteArrayOutputStream bos = new ByteArrayOutputStream ();
            byte[] buf = new byte[10000];
            int cnt = 0;
            while ((cnt = is.read(buf)) >= 0) {
                bos.write (buf, 0, cnt);
            }
            is.close();
            List pms = pdd.importProcessDefinitions(bos.toByteArray());
            JSFUtil.addMessage(FacesMessage.SEVERITY_INFO, L10N_MSGS,
                    "procDefsImported", new Object[] { fileItem.getName() });
            if (pms.size() > 0) {
                addMessages(pms);
            }
View Full Code Here

    /**
     * Try to create the process identified by the id
     */
    public WfProcess createProcess (String pkgId, String prcId)
        throws Exception {
  ProcessDefinitionDirectory pdd = null;
  try {
      pdd = workflowService().processDefinitionDirectory();
      WfProcessMgr pmgr = pdd.processMgr(pkgId, prcId);
      return pmgr.createProcess (new DefaultRequester(workflowService()));
  } finally {
      workflowService().release (pdd);
  }
    }
View Full Code Here

     */
    public DataModel getProcessDefinitions () {
        if (defsModelCache == null) {
            if (defListCache == null) {
                logger.debug ("Retrieving process definition list");           
                ProcessDefinitionDirectory pdd = null;
                defListCache = new ArrayList ();
                try {
                    pdd = wsc.getWorkflowService().processDefinitionDirectory();
                    Collection defs = pdd.processDefinitions();
                    for (Iterator i = defs.iterator(); i.hasNext ();) {
                        defListCache.add (new ProcDefWrapper
                                          (wsc.getWorkflowService(),
                                           pdd, (ProcessDefinition)i.next()));
                    }
View Full Code Here

     * @param processId the processId
     * @throws RemoteException if a system level error occurs
     */
    public void createAndStartProcess (String packageId, String processId)
        throws RemoteException, InvalidKeyException {
        ProcessDefinitionDirectory pdd = null;
        try {
            pdd = wsc.getWorkflowService().processDefinitionDirectory();
            ProcessMgr pmgr = pdd.processMgr(packageId, processId);
            Process p = (Process)pmgr.createProcess
                (new DefaultRequester(wsc.getWorkflowService()));
            if (isStartInDebugMode()) {
                p.setDebugEnabled (true);
            }
View Full Code Here

     * @param state the new enabled state
     * @throws RemoteException if a system level error occurs
     */
    public void setEnabled (String packageId, String processId, boolean state)
        throws RemoteException, InvalidKeyException {
        ProcessDefinitionDirectory pdd = null;
        try {
            pdd = wsc.getWorkflowService().processDefinitionDirectory();
            pdd.setEnabled(packageId, processId, state);
        } finally {
            wsc.getWorkflowService().release(pdd);
        }
       
    }
View Full Code Here

     * @param processId the process id
     * @throws RemoteException if a system level error occurs
     */
    public void remove (String packageId, String processId)
        throws RemoteException, InvalidKeyException {
        ProcessDefinitionDirectory pdd = null;
        try {
            pdd = wsc.getWorkflowService().processDefinitionDirectory();
            pdd.removeProcessDefinition(packageId, processId);
        } finally {
            wsc.getWorkflowService().release(pdd);
        }
        reloadBeforeRendering = true;
    }
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/xmlrpctests.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

     * Adder test
     *
     * @throws Exception
     */
    public void testAdder () throws Exception {
        ProcessDefinitionDirectory procDefDir = null;
        ProcessDirectory procDir = null;
       
        try {
            procDefDir = workflowService.processDefinitionDirectory();
            procDir = workflowService.processDirectory();
            ProcessMgr pmgr = procDefDir.processMgr ("xmlrpctests", "addNumbers");
            WfProcess process
                = pmgr.createProcess(new DefaultRequester (workflowService));
            process.start();
            assertTrue (stateReached (process, "closed.completed"));
            procDir.removeProcess(process);
View Full Code Here

     * Echo test
     *
     * @throws Exception
     */
    public void testEcho () throws Exception {
        ProcessDefinitionDirectory procDefDir = null;
        ProcessDirectory procDir = null;
       
        try {
            procDefDir = workflowService.processDefinitionDirectory();
            procDir = workflowService.processDirectory();
            ProcessMgr pmgr = procDefDir.processMgr ("xmlrpctests", "echoXml");
            WfProcess process
                = pmgr.createProcess(new DefaultRequester (workflowService));
            process.start();
            assertTrue (stateReached (process, "closed.completed"));
            procDir.removeProcess(process);
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.