Package org.activiti.engine.impl.pvm.process

Examples of org.activiti.engine.impl.pvm.process.ActivityImpl


     
    if( task == null || !(task instanceof TaskEntity))
      throw new ApplicationException("当前任务为空或类型不正确!");
   
        // 当前节点 
        ActivityImpl currActivity = getActivityImpl(task, null)
        // 清空当前流向 
        List<PvmTransition> oriPvmTransitionList = clearTransition(currActivity)
 
        // 创建新流向 
        TransitionImpl newTransition = currActivity.createOutgoingTransition()
        // 目标节点 
        ActivityImpl targetActivity = getActivityImpl(task, histTask.getTaskDefinitionKey())
        // 设置新流向的目标节点 
        newTransition.setDestination( targetActivity )
 
        // 执行转向任务 
        taskService.complete(task.getId(), variables)
        //获取新Task
        Task newTask = getCurrentTask( task.getProcessInstanceId() );
        if( newTask != null ){
          //新任务从流程定义恢复,原签收人从历史任务中得到
          taskService.claim(newTask.getId(), histTask.getAssignee() );
        }
        // 删除目标节点新流入 
        targetActivity.getIncomingTransitions().remove(newTransition)
 
        // 还原以前流向 
        restoreTransition(currActivity, oriPvmTransitionList)
       
        //保存操作日志
View Full Code Here


        this.drawHistoryFlow(image, processInstanceId);

        for (HistoricActivityInstance historicActivityInstance : activityInstances) {
            String historicActivityId = historicActivityInstance
                    .getActivityId();
            ActivityImpl activity = definition.findActivity(historicActivityId);

            if (activity != null) {
                if (historicActivityInstance.getEndTime() == null) {
                    // 节点正在运行中
                    signRunningNode(image, activity.getX() - this.minX,
                            activity.getY() - this.minY, activity.getWidth(),
                            activity.getHeight(),
                            historicActivityInstance.getActivityType());
                } else {
                    String deleteReason = null;

                    if (historicActivityInstance.getTaskId() != null) {
                        deleteReason = Context
                                .getCommandContext()
                                .getHistoricTaskInstanceEntityManager()
                                .findHistoricTaskInstanceById(
                                        historicActivityInstance.getTaskId())
                                .getDeleteReason();
                    }

                    // 节点已经结束
                    if ("跳过".equals(deleteReason)) {
                        signSkipNode(image, activity.getX() - this.minX,
                                activity.getY() - this.minY,
                                activity.getWidth(), activity.getHeight(),
                                historicActivityInstance.getActivityType());
                    } else {
                        signHistoryNode(image, activity.getX() - this.minX,
                                activity.getY() - this.minY,
                                activity.getWidth(), activity.getHeight(),
                                historicActivityInstance.getActivityType());
                    }
                }
            }
        }
View Full Code Here

        if (processDefinitionEntity == null) {
            throw new IllegalArgumentException(
                    "cannot find processDefinition : " + processDefinitionId);
        }

        ActivityImpl activity = processDefinitionEntity
                .findActivity(activityId);

        return this.getNextActivities(activity);
    }
View Full Code Here

            } else if (prop instanceof Integer) {
                propertiesJSON.put(key, (Integer) properties.get(key));
            } else if (prop instanceof Boolean) {
                propertiesJSON.put(key, (Boolean) properties.get(key));
            } else if ("initial".equals(key)) {
                ActivityImpl act = (ActivityImpl) properties.get(key);
                propertiesJSON.put(key, act.getId());
            } else if ("timerDeclarations".equals(key)) {
                ArrayList<TimerDeclarationImpl> timerDeclarations = (ArrayList<TimerDeclarationImpl>) properties
                        .get(key);
                ArrayNode timerDeclarationArray = new ObjectMapper()
                        .createArrayNode();
View Full Code Here

        ProcessDefinitionEntity processDefinitionEntity = Context
                .getProcessEngineConfiguration().getProcessDefinitionCache()
                .get(delegateTask.getProcessDefinitionId());

        ActivityImpl startActivity = processDefinitionEntity.getInitial();

        if (startActivity.getOutgoingTransitions().size() != 1) {
            throw new IllegalStateException(
                    "start activity outgoing transitions cannot more than 1, now is : "
                            + startActivity.getOutgoingTransitions().size());
        }

        PvmTransition pvmTransition = startActivity.getOutgoingTransitions()
                .get(0);
        PvmActivity targetActivity = pvmTransition.getDestination();

        if (!"userTask".equals(targetActivity.getProperty("type"))) {
            logger.debug("first activity is not userTask, just skip");
View Full Code Here

    /**
     * 找到这个节点前面的连线.
     */
    public Edge findPreviousEdge(Node currentNode, long currentStartTime) {
        String activityId = currentNode.getName();
        ActivityImpl activityImpl = processDefinitionEntity
                .findActivity(activityId);
        HistoricActivityInstance nestestHistoricActivityInstance = null;
        String temporaryPvmTransitionId = null;

        // 遍历进入当前节点的所有连线
        for (PvmTransition pvmTransition : activityImpl
                .getIncomingTransitions()) {
            PvmActivity source = pvmTransition.getSource();

            String previousActivityId = source.getId();

View Full Code Here

        if (processDefinitionEntity == null) {
            throw new IllegalArgumentException(
                    "cannot find processDefinition : " + processDefinitionId);
        }

        ActivityImpl activity = processDefinitionEntity
                .findActivity(activityId);

        return this.getPreviousActivities(activity);
    }
View Full Code Here

        ExecutionEntity executionEntity = commandContext
                .getExecutionEntityManager().findExecutionById(executionId);
        ProcessDefinitionImpl processDefinition = executionEntity
                .getProcessDefinition();
        ActivityImpl activity = processDefinition.findActivity(activityId);

        executionEntity.executeActivity(activity);

        return null;
    }
View Full Code Here

     */
    private void addParallelInstance() {
        ExecutionEntity parentExecutionEntity = commandContext
                .getExecutionEntityManager()
                .findExecutionById(processInstanceId).findExecution(activityId);
        ActivityImpl activity = getActivity();
        ExecutionEntity execution = parentExecutionEntity.createExecution();
        execution.setActive(true);
        execution.setConcurrent(true);
        execution.setScope(false);

View Full Code Here

    /**
     * <li>获取活动的执行 , 子流程的活动执行是其孩子执行(并行多实例情况下) <li>串行情况下获取的结果数量为1
     */
    protected List<ExecutionEntity> getActivieExecutions() {
        List<ExecutionEntity> activeExecutions = new ArrayList<ExecutionEntity>();
        ActivityImpl activity = getActivity();
        List<ExecutionEntity> executions = getChildExecutionByProcessInstanceId();

        for (ExecutionEntity execution : executions) {
            if (execution.isActive()
                    && (execution.getActivityId().equals(activityId) || activity
                            .contains(execution.getActivity()))) {
                activeExecutions.add(execution);
            }
        }

View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.pvm.process.ActivityImpl

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.