Package de.danet.an.workflow.api

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


            } else {
                logger.debug ("Retrieving assignments list");
                assignedActivitiesList = new ArrayList ();
                if (selectedResourceKey != null) {
                    try {
                        WorkflowService wfs = wsc.getWorkflowService();
                        WfResource resource
                            = wfs.resourceByKey(selectedResourceKey);
                        Collection assignments = resource.workItems();
                        for (Iterator i = assignments.iterator(); i.hasNext ();) {
                            WfAssignment assignment = (WfAssignment)i.next();
                            assignedActivitiesList.add
                                (new ActivityWrapper
View Full Code Here


     * Update data if not already updated in this lifecycle.
     * @throws RemoteException
     */
    protected void update() throws RemoteException {
        MethodInvocationBatch mib = new MethodInvocationBatch ();
        WorkflowService wfs = WorkflowServiceConnection
            .instance("workflowServiceConnection").getWorkflowService();
        if (processCache == null) {
            ProcessDirectory pd = wfs.processDirectory();
            mib.addInvocation
                (pd, "lookupProcess",
                 new String[] {"java.lang.String", "java.lang.String"},
                 new Object[] {mgrName, processKey});
            mib.addInvocation(-1, "processDefinition", null, null, false);
            mib.addInvocation(-1, "packageId", null, null, false);
            mib.addInvocation(-2, "packageName", null, null, false);
            mib.addInvocation(-3, "processId", null, null, false);
            mib.addInvocation(-4, "processName", null, null, true);
            mib.addInvocation(-5, "name", null, null, false);
            mib.addInvocation(-6, "priority", null, null, false);
            mib.addInvocation(-7, "state", null, null, false);
            mib.addInvocation(-8, "createTime", null, null, false);
            mib.addInvocation(-9, "lastStateTime", null, null, false);
            mib.addInvocation(-10, "requester", null, null, false);
        } else {
            mib.addInvocation(processCache, "key", null, null);
            mib.addInvocation
                (processCache, "processDefinition", null, null);
            mib.addInvocation(-1, "mgrName", null, null, false);
            mib.addInvocation(-2, "packageId", null, null, false);
            mib.addInvocation(-3, "packageName", null, null, false);
            mib.addInvocation(-4, "processId", null, null, false);
            mib.addInvocation(-5, "processName", null, null, true);
            mib.addInvocation(processCache, "name", null, null);
            mib.addInvocation(processCache, "priority", null, null);
            mib.addInvocation(processCache, "state", null, null);
            mib.addInvocation(processCache, "createTime", null, null);
            mib.addInvocation(processCache, "lastStateTime", null, null);
            mib.addInvocation(processCache, "requester", null, null);
        }
        MethodInvocationBatch.Result mir = null;
        try {
            mir = (MethodInvocationBatch.Result)wfs.executeBatch(mib);
        } catch (InvocationTargetException e) {
            throw (IllegalStateException)
                (new IllegalStateException (e.getMessage())).initCause(e);
        }
        if (mir.hasExceptions ()) {
            Exception e = mir.firstException ();
            if (e instanceof RemoteException) {
                throw (RemoteException)e;
            }
            throw (IllegalStateException)
                (new IllegalStateException(e.getMessage())).initCause(e);
        }
        int resPos = 0;
        if (processCache == null) {
            processCache = (Process)mir.result(resPos++);
        } else {
            processKey = mir.resultAsString(resPos++);
            mgrName = mir.resultAsString(resPos++);
        }
        packageId = mir.resultAsString(resPos++);
        packageName = mir.resultAsString(resPos++);
        processId = mir.resultAsString(resPos++);
        processName = mir.resultAsString(resPos++);
        name = mir.resultAsString(resPos++);
        priority = mir.resultAsInt(resPos++);
        state = mir.resultAsString(resPos++);
        createTime = mir.resultAsDate(resPos++);
        lastStateTime = mir.resultAsDate(resPos++);
        WfRequester requester = (WfRequester)mir.result(resPos++);
        if (requester instanceof WfActivity) {
            mib = new MethodInvocationBatch ();
            mib.addInvocation(requester, "name", null, null);
            mib.addInvocation(requester, "key", null, null);
            mib.addInvocation(requester, "container", null, null);
            mib.addInvocation(-1, "manager", null, null, false);
            mib.addInvocation(-1, "name", null, null, true);
            mib.addInvocation(-2, "key", null, null, true);
            mir = null;
            try {
                mir = (MethodInvocationBatch.Result)wfs.executeBatch(mib);
            } catch (InvocationTargetException e) {
                throw (IllegalStateException)
                    (new IllegalStateException (e.getMessage())).initCause(e);
            }
            if (mir.hasExceptions ()) {
View Full Code Here

     * @return the process
     */
    public Process process() throws RemoteException {
        if (processCache == null) {
            try {
                WorkflowService wfs = WorkflowServiceConnection
                    .instance("workflowServiceConnection").getWorkflowService();
                ProcessDirectory pd = wfs.processDirectory();
                processCache = pd.lookupProcess(mgrName, processKey);
            } catch (InvalidKeyException e) {
                return null;
            }
        }
View Full Code Here

        }
        if (activities == null) {
            if (logger.isDebugEnabled()) {
                logger.debug("Retrieving activity list of process " + this);
            }
            WorkflowService wfs = ((WorkflowServiceConnection)
                    fc.getApplication().getVariableResolver()
                    .resolveVariable(fc, "workflowServiceConnection"))
                    .getWorkflowService();
            List actList = new ArrayList();
            for (Iterator i = process().steps().iterator(); i.hasNext();) {
View Full Code Here

    private Activity activity() throws RemoteException, InvalidKeyException {
        FacesContext fc = FacesContext.getCurrentInstance();
        Activity act = (Activity)fc.getExternalContext()
            .getRequestMap().get(uniqueDispKey);
        if (act == null) {
            WorkflowService wfs = WorkflowServiceConnection
                .instance("workflowServiceConnection").getWorkflowService();
            act = wfs.processDirectory().lookupActivity(info.uniqueKey());
            fc.getExternalContext().getRequestMap().put(uniqueDispKey, act);       
        }
        return act;
    }
View Full Code Here

     * Return the selected process.
     * @return selected process
     */
    public ProcessWrapper getProcess () throws RemoteException {
        if (wrappedProcessCache == null) {
            WorkflowService wfs = WorkflowServiceConnection
                .instance("workflowServiceConnection").getWorkflowService();
            wrappedProcessCache
                = new ProcessMutableWrapper (wfs, processMgr, processKey);
        }
        return wrappedProcessCache;
View Full Code Here

       Object objref = serverContext.lookup(homeName);
       WorkflowEngineHome wfeh
           = (WorkflowEngineHome)PortableRemoteObject.narrow
        (objref, WorkflowEngineHome.class);
       WorkflowEngine wfe = wfeh.create();
       WorkflowService service = new StandardWorkflowService
           (recoveryProps, serverContext, wfe);
       return service;
   } catch (NamingException e) {
       logger.error (e.getMessage (), e);
       throw new FactoryConfigurationError
View Full Code Here

            int tries = 20;
            for (; tries > 0; tries--) {
                try {
                    WorkflowServiceFactory wfsf
                        = WorkflowServiceFactory.newInstance ();
                    WorkflowService wfs = wfsf.newWorkflowService();
                    ProcessDefinitionDirectory pdd
                        = wfs.processDefinitionDirectory();
                    pdd.importProcessDefinitions(out.toByteArray());
                    break;
                } catch (FactoryConfigurationError e) {
                    System.err.println
                        ("Problem accessing engine, may not be fully deployed "
View Full Code Here

     * Import the process definitions from a XPDL file
     * unsing the ProcessDefinitionDirectory bean.
     */
    public void importProcessDefinitions() throws Exception {
  WorkflowServiceFactory wsf = WorkflowServiceFactory.newInstance();
  WorkflowService ws = wsf.newWorkflowService();
  pdd = ws.processDefinitionDirectory();
  InputStream is = getClass().getResourceAsStream("/load/processes.xml");
  assertTrue (is != null);
  BufferedReader br = new BufferedReader
      (new InputStreamReader(is, "ISO-8859-1"));
  StringBuffer sb = new StringBuffer();
View Full Code Here

     * Import the process definitions from a XPDL file
     * unsing the ProcessDefinitionDirectory bean.
     */
    public void importProcessDefinitions() throws Exception {
  WorkflowServiceFactory wsf = WorkflowServiceFactory.newInstance();
  WorkflowService ws = workflowService();
  ProcessDefinitionDirectory pdd = ws.processDefinitionDirectory();
  InputStream is = getClass()
            .getResourceAsStream("/load/testByAudit2.xml");
  assertTrue (is != null);
  BufferedReader br = new BufferedReader
      (new InputStreamReader(is, "ISO-8859-1"));
View Full Code Here

TOP

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

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.