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


Java PvmActivity.getProperty方法代码示例

本文整理汇总了Java中org.activiti.engine.impl.pvm.PvmActivity.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java PvmActivity.getProperty方法的具体用法?Java PvmActivity.getProperty怎么用?Java PvmActivity.getProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.impl.pvm.PvmActivity的用法示例。


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

示例1: getTaskForTimer

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private WorkflowTask getTaskForTimer(Job job, ProcessInstance processInstance, Execution jobExecution) 
{
    if (job instanceof TimerEntity) 
    {
        ReadOnlyProcessDefinition def = activitiUtil.getDeployedProcessDefinition(processInstance.getProcessDefinitionId());
        List<String> activeActivityIds = runtimeService.getActiveActivityIds(jobExecution.getId());
        
        if(activeActivityIds.size() == 1)
        {
            PvmActivity targetActivity = def.findActivity(activeActivityIds.get(0));
            if(targetActivity != null)
            {
                // Only get tasks of active activity is a user-task 
                String activityType = (String) targetActivity.getProperty(ActivitiConstants.NODE_TYPE);
                if(ActivitiConstants.USER_TASK_NODE_TYPE.equals(activityType))
                {
                    Task task = taskService.createTaskQuery().executionId(job.getExecutionId()).singleResult();
                    return typeConverter.convert(task);
                }
            }
        }
    }
    return null;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:ActivitiWorkflowEngine.java

示例2: getNode

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
/**
 * @param activity PvmActivity
 * @param key String
 * @param forceIsTaskNode boolean
 * @return WorkflowNode
 */
private WorkflowNode getNode(PvmActivity activity, String key, boolean forceIsTaskNode)
{
    String name = activity.getId();
     String defaultTitle = (String) activity.getProperty(ActivitiConstants.NODE_NAME);
     String defaultDescription = (String) activity.getProperty(ActivitiConstants.NODE_DESCRIPTION);
     String type = (String) activity.getProperty(ActivitiConstants.NODE_TYPE);
     boolean isTaskNode = forceIsTaskNode || ActivitiConstants.USER_TASK_NODE_TYPE.equals(type);
     
     if(defaultTitle == null)
     {
     	defaultTitle = name;
     }
     if(defaultDescription == null)
     {
     	defaultDescription = name;
     }
    WorkflowTransition transition = getDefaultTransition(key, name);
    return factory.createNode(name, key, defaultTitle, defaultDescription, type, isTaskNode, transition);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:ActivitiTypeConverter.java

示例3: execute

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) {
    ActivityExecution activityExecution = (ActivityExecution) execution;
    PvmActivity activity = activityExecution.getActivity();
    ActivityImpl initialActivity = (ActivityImpl) activity.getProperty(BpmnParse.PROPERTYNAME_INITIAL);

    if (initialActivity == null) {
        throw new ActivitiException("No initial activity found for subprocess "
                + activityExecution.getActivity().getId());
    }

    // initialize the template-defined data objects as variables
    initializeDataObjects(activityExecution, activity);

    if (initialActivity.getActivityBehavior() != null
            && initialActivity.getActivityBehavior() instanceof NoneStartEventActivityBehavior) { // embedded subprocess: only none start allowed
        ((ExecutionEntity) execution).setActivity(initialActivity);
        Context.getCommandContext().getHistoryManager().recordActivityStart((ExecutionEntity) execution);
    }

    activityExecution.executeActivity(initialActivity);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:23,代码来源:SubProcessActivityBehavior.java

示例4: isUserTask

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private boolean isUserTask(PvmActivity currentActivity)
{
    // TODO: Validate if this is the best way to find out an activity is a usertask
    String type = (String) currentActivity.getProperty(ActivitiConstants.NODE_TYPE);
    if(type != null && type.equals(ActivitiConstants.USER_TASK_NODE_TYPE))
    {
        return true;
    }
    return false;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:11,代码来源:ActivitiTypeConverter.java

示例5: isSubProcess

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private boolean isSubProcess(PvmActivity currentActivity)
{
    String type = (String) currentActivity.getProperty(ActivitiConstants.NODE_TYPE);
    if(type != null && type.equals(ActivitiConstants.SUB_PROCESS_NODE_TYPE))
    {
        return true;
    }
    return false;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:ActivitiTypeConverter.java

示例6: timerFires

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void timerFires(ActivityExecution execution, String signalName, Object signalData) throws Exception {
    PvmActivity timerActivity = execution.getActivity();
    boolean isInterrupting = (Boolean) timerActivity.getProperty("isInterrupting");
    List<ActivityExecution> recyclableExecutions;
    if (isInterrupting) {
        recyclableExecutions = removeAllExecutions(execution);
    } else {
        recyclableExecutions = Collections.EMPTY_LIST;
    }
    execution.takeAll(timerActivity.getOutgoingTransitions(), recyclableExecutions);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:13,代码来源:EmbeddedSubProcess.java

示例7: execute

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
public void execute(ActivityExecution execution) throws Exception {
  PvmActivity activity = execution.getActivity();
  ActivityImpl initialActivity = (ActivityImpl) activity.getProperty(BpmnParse.PROPERTYNAME_INITIAL);
  
  if (initialActivity == null) {
    throw new ActivitiException("No initial activity found for subprocess " 
            + execution.getActivity().getId());
  }
  
  execution.executeActivity(initialActivity);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:SubProcessActivityBehavior.java

示例8: timerFires

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void timerFires(ActivityExecution execution, String signalName, Object signalData) throws Exception {
  PvmActivity timerActivity = execution.getActivity();
  boolean isInterrupting = (Boolean) timerActivity.getProperty("isInterrupting");
  List<ActivityExecution> recyclableExecutions = null;
  if (isInterrupting) {
    recyclableExecutions = removeAllExecutions(execution);
  } else {
    recyclableExecutions = Collections.EMPTY_LIST;
  }
  execution.takeAll(timerActivity.getOutgoingTransitions(), recyclableExecutions);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:13,代码来源:EmbeddedSubProcess.java

示例9: getActivityPreTasks

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private static void getActivityPreTasks(List<PvmTransition> pvmTransitionList, List<String> preTaskList, String myId) {
    for(PvmTransition pvmTransition:pvmTransitionList) {
        PvmActivity pvmActivity = pvmTransition.getSource();
        String actType = (String)pvmActivity.getProperty("type");
        if(actType.endsWith("Task")) {
            //userTask, seriviceTask, ...
            if(!pvmActivity.getId().equals(myId)) {
                preTaskList.add(pvmActivity.getId());
            }
        } else if(actType.endsWith("Gateway")) {
            //gateway
            getActivityPreTasks(pvmActivity.getIncomingTransitions(), preTaskList, myId);
        }
    }
}
 
开发者ID:YuhangGe,项目名称:activiti-spring-hibernate,代码行数:16,代码来源:RhoEventLogger.java

示例10: addEachOutPair

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private void addEachOutPair(List<String[]> pariList, PvmActivity act1, PvmActivity act2) {
        String type1 = (String) act1.getProperty("type");
        String type2 = (String) act2.getProperty("type");
        List<String> sarr1 = new ArrayList<>();
        List<String> sarr2 = new ArrayList<>();
        if (type1.endsWith("Task")) {
            sarr1.add((String) act1.getProperty("name"));
        } else if (type1.equals("exclusiveGateway")) {
            addEGTasks(sarr1, act1.getOutgoingTransitions());
        }
        if (type2.endsWith("Task")) {
            sarr2.add((String) act2.getProperty("name"));
        } else if (type2.equals("exclusiveGateway")) {
            addEGTasks(sarr2, act2.getOutgoingTransitions());
        }

        int s1 = sarr1.size();
        int s2 = sarr2.size();
        for (int i = 0; i < s1; i++) {
            for (int j = 0; j < s2; j++) {
//                String id1 = sarr1.get(i);
//                String id2 = sarr2.get(j);
//                if(id1.compareTo(id2) > 0) {
//                    pariList.add(new String[]{id2, id1});
//                } else {
//                    pariList.add(new String[] {id1, id2});
//                }
                pariList.add(new String[]{sarr1.get(i), sarr2.get(j)});
            }
        }
    }
 
开发者ID:YuhangGe,项目名称:activiti-spring-hibernate,代码行数:32,代码来源:RhoAutoRunner.java

示例11: addEGTasks

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private void addEGTasks(List<String> sarr, List<PvmTransition> outs) {
    for (PvmTransition out : outs) {
        PvmActivity act = out.getDestination();
        String type = (String) act.getProperty("type");
        if (type.endsWith("Task")) {
            sarr.add((String) act.getProperty("name"));
        } else {
            System.err.println("RhoAutoRunner: addEGTasks meet wrong type of exclusive gateway, ignored.");
        }
    }
}
 
开发者ID:YuhangGe,项目名称:activiti-spring-hibernate,代码行数:12,代码来源:RhoAutoRunner.java

示例12: isMultiInstance

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
/**
 * 判断是否会签.
 */
public boolean isMultiInstance(PvmActivity pvmActivity) {
    return pvmActivity.getProperty("multiInstance") != null;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:7,代码来源:RollbackTaskCmd.java

示例13: dealParallelGateway

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private void dealParallelGateway(ActivityImpl ai) throws Exception {
    List<PvmTransition> incomingTransitions = ai.getIncomingTransitions();
    List<PvmTransition> outgoingTransitions = ai.getOutgoingTransitions();
    /*
     * 不支持多进多出的并发gateway。
     * 如果是多进一出,说明是并发的结束,直接返回。
     * 如果是一进多出,说明是并发的开始,需要处理。
     */
    int is = incomingTransitions.size();
    int os = outgoingTransitions.size();
    if (is <= 0 || os <= 0) {
        return;
    } else if (is > 1 && os > 1) {
        throw new Exception("RhoAutoRunner: do not support such kind of parallel gateway");
    } else if (os == 1) {
        return;
    }

    PvmActivity curAct = incomingTransitions.get(0).getSource();
    String type = (String) curAct.getProperty("type");
    List<String> curTaskList = new ArrayList<>();

    if (type.endsWith("Task")) {
        curTaskList.add((String) curAct.getProperty("name"));
    } else if (type.equals("exclusiveGateway")) {
        List<PvmTransition> ins = curAct.getIncomingTransitions();
        for (PvmTransition pi : ins) {
            PvmActivity pt = pi.getSource();
            String ptype = (String) pt.getProperty("type");
            if (ptype.endsWith("Task")) {
                curTaskList.add((String) pt.getProperty("name"));
            } else {
                throw new Exception("RhoAutoRunner: do not support such kind of parallel gateway");
            }
        }
    } else {
        throw new Exception("RhoAutoRunner: do not support such kind of parallel gateway, with zero pre tasks");
    }
    ParallelE pairList = new ParallelE();
    for (String curTaskName : curTaskList) {
        parallelCache.put(curTaskName, pairList);
    }


    List<PvmActivity> outActList = new ArrayList<>();
    for (PvmTransition outTransition : outgoingTransitions) {
        outActList.add(outTransition.getDestination());
    }

    addOutPair(pairList.list, outActList, 0);

}
 
开发者ID:YuhangGe,项目名称:activiti-spring-hibernate,代码行数:53,代码来源:RhoAutoRunner.java


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