Java Code Examples for org.activiti.engine.impl.pvm.process.ActivityImpl#getProperties()

The following examples show how to use org.activiti.engine.impl.pvm.process.ActivityImpl#getProperties() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TraceProcessController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述
 *
 * @param activity
 * @param currentActiviti
 * @return
 */
private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, String executionId,
                                                      boolean currentActiviti) throws Exception {
    Map<String, Object> activityInfo = new HashMap<String, Object>();
    activityInfo.put("currentActiviti", currentActiviti);

    // 设置图形的XY坐标以及宽度、高度
    setSizeAndPositonInfo(activity, activityInfo);

    Map<String, Object> vars = new HashMap<String, Object>();
    Map<String, Object> properties = activity.getProperties();
    vars.put("任务类型", ActivityUtil.getZhActivityType(properties.get("type").toString()));
    vars.put("任务名称", properties.get("name"));

    // 当前节点的task
    if (currentActiviti) {
        setCurrentTaskInfo(executionId, activity.getId(), vars);
    }

    logger.debug("trace variables: {}", vars);
    activityInfo.put("vars", vars);
    return activityInfo;
}
 
Example 2
Source File: TraceProcessController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述
 *
 * @param activity
 * @param currentActiviti
 * @return
 */
private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, String executionId,
                                                      boolean currentActiviti) throws Exception {
    Map<String, Object> activityInfo = new HashMap<String, Object>();
    activityInfo.put("currentActiviti", currentActiviti);

    // 设置图形的XY坐标以及宽度、高度
    setSizeAndPositonInfo(activity, activityInfo);

    Map<String, Object> vars = new HashMap<String, Object>();
    Map<String, Object> properties = activity.getProperties();
    vars.put("任务类型", ActivityUtil.getZhActivityType(properties.get("type").toString()));
    vars.put("任务名称", properties.get("name"));

    // 当前节点的task
    if (currentActiviti) {
        setCurrentTaskInfo(executionId, activity.getId(), vars);
    }

    logger.debug("trace variables: {}", vars);
    activityInfo.put("vars", vars);
    return activityInfo;
}
 
Example 3
Source File: TraceProcessController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述
 *
 * @param activity
 * @param currentActiviti
 * @return
 */
private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, String executionId,
                                                      boolean currentActiviti) throws Exception {
    Map<String, Object> activityInfo = new HashMap<String, Object>();
    activityInfo.put("currentActiviti", currentActiviti);

    // 设置图形的XY坐标以及宽度、高度
    setSizeAndPositonInfo(activity, activityInfo);

    Map<String, Object> vars = new HashMap<String, Object>();
    Map<String, Object> properties = activity.getProperties();
    vars.put("任务类型", ActivityUtil.getZhActivityType(properties.get("type").toString()));
    vars.put("任务名称", properties.get("name"));

    // 当前节点的task
    if (currentActiviti) {
        setCurrentTaskInfo(executionId, activity.getId(), vars);
    }

    logger.debug("trace variables: {}", vars);
    activityInfo.put("vars", vars);
    return activityInfo;
}
 
Example 4
Source File: TraceProcessController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述
 *
 * @param activity
 * @param currentActiviti
 * @return
 */
private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, String executionId,
                                                      boolean currentActiviti) throws Exception {
    Map<String, Object> activityInfo = new HashMap<String, Object>();
    activityInfo.put("currentActiviti", currentActiviti);

    // 设置图形的XY坐标以及宽度、高度
    setSizeAndPositonInfo(activity, activityInfo);

    Map<String, Object> vars = new HashMap<String, Object>();
    Map<String, Object> properties = activity.getProperties();
    vars.put("任务类型", ActivityUtil.getZhActivityType(properties.get("type").toString()));
    vars.put("任务名称", properties.get("name"));

    // 当前节点的task
    if (currentActiviti) {
        setCurrentTaskInfo(executionId, activity.getId(), vars);
    }

    logger.debug("trace variables: {}", vars);
    activityInfo.put("vars", vars);
    return activityInfo;
}
 
Example 5
Source File: TraceProcessController.java    From activiti-in-action-codes with Apache License 2.0 6 votes vote down vote up
/**
 * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述
 *
 * @param activity
 * @param currentActiviti
 * @return
 */
private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, String executionId,
                                                      boolean currentActiviti) throws Exception {
    Map<String, Object> activityInfo = new HashMap<String, Object>();
    activityInfo.put("currentActiviti", currentActiviti);

    // 设置图形的XY坐标以及宽度、高度
    setSizeAndPositonInfo(activity, activityInfo);

    Map<String, Object> vars = new HashMap<String, Object>();
    Map<String, Object> properties = activity.getProperties();
    vars.put("任务类型", ActivityUtil.getZhActivityType(properties.get("type").toString()));
    vars.put("任务名称", properties.get("name"));

    // 当前节点的task
    if (currentActiviti) {
        setCurrentTaskInfo(executionId, activity.getId(), vars);
    }

    logger.debug("trace variables: {}", vars);
    activityInfo.put("vars", vars);
    return activityInfo;
}
 
Example 6
Source File: ActTaskService.java    From Shop-for-JavaWeb with MIT License 4 votes vote down vote up
/**
 * 封装输出信息,包括:当前节点的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;
}
 
Example 7
Source File: WorkflowTraceService.java    From maven-framework-project with MIT License 4 votes vote down vote up
/**
 * 封装输出信息,包括:当前节点的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;
}