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


Java ActivityImpl.getProperties方法代码示例

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


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

示例1: packageSingleActivitiInfo

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的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

示例2: loadXmlTest

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Test
public void loadXmlTest() throws Exception {

	ProcessEngineConfigurationImpl configuration = (ProcessEngineConfigurationImpl) processEngine
			.getProcessEngineConfiguration();
	Context.setProcessEngineConfiguration(configuration);

	InputStream inputStream = ReflectUtil.getResourceAsStream("extProperty.bpmn");

	BpmnParser bpmnParser = configuration.getBpmnParser();
	BpmnParse bpmnParse = new BpmnParse(bpmnParser).sourceInputStream(inputStream).setSourceSystemId("extProperty")
			.name("extProperty");

	bpmnParse.execute();

	ActivityImpl approveTask = bpmnParse.getCurrentScope().findActivity("approveTask");
	Map<String, Object> properties = approveTask.getProperties();

	for (String key : properties.keySet()) {
		System.out.println(properties.get(key));
	}

}
 
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:24,代码来源:ExtPropertyTest.java

示例3: packageSingleActivitiInfo

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的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


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