Examples of SuspensionState


Examples of org.camunda.bpm.engine.impl.persistence.entity.SuspensionState

  private void updateSuspensionState(CommandContext commandContext) {
    JobDefinitionManager jobDefinitionManager = commandContext.getJobDefinitionManager();
    JobManager jobManager = commandContext.getJobManager();

    SuspensionState suspensionState = getSuspensionState();

    if (jobDefinitionId != null) {
      jobDefinitionManager.updateJobDefinitionSuspensionStateById(jobDefinitionId, suspensionState);
    } else
View Full Code Here

Examples of org.camunda.bpm.engine.impl.persistence.entity.SuspensionState

    if(jobId == null && jobDefinitionId == null && processInstanceId == null && processDefinitionId == null && processDefinitionKey == null) {
      throw new ProcessEngineException("Job id, job definition id, process instance id, process definition id nor process definition key cannot be null");
    }

    JobManager jobManager = commandContext.getJobManager();
    SuspensionState suspensionState = getSuspensionState();

    if (jobId != null) {
      jobManager.updateJobSuspensionStateById(jobId, suspensionState);
    } else
View Full Code Here

Examples of org.camunda.bpm.engine.impl.persistence.entity.SuspensionState

  }

  protected void updateSuspensionState(CommandContext commandContext) {
    ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

    SuspensionState suspensionState = getProcessDefinitionSuspensionState();

    if (processDefinitionId != null) {
      processDefinitionManager.updateProcessDefinitionSuspensionStateById(processDefinitionId, suspensionState);
    } else
View Full Code Here

Examples of org.camunda.bpm.engine.impl.persistence.entity.SuspensionState

    }

    ExecutionManager executionManager = commandContext.getExecutionManager();
    TaskManager taskManager = commandContext.getTaskManager();

    SuspensionState suspensionState = getNewSuspensionState();

    if (processInstanceId != null) {
      executionManager.updateExecutionSuspensionStateByProcessInstanceId(processInstanceId, suspensionState);
      taskManager.updateTaskSuspensionStateByProcessInstanceId(processInstanceId, suspensionState);
    } else

    if (processDefinitionId != null) {
      executionManager.updateExecutionSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);
      taskManager.updateTaskSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);
    } else

    if (processDefinitionKey != null) {
      executionManager.updateExecutionSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
      taskManager.updateTaskSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
    }

    getSetJobStateCmd().execute(commandContext);

    PropertyChange propertyChange = new PropertyChange(SUSPENSION_STATE_PROPERTY, null, suspensionState.getName());
    commandContext.getOperationLogManager()
      .logProcessInstanceOperation(getLogEntryOperation(), processInstanceId, processDefinitionId,
          processDefinitionKey, propertyChange);

    return null;
View Full Code Here

Examples of org.openquark.cal.internal.runtime.ExecutionContextImpl.SuspensionState

                    ExecutionContextImpl ec = getExecutionContext();
                    Map<Thread, SuspensionState> suspensions = ec.getThreadSuspensions();
                   
                    if (!suspensions.isEmpty()) {
                        Thread currentThread = getDebugController().getCurrentSuspendedThread();
                        SuspensionState suspension = suspensions.get(currentThread);
                        if (suspension == null) {
                            // the current thread is no longer suspended, so choose another one
                            final Map.Entry<Thread, SuspensionState> next = suspensions.entrySet().iterator().next();
                            currentThread = next.getKey();
                            suspension = next.getValue();
                            getDebugController().setCurrentSuspendedThread(currentThread);
                        }
                       
                        if (suspensions.size() > 1) {
                            // more than one thread suspended, so also display thread name
                            outputStream.print("(" + currentThread.getName() + ") " + suspension.getFunctionName() + "#>");
                        } else {
                            outputStream.print(suspension.getFunctionName() + "#>");
                        }
                    } else {
                        outputStream.print(targetModule + ">");
                    }
   
View Full Code Here

Examples of org.openquark.cal.internal.runtime.ExecutionContextImpl.SuspensionState

            return;
        }
       
        Thread currentThread = getDebugController().getCurrentSuspendedThread();
       
        SuspensionState suspension = suspensions.get(currentThread);
        if (suspension == null) {
            logInfo("The current thread is no longer suspended. Change to another thread.");
            return;
        }
        logInfo("Execution suspended in: " + suspension.getFunctionName());
        String[] argNames = suspension.getArgNames();
        CalValue[] argValues = suspension.getArgValues();
       
        if(argNames.length > 0) {
            String argValueStrings[] = DebugSupport.showInternal(argValues);
            logInfo("Argument values:");
            for (int i = 0, n = argNames.length; i < n; ++i) {
View Full Code Here

Examples of org.openquark.cal.internal.runtime.ExecutionContextImpl.SuspensionState

        if (!suspendedThreads.containsKey(currentSuspendedThread)) {
            iceLogger.log(Level.INFO, "The current thread is no longer suspended. Change to another thread.");
            return;
        }
       
        SuspensionState suspension = suspendedThreads.get(currentSuspendedThread);
       
        // Get first word from info.
        StringTokenizer tokenizer = new StringTokenizer(info);
        try {
            String firstWord = tokenizer.nextToken();
            String action = firstWord.toLowerCase();
           
            // :show function
            if (action.equals("function")) {
                // Show the name of the suspended function.
                logInfo("    " + suspension.getFunctionName());
            } else
            // :show argnames  or  :show argtypes
            if (action.equals("argnames") || action.equals("argtypes")) {
                // Display the argument names/types
                String[] argNames = suspension.getArgNames();
                String[] argTypes = suspension.getArgTypes();
                if (argNames.length == 0) {
                    logInfo("    " + suspension.getFunctionName() + " has no arguments.");
                } else {
                    for (int i = 0; i < argNames.length; ++i) {
                        logInfo("    " + argNames[i+ " - " + argTypes[i]);
                    }
                }
            } else
            // :show stack [expanded]
            if (action.equals("stack")) {
                // Show the suspended call stack.
                // By default this is limited to only showing generated CAL functions.
                // Specifying expanded shows everything in the suspended call stack.
                try {
                    String d = tokenizer.nextToken().toLowerCase();
                    if (d.equals("expanded")) {
                        StackTraceElement[] stackTrace = suspension.getStackTrace();
                        for (int i = 0; i < stackTrace.length; ++i) {
                            logInfo(stackTrace[i].toString());
                        }
                    } else {
                        iceLogger.log (Level.INFO, "Unrecognized directive: " + d);
                    }
                } catch (NoSuchElementException e) {
                    // There were no tokens after 'stack' so do the default behaviour.
                    StackTraceElement[] stackTrace = suspension.getStackTrace();
                    for (int i = 0; i < stackTrace.length; ++i) {
                        StackTraceElement ste = stackTrace[i];
                        if (ste.getClassName().indexOf("cal_") >= 0) {
                            logInfo(stackTrace[i].toString());
                        }
                    }
                   
                }
            } else {
                // :show <argument name>
                // Determine which argument and show the name, type, and value.
                String[] argNames = suspension.getArgNames();
                CalValue[] argValues = suspension.getArgValues();
                String[] argTypes = suspension.getArgTypes();
               
                for (int i = 0; i < argNames.length; ++i) {
                    if (argNames[i].equals(firstWord)) {
                        logInfo("    " + argNames[i] + " - " + argTypes[i] + " - " + DebugSupport.showInternal(argValues[i]));
                        return;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.