本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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)});
}
}
}
示例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.");
}
}
}
示例12: isMultiInstance
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
/**
* 判断是否会签.
*/
public boolean isMultiInstance(PvmActivity pvmActivity) {
return pvmActivity.getProperty("multiInstance") != null;
}
示例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);
}