当前位置: 首页>>代码示例>>Java>>正文


Java ActivitiObjectNotFoundException类代码示例

本文整理汇总了Java中org.activiti.engine.ActivitiObjectNotFoundException的典型用法代码示例。如果您正苦于以下问题:Java ActivitiObjectNotFoundException类的具体用法?Java ActivitiObjectNotFoundException怎么用?Java ActivitiObjectNotFoundException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ActivitiObjectNotFoundException类属于org.activiti.engine包,在下文中一共展示了ActivitiObjectNotFoundException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public Boolean execute(CommandContext commandContext) {
    if (taskId == null) {
        throw new ActivitiIllegalArgumentException("taskId is null");
    }
    if (variableName == null) {
        throw new ActivitiIllegalArgumentException("variableName is null");
    }

    TaskEntity task = commandContext
            .getTaskEntityManager()
            .findTaskById(taskId);

    if (task == null) {
        throw new ActivitiObjectNotFoundException("task " + taskId + " doesn't exist", Task.class);
    }
    boolean hasVariable = false;

    if (isLocal) {
        hasVariable = task.hasVariableLocal(variableName);
    } else {
        hasVariable = task.hasVariable(variableName);
    }

    return hasVariable;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:27,代码来源:HasTaskVariableCmd.java

示例2: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public T execute(CommandContext commandContext) {

    if (taskId == null) {
        throw new ActivitiIllegalArgumentException("taskId is null");
    }

    TaskEntity task = commandContext
            .getTaskEntityManager()
            .findTaskById(taskId);

    if (task == null) {
        throw new ActivitiObjectNotFoundException("Cannot find task with id " + taskId, Task.class);
    }

    if (task.isSuspended()) {
        throw new ActivitiException(getSuspendedTaskException());
    }

    return execute(commandContext, task);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:NeedsActiveTaskCmd.java

示例3: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public Void execute(CommandContext commandContext) {

    if (deploymentId == null) {
        throw new ActivitiIllegalArgumentException("Deployment id is null");
    }

    DeploymentEntity deployment = commandContext
            .getDeploymentEntityManager()
            .findDeploymentById(deploymentId);

    if (deployment == null) {
        throw new ActivitiObjectNotFoundException("No deployment found for id = '" + deploymentId + "'", Deployment.class);
    }

    // Update category
    deployment.setCategory(category);

    if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
        commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, deployment));
    }

    return null;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:26,代码来源:SetDeploymentCategoryCmd.java

示例4: deleteVariable

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public void deleteVariable(String processId, String variableName)
{
    validateIfUserAllowedToWorkWithProcess(processId);
    
    if(variableName == null)
    {
        throw new InvalidArgumentException("Variable name is required.");
    }

    try
    {
        if (activitiProcessEngine.getRuntimeService().hasVariable(processId, variableName) == false)
        {
            throw new EntityNotFoundException(variableName);
        }
        activitiProcessEngine.getRuntimeService().removeVariable(processId, variableName);
    }
    catch(ActivitiObjectNotFoundException aonfe)
    {
        throw new EntityNotFoundException(processId);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:ProcessesImpl.java

示例5: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
public List<String> execute(CommandContext commandContext) {
    if (executionId == null) {
        throw new ActivitiIllegalArgumentException("executionId is null");
    }

    ExecutionEntity execution = commandContext
            .getExecutionEntityManager()
            .findExecutionById(executionId);

    if (execution == null) {
        throw new ActivitiObjectNotFoundException("execution " + executionId + " doesn't exist", Execution.class);
    }

    List<String> executionVariables;
    if (isLocal) {
        executionVariables = new ArrayList<String>(execution.getVariableNamesLocal());
    } else {
        executionVariables = new ArrayList<String>(execution.getVariableNames());
    }

    return executionVariables;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:23,代码来源:VariableScopeTest.java

示例6: getFormTemplateString

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
protected String getFormTemplateString(FormData formInstance, String formKey) {
    String deploymentId = formInstance.getDeploymentId();

    ResourceEntity resourceStream = Context
            .getCommandContext()
            .getResourceEntityManager()
            .findResourceByDeploymentIdAndResourceName(deploymentId, formKey);

    if (resourceStream == null) {
        throw new ActivitiObjectNotFoundException("Form with formKey '" + formKey + "' does not exist", String.class);
    }

    byte[] resourceBytes = resourceStream.getBytes();
    String encoding = "UTF-8";
    String formTemplateString = "";
    try {
        formTemplateString = new String(resourceBytes, encoding);
    } catch (UnsupportedEncodingException e) {
        throw new ActivitiException("Unsupported encoding of :" + encoding, e);
    }
    return formTemplateString;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:23,代码来源:JuelFormEngine.java

示例7: findDeployedProcessDefinitionById

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
public ProcessDefinition findDeployedProcessDefinitionById(String processDefinitionId) {
    if (processDefinitionId == null) {
        throw new ActivitiIllegalArgumentException("Invalid process definition id : null");
    }

    // first try the cache
    ProcessDefinitionCacheEntry cacheEntry = processDefinitionCache.get(processDefinitionId);
    ProcessDefinition processDefinition = null;
    if (cacheEntry == null) {
        processDefinition = Context.getCommandContext()
                .getProcessDefinitionEntityManager()
                .findProcessDefinitionById(processDefinitionId);
        if (processDefinition == null) {
            throw new ActivitiObjectNotFoundException("no deployed process definition found with id '" + processDefinitionId + "'", ProcessDefinition.class);
        }
        processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();

    } else {
        processDefinition = cacheEntry.getProcessDefinition();
    }
    return processDefinition;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:23,代码来源:DeploymentManager.java

示例8: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public InputStream execute(CommandContext commandContext) {
    if (deploymentId == null) {
        throw new ActivitiIllegalArgumentException("deploymentId is null");
    }
    if (resourceName == null) {
        throw new ActivitiIllegalArgumentException("resourceName is null");
    }

    ResourceEntity resource = commandContext
            .getResourceEntityManager()
            .findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);
    if (resource == null) {
        if (commandContext.getDeploymentEntityManager().findDeploymentById(deploymentId) == null) {
            throw new ActivitiObjectNotFoundException("deployment does not exist: " + deploymentId, Deployment.class);
        } else {
            throw new ActivitiObjectNotFoundException("no resource found with name '" + resourceName + "' in deployment '" + deploymentId + "'", InputStream.class);
        }
    }
    return new ByteArrayInputStream(resource.getBytes());
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:GetDeploymentResourceCmd.java

示例9: getJobToDelete

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
protected JobEntity getJobToDelete(CommandContext commandContext) {
    if (jobId == null) {
        throw new ActivitiIllegalArgumentException("jobId is null");
    }
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Deleting job {}", jobId);
    }

    JobEntity job = commandContext.getJobEntityManager().findJobById(jobId);
    if (job == null) {
        throw new ActivitiObjectNotFoundException("No job found with id '" + jobId + "'", Job.class);
    }

    // We need to check if the job was locked, ie acquired by the job acquisition thread
    // This happens if the the job was already acquired, but not yet executed.
    // In that case, we can't allow to delete the job.
    if (job.getLockOwner() != null) {
        throw new ActivitiException("Cannot delete job when the job is being executed. Try again later.");
    }
    return job;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:DeleteJobCmd.java

示例10: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public T execute(CommandContext commandContext) {
    if (executionId == null) {
        throw new ActivitiIllegalArgumentException("executionId is null");
    }

    ExecutionEntity execution = commandContext
            .getExecutionEntityManager()
            .findExecutionById(executionId);

    if (execution == null) {
        throw new ActivitiObjectNotFoundException("execution " + executionId + " doesn't exist", Execution.class);
    }

    if (execution.isSuspended()) {
        throw new ActivitiException(getSuspendedExceptionMessage());
    }

    return execute(commandContext, execution);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:21,代码来源:NeedsActiveExecutionCmd.java

示例11: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public Object execute(CommandContext commandContext) {
    if (processInstanceId == null) {
        throw new ActivitiIllegalArgumentException("processInstanceId is null");
    }
    // Check if process instance is still running
    HistoricProcessInstance instance = commandContext
            .getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(processInstanceId);

    if (instance == null) {
        throw new ActivitiObjectNotFoundException("No historic process instance found with id: " + processInstanceId, HistoricProcessInstance.class);
    }
    if (instance.getEndTime() == null) {
        throw new ActivitiException("Process instance is still running, cannot delete historic process instance: " + processInstanceId);
    }

    commandContext
            .getHistoricProcessInstanceEntityManager()
            .deleteHistoricProcessInstanceById(processInstanceId);

    return null;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:DeleteHistoricProcessInstanceCmd.java

示例12: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public Void execute(CommandContext commandContext) {
    JobEntity job = commandContext
            .getJobEntityManager()
            .findJobById(jobId);
    if (job != null) {
        job.setRetries(retries);

        if (commandContext.getEventDispatcher().isEnabled()) {
            commandContext.getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, job));
        }
    } else {
        throw new ActivitiObjectNotFoundException("No job found with id '" + jobId + "'.", Job.class);
    }
    return null;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:SetJobRetriesCmd.java

示例13: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public List<String> execute(CommandContext commandContext) {
    if (executionId == null) {
        throw new ActivitiIllegalArgumentException("executionId is null");
    }

    ExecutionEntity execution = commandContext
            .getExecutionEntityManager()
            .findExecutionById(executionId);

    if (execution == null) {
        throw new ActivitiObjectNotFoundException("execution " + executionId + " doesn't exist", Execution.class);
    }

    return execution.findActiveActivityIds();
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:17,代码来源:FindActiveActivityIdsCmd.java

示例14: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public Void execute(CommandContext commandContext) {
    ExecutionEntityManager executionManager = commandContext.getExecutionEntityManager();
    ExecutionEntity processInstance = executionManager.findExecutionById(processInstanceId);
    if (processInstance == null) {
        throw new ActivitiObjectNotFoundException("No process instance found for id = '" + processInstanceId + "'.", ProcessInstance.class);
    } else if (!processInstance.isProcessInstanceType()) {
        throw new ActivitiIllegalArgumentException(
                "A process instance id is required, but the provided id " +
                        "'" + processInstanceId + "' " +
                        "points to a child execution of process instance " +
                        "'" + processInstance.getProcessInstanceId() + "'. " +
                        "Please invoke the " + getClass().getSimpleName() + " with a root execution id.");
    }

    processInstance.updateProcessBusinessKey(businessKey);

    return null;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:20,代码来源:SetProcessInstanceBusinessKeyCmd.java

示例15: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public TaskFormData execute(CommandContext commandContext) {
    TaskEntity task = commandContext
            .getTaskEntityManager()
            .findTaskById(taskId);
    if (task == null) {
        throw new ActivitiObjectNotFoundException("No task found for taskId '" + taskId + "'", Task.class);
    }

    if (task.getTaskDefinition() != null) {
        TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
        if (taskFormHandler == null) {
            throw new ActivitiException("No taskFormHandler specified for task '" + taskId + "'");
        }

        return taskFormHandler.createTaskForm(task);
    } else {
        // Standalone task, no TaskFormData available
        return null;
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:GetTaskFormCmd.java


注:本文中的org.activiti.engine.ActivitiObjectNotFoundException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。