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


Java UserTaskActivityBehavior类代码示例

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


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

示例1: getFormKey

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
private String getFormKey(PvmActivity act)
{
    if(act instanceof ActivityImpl) 
    {
        ActivityImpl actImpl = (ActivityImpl) act;
        if (actImpl.getActivityBehavior() instanceof UserTaskActivityBehavior)        
        {
            UserTaskActivityBehavior uta = (UserTaskActivityBehavior) actImpl.getActivityBehavior();
            TaskFormHandler handler = uta.getTaskDefinition().getTaskFormHandler();
            if(handler != null && handler instanceof DefaultTaskFormHandler)
            {
                // We cast to DefaultTaskFormHandler since we do not configure our own
                return ((DefaultTaskFormHandler)handler).getFormKey().getExpressionText();
            }
            
        }
    }
    return null;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:ActivitiWorkflowEngine.java

示例2: executeParse

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
protected void executeParse(BpmnParse bpmnParse, UserTask userTask)
{
    ActivityImpl activity = findActivity(bpmnParse, userTask.getId());
    ActivityBehavior activitybehaviour = activity.getActivityBehavior();
    if (activitybehaviour instanceof UserTaskActivityBehavior)
    {
        addListeners((UserTaskActivityBehavior) activity.getActivityBehavior());
    } 
    else if(activitybehaviour instanceof MultiInstanceActivityBehavior) 
    {
        MultiInstanceActivityBehavior multiInstance = (MultiInstanceActivityBehavior) activitybehaviour;
        if(multiInstance.getInnerActivityBehavior() instanceof UserTaskActivityBehavior) 
        {
            addListeners((UserTaskActivityBehavior) multiInstance.getInnerActivityBehavior());
        }
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:18,代码来源:AlfrescoUserTaskBpmnParseHandler.java

示例3: getFormKey

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
public String getFormKey(PvmActivity act, ReadOnlyProcessDefinition processDefinition)
{
    if(act instanceof ActivityImpl) 
    {
        ActivityImpl actImpl = (ActivityImpl) act;
        if (actImpl.getActivityBehavior() instanceof UserTaskActivityBehavior)        
        {
        	UserTaskActivityBehavior uta = (UserTaskActivityBehavior) actImpl.getActivityBehavior();
            return getFormKey(uta.getTaskDefinition());
        }
        else if(actImpl.getActivityBehavior() instanceof MultiInstanceActivityBehavior) 
        {
        	// Get the task-definition from the process-definition
        	if(processDefinition instanceof ProcessDefinitionEntity)
        	{
        		// Task definition id is the same the the activity id
        		TaskDefinition taskDef = ((ProcessDefinitionEntity) processDefinition).getTaskDefinitions().get(act.getId());
        		if(taskDef != null)
        		{
        			return getFormKey(taskDef);
        		}
        	}
        }
    }
    return null;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:ActivitiTypeConverter.java

示例4: packageSingleActivitiInfo

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
/**
 * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述
 * @param activity
 * @param processInstance
 * @param currentActiviti
 * @return
 */
private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, ProcessInstance processInstance,
		boolean currentActiviti) throws Exception {
	Map<String, Object> vars = new HashMap<String, Object>();
	Map<String, Object> activityInfo = new HashMap<String, Object>();
	activityInfo.put("currentActiviti", currentActiviti);
	setPosition(activity, activityInfo);
	setWidthAndHeight(activity, activityInfo);

	Map<String, Object> properties = activity.getProperties();
	vars.put("节点名称", properties.get("name"));
	vars.put("任务类型", ActUtils.parseToZhType(properties.get("type").toString()));

	ActivityBehavior activityBehavior = activity.getActivityBehavior();
	logger.debug("activityBehavior={}", activityBehavior);
	if (activityBehavior instanceof UserTaskActivityBehavior) {

		Task currentTask = null;

		// 当前节点的task
		if (currentActiviti) {
			currentTask = getCurrentTaskInfo(processInstance);
		}

		// 当前任务的分配角色
		UserTaskActivityBehavior userTaskActivityBehavior = (UserTaskActivityBehavior) activityBehavior;
		TaskDefinition taskDefinition = userTaskActivityBehavior.getTaskDefinition();
		Set<Expression> candidateGroupIdExpressions = taskDefinition.getCandidateGroupIdExpressions();
		if (!candidateGroupIdExpressions.isEmpty()) {

			// 任务的处理角色
			setTaskGroup(vars, candidateGroupIdExpressions);

			// 当前处理人
			if (currentTask != null) {
				setCurrentTaskAssignee(vars, currentTask);
			}
		}
	}

	vars.put("节点说明", properties.get("documentation"));

	String description = activity.getProcessDefinition().getDescription();
	vars.put("描述", description);

	logger.debug("trace variables: {}", vars);
	activityInfo.put("vars", vars);
	return activityInfo;
}
 
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:56,代码来源:ActTaskService.java

示例5: deleteTasksByProcessInstanceId

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
public void deleteTasksByProcessInstanceId(String processInstanceId, String deleteReason, boolean cascade) {
    List<TaskEntity> tasks = (List) getDbSqlSession()
            .createTaskQuery()
            .processInstanceId(processInstanceId)
            .list();

    String reason = (deleteReason == null || deleteReason.length() == 0) ? TaskEntity.DELETE_REASON_DELETED : deleteReason;

    CommandContext commandContext = Context.getCommandContext();

    for (TaskEntity task : tasks) {
        if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
            commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createActivityCancelledEvent(
                            task.getExecution().getActivityId(),
                            task.getName(),
                            task.getExecutionId(),
                            task.getProcessInstanceId(),
                            task.getProcessDefinitionId(),
                            "userTask", UserTaskActivityBehavior.class.getName(), deleteReason));
        }

        deleteTask(task, reason, cascade);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:27,代码来源:TaskEntityManager.java

示例6: parseUserTask

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
/**
 * Parses a userTask declaration.
 */
public ActivityImpl parseUserTask(Element userTaskElement, ScopeImpl scope) {
  ActivityImpl activity = createActivityOnScope(userTaskElement, scope);
  
  String async = userTaskElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "async");
  activity.setAsync("true".equals(async));    
  
  TaskDefinition taskDefinition = parseTaskDefinition(userTaskElement, activity.getId(), (ProcessDefinitionEntity) scope.getProcessDefinition());

  UserTaskActivityBehavior userTaskActivity = new UserTaskActivityBehavior(expressionManager, taskDefinition);
  activity.setActivityBehavior(userTaskActivity);

  parseProperties(userTaskElement, activity);
  parseExecutionListenersOnScope(userTaskElement, activity);

  for (BpmnParseListener parseListener : parseListeners) {
    parseListener.parseUserTask(userTaskElement, scope, activity);
  }
  return activity;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:23,代码来源:BpmnParse.java

示例7: parseUserTask

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
/**
 * Parses a userTask declaration.
 */
public ActivityImpl parseUserTask(Element userTaskElement, ScopeImpl scope) {
  ActivityImpl activity = createActivityOnScope(userTaskElement, scope);
  
  activity.setAsync(isAsync(userTaskElement));
  activity.setExclusive(isExclusive(userTaskElement)); 
  
  TaskDefinition taskDefinition = parseTaskDefinition(userTaskElement, activity.getId(), (ProcessDefinitionEntity) scope.getProcessDefinition());

  UserTaskActivityBehavior userTaskActivity = new UserTaskActivityBehavior(expressionManager, taskDefinition);
  activity.setActivityBehavior(userTaskActivity);

  parseProperties(userTaskElement, activity);
  parseExecutionListenersOnScope(userTaskElement, activity);

  for (BpmnParseListener parseListener : parseListeners) {
    parseListener.parseUserTask(userTaskElement, scope, activity);
  }
  return activity;
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:23,代码来源:BpmnParse.java

示例8: addListeners

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
protected void addListeners(UserTaskActivityBehavior activityBehavior) 
{
    if (createTaskListener != null)
    {
        addTaskListenerAsFirst(createTaskListener, TaskListener.EVENTNAME_CREATE, activityBehavior);
    }
    if (completeTaskListener != null)
    {
        addTaskListenerAsFirst(completeTaskListener, TaskListener.EVENTNAME_COMPLETE, activityBehavior);
    }
    if(notificationTaskListener != null)
    {
        addTaskListenerAsLast(notificationTaskListener, TaskListener.EVENTNAME_CREATE, activityBehavior);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:16,代码来源:AlfrescoUserTaskBpmnParseHandler.java

示例9: getOrCreateListenerList

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
protected List<TaskListener> getOrCreateListenerList(String eventName, UserTaskActivityBehavior userTask) 
{
    List<TaskListener> taskEventListeners = userTask.getTaskDefinition().getTaskListeners().get(eventName);
    if (taskEventListeners == null) {
      taskEventListeners = new ArrayList<TaskListener>();
      userTask.getTaskDefinition().getTaskListeners().put(eventName, taskEventListeners);
    }
    return taskEventListeners;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:AlfrescoUserTaskBpmnParseHandler.java

示例10: packageSingleActivitiInfo

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
/**
  * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述
  *
  * @param activity
  * @param processInstance
  * @param currentActiviti
  * @return
  */
 private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, ProcessInstance processInstance,
                                                       boolean currentActiviti) throws Exception {
     Map<String, Object> vars = new HashMap<String, Object>();
     Map<String, Object> activityInfo = new HashMap<String, Object>();
     activityInfo.put("currentActiviti", currentActiviti);
     setPosition(activity, activityInfo);
     setWidthAndHeight(activity, activityInfo);

     Map<String, Object> properties = activity.getProperties();
     vars.put("任务类型", WorkflowUtils.parseToZhType(properties.get("type").toString()));

     ActivityBehavior activityBehavior = activity.getActivityBehavior();
     logger.debug("activityBehavior={}", activityBehavior);
     if (activityBehavior instanceof UserTaskActivityBehavior) {

         Task currentTask = null;

/*
          * 当前节点的task
 */
         if (currentActiviti) {
             currentTask = getCurrentTaskInfo(processInstance);
         }

/*
 * 当前任务的分配角色
 */
         UserTaskActivityBehavior userTaskActivityBehavior = (UserTaskActivityBehavior) activityBehavior;
         TaskDefinition taskDefinition = userTaskActivityBehavior.getTaskDefinition();
         Set<Expression> candidateGroupIdExpressions = taskDefinition.getCandidateGroupIdExpressions();
         if (!candidateGroupIdExpressions.isEmpty()) {

             // 任务的处理角色
             setTaskGroup(vars, candidateGroupIdExpressions);

             // 当前处理人
             if (currentTask != null) {
                 setCurrentTaskAssignee(vars, currentTask);
             }
         }
     }

     vars.put("节点说明", properties.get("documentation"));

     String description = activity.getProcessDefinition().getDescription();
     vars.put("描述", description);

     logger.debug("trace variables: {}", vars);
     activityInfo.put("vars", vars);
     return activityInfo;
 }
 
开发者ID:batizhao,项目名称:microservice,代码行数:60,代码来源:WorkflowTraceService.java

示例11: getTaskDefinition

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
@Override
public List<TaskDefinition> getTaskDefinition(ActivityImpl activityImpl, String elString) {
    List<TaskDefinition> taskDefinitionList = new ArrayList<>();
    List<TaskDefinition> nextTaskDefinition;
    if ("userTask".equals(activityImpl.getProperty("type"))) {
        TaskDefinition taskDefinition = ((UserTaskActivityBehavior) activityImpl.getActivityBehavior()).getTaskDefinition();
        taskDefinitionList.add(taskDefinition);
    } else {
        List<PvmTransition> pvmTransitions = activityImpl.getOutgoingTransitions();
        List<PvmTransition> outTransitionsTemp;
        for (PvmTransition tr : pvmTransitions) {
            PvmActivity pvmActivity = tr.getDestination(); //获取线路的终点节点
            if ("exclusiveGateway".equals(pvmActivity.getProperty("type")) || "parallelGateway".equals(pvmActivity.getProperty("type"))) {
                outTransitionsTemp = pvmActivity.getOutgoingTransitions();
                if (outTransitionsTemp.size() == 1) {
                    nextTaskDefinition = getTaskDefinition((ActivityImpl) outTransitionsTemp.get(0).getDestination(), elString);
                    taskDefinitionList.addAll(nextTaskDefinition);
                } else if (outTransitionsTemp.size() > 1) {
                    for (PvmTransition tr1 : outTransitionsTemp) {
                        Object s = tr1.getProperty("conditionText");
                        if (elString.equals(s.toString().trim())) {
                            nextTaskDefinition = getTaskDefinition((ActivityImpl) tr1.getDestination(), elString);
                            taskDefinitionList.addAll(nextTaskDefinition);
                        }
                    }
                }
            } else if ("userTask".equals(pvmActivity.getProperty("type"))) {
                taskDefinitionList.add(((UserTaskActivityBehavior) ((ActivityImpl) pvmActivity).getActivityBehavior()).getTaskDefinition());
            }
        }
    }
    return taskDefinitionList;
}
 
开发者ID:hs-web,项目名称:hsweb-framework,代码行数:34,代码来源:BpmActivityServiceImp.java

示例12: parseUserTask

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
public void parseUserTask(Element userTaskElement, ScopeImpl scope, ActivityImpl activity) {
  addActivityHandlers(activity);

  if (activityHistoryEnabled(scope, historyLevel)) {
    TaskDefinition taskDefinition = ((UserTaskActivityBehavior) activity.getActivityBehavior()).getTaskDefinition();
    taskDefinition.addTaskListener(TaskListener.EVENTNAME_ASSIGNMENT, USER_TASK_ASSIGNMENT_HANDLER);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:9,代码来源:HistoryParseListener.java

示例13: addTaskListenerAsFirst

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
protected void addTaskListenerAsFirst(TaskListener taskListener, String eventName, UserTaskActivityBehavior userTask) 
{
    getOrCreateListenerList(eventName, userTask).add(0, taskListener);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:5,代码来源:AlfrescoUserTaskBpmnParseHandler.java

示例14: addTaskListenerAsLast

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
protected void addTaskListenerAsLast(TaskListener taskListener, String eventName, UserTaskActivityBehavior userTask) 
{
    getOrCreateListenerList(eventName, userTask).add(taskListener);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:5,代码来源:AlfrescoUserTaskBpmnParseHandler.java

示例15: createUserTaskActivityBehavior

import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; //导入依赖的package包/类
public UserTaskActivityBehavior createUserTaskActivityBehavior(
        UserTask userTask, TaskDefinition taskDefinition) {
    log.info("change usertask Behavior : {}  ", userTask);

    return new CustomUserTaskActivityBehavior(taskDefinition);
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:7,代码来源:CustomActivityBehaviorFactory.java


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