Package de.danet.an.workflow.api

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


    /**
     * 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)
View Full Code Here


     * @param wfs the workflow service
     * @param act the activity
     */
    public ActivityWrapper (WorkflowService wfs, Activity act)
        throws RemoteException {
        MethodInvocationBatch mib = new MethodInvocationBatch ();
        mib.addInvocation(act, "activityInfo", null, null);
        mib.addInvocation(act, "state", null, null);
        mib.addInvocation(act, "assignments", null, null);
        mib.addInvocation(act, "executor", null, null);
        mib.addInvocation(act, "validStates", null, null);
        mib.addInvocation(act, "handledExceptions", null, null);
        mib.addInvocation(act, "deadlines", null, null);
        mib.addInvocation(act, "debugEnabled", null, null);
        mib.addInvocation(act, "lastStateTime", null, null);
        MethodInvocationBatch.Result mir = null;
        try {
            mir = (MethodInvocationBatch.Result)wfs.executeBatch(mib);
        } catch (InvocationTargetException e) {
            throw (IllegalStateException)
View Full Code Here

        try {
            activity = activity();
        } catch (InvalidKeyException e) {
            // TODO:
        }
        MethodInvocationBatch mib = new MethodInvocationBatch(true);
        if (dl == null
                || (dl.getExecutionMode() == Activity.DeadlineInfo.SYNCHR)) {
            // not an asynchronous deadline, abandon if not aborted
            if (!state.startsWith("open.running.debug.abandoning")) {
                mib.addInvocation(activity, "abandon",
                        new String[] { "java.lang.String" },
                        new Object[] { exception });
            }
            mib.addInvocation(activity, "changeState",
                    new String[] { "java.lang.String" },
                    new Object[] { "open.running.debug.awaiting_exception" });
            mib.addInvocation(activity, "abandon",
                    new String[] { "java.lang.String" },
                    new Object[] { exception });
        } else {
            // asynchronous deadline, simply have it sent
            mib.addInvocation(activity, "changeState",
                    new String[] { "java.lang.String" },
                    new Object[] { "open.running.debug.forwarding_exception" });
            mib.addInvocation(activity, "abandon",
                    new String[] { "java.lang.String" },
                    new Object[] { exception });
        }
        try {
            MethodInvocationBatch.Result mir = (MethodInvocationBatch.Result)
View Full Code Here

    /**
     * @throws RemoteException
     */
    private void retrieveDataFields(Map dataFieldAttrs)
        throws RemoteException {
        MethodInvocationBatch mib = new MethodInvocationBatch ();
        mib.addInvocation (process(), "processDefinition", null, null);
        mib.addInvocation(-1, "contextSignature", null, null, true);
        mib.addInvocation(process(), "processContext", null, null);
        MethodInvocationBatch.Result mir = null;
        try {
            WorkflowService wfs = WorkflowServiceConnection
                .instance("workflowServiceConnection").getWorkflowService();
            mir = (MethodInvocationBatch.Result)wfs.executeBatch(mib);
View Full Code Here

      pdd = workflowService().processDefinitionDirectory ();
      pmgr = pdd.processMgr("ut-process", "jut1");
  } finally {
      workflowService().release (pdd);
  }
  MethodInvocationBatch mib = new MethodInvocationBatch();
  mib.addInvocation
      (pmgr, "createProcess", new String[]
    {"de.danet.an.workflow.omgcore.WfRequester"},
       new Object[]{new DefaultRequester(workflowService())});
  mib.addInvocation(-1, "key", null, null, false);
  mib.addInvocation(-2, "start", null, null, false);
  MethodInvocationBatch.Result mir = (MethodInvocationBatch.Result)
      workflowService().executeBatch(mib);
  if (mir.hasExceptions ()) {
      Exception e = mir.firstException ();
      assertTrue ("Problem executing batch: " + e.getMessage(), false);
View Full Code Here

     * @param pd the process definition to wrap
     */
    public ProcDefWrapper (WorkflowService wfs, ProcessDefinitionDirectory pdd,
                           ProcessDefinition pd)
        throws RemoteException {
        MethodInvocationBatch mib = new MethodInvocationBatch ();
        mib.addInvocation(pd, "packageId", null, null);
        mib.addInvocation(pd, "packageName", null, null);
        mib.addInvocation(pd, "processId", null, null);
        mib.addInvocation(pd, "processName", null, null);
        mib.addInvocation(pd, "mgrName", null, null);
        mib.addInvocation(pd, "version", null, null);
        mib.addInvocation(pd, "processHeader", null, null);
        mib.addInvocation(-1, "description", null, null, true);
        mib.addInvocation(pd, "toXPDL", null, null);
        MethodInvocationBatch.Result mir = null;
        try {
            mir = (MethodInvocationBatch.Result)wfs.executeBatch(mib);
            if (mir.hasExceptions ()) {
                Exception e = mir.firstException ();
View Full Code Here

      }
                        // add to init data for creation
                        initData.put(dataItemName, dataItemValue);
        }
                    // Not found, create new process
                    MethodInvocationBatch mib = new MethodInvocationBatch();
                    mib.addInvocation
                        (mgr, "createProcess", new String[]
                         {"de.danet.an.workflow.omgcore.WfRequester"},
                         new Object[]{new DefaultRequester(wfs)});
                    mib.addInvocation
                        (-1, "setProcessContext", new String[]
                         {"de.danet.an.workflow.omgcore.ProcessData"},
                         new Object[]{initData}, false);
                    mib.addInvocation(-2, "key", null, null, false);
                    MethodInvocationBatch.Result mir
                        = (MethodInvocationBatch.Result)wfs.executeBatch(mib);
                    if (mir.hasExceptions ()) {
                        Exception e = mir.firstException ();
                        logger.error ("Problem executing batch: "
View Full Code Here

TOP

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

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.