• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ActivitiObjectNotFoundException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: verifyParameters

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
private void verifyParameters(CommandContext commandContext) {
    if (taskId != 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("It is not allowed to add an attachment to a suspended task");
        }
    }

    if (processInstanceId != null) {
        ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId);

        if (execution == null) {
            throw new ActivitiObjectNotFoundException("Process instance " + processInstanceId + " doesn't exist", ProcessInstance.class);
        }

        if (execution.isSuspended()) {
            throw new ActivitiException("It is not allowed to add an attachment to a suspended process instance");
        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:26,代码来源:CreateAttachmentCmd.java


示例17: execute

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

    JobEntity job = commandContext
            .getJobEntityManager()
            .findJobById(jobId);

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

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


示例18: execute

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
@Override
public StartFormData execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) commandContext
            .getProcessEngineConfiguration()
            .getDeploymentManager()
            .findDeployedProcessDefinitionById(processDefinitionId);
    if (processDefinition == null) {
        throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId + "'", ProcessDefinition.class);
    }

    StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
    if (startFormHandler == null) {
        throw new ActivitiException("No startFormHandler defined in process '" + processDefinitionId + "'");
    }

    return startFormHandler.createStartFormData(processDefinition);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:GetStartFormCmd.java


示例19: setVariable

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
protected void setVariable(Execution execution, String name, Object value, RestVariable.RestVariableScope scope, boolean isNew) {
    // Create can only be done on new variables. Existing variables should be updated using PUT
    boolean hasVariable = hasVariableOnScope(execution, name, scope);
    if (isNew && hasVariable) {
        throw new ActivitiException("Variable '" + name + "' is already present on execution '" + execution.getId() + "'.");
    }

    if (!isNew && !hasVariable) {
        throw new ActivitiObjectNotFoundException("Execution '" + execution.getId() + "' doesn't have a variable with name: '" + name + "'.", null);
    }

    RuntimeService runtimeService = BPMNOSGIService.getRuntimeService();
    if (scope == RestVariable.RestVariableScope.LOCAL) {
        runtimeService.setVariableLocal(execution.getId(), name, value);
    } else {
        if (execution.getParentId() != null) {
            runtimeService.setVariable(execution.getParentId(), name, value);
        } else {
            runtimeService.setVariable(execution.getId(), name, value);
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:23,代码来源:BaseExecutionService.java


示例20: setVariable

import org.activiti.engine.ActivitiObjectNotFoundException; //导入依赖的package包/类
protected void setVariable(Execution execution, String name, Object value, RestVariable.RestVariableScope scope, boolean isNew) {
    // Create can only be done on new variables. Existing variables should be updated using PUT
    boolean hasVariable = hasVariableOnScope(execution, name, scope);
    if (isNew && hasVariable) {
        throw new ActivitiException("Variable '" + name + "' is already present on execution '" + execution.getId() + "'.");
    }

    if (!isNew && !hasVariable) {
        throw new ActivitiObjectNotFoundException("Execution '" + execution.getId() + "' doesn't have a variable with name: '"+ name + "'.", null);
    }

    if (scope == RestVariable.RestVariableScope.LOCAL) {
        runtimeService.setVariableLocal(execution.getId(), name, value);
    } else {
        if (execution.getParentId() != null) {
            runtimeService.setVariable(execution.getParentId(), name, value);
        } else {
            runtimeService.setVariable(execution.getId(), name, value);
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:22,代码来源:BaseRuntimeService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CipherInputStream类代码示例发布时间:2022-05-23
下一篇:
Java GrantedAuthorityImpl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap