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


Java ActivityImpl.getId方法代码示例

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


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

示例1: traceProcess

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
/**
 * 流程跟踪图
 *
 * @param processInstanceId 流程实例ID
 * @return 封装了各种节点信息
 */
public List<Map<String, Object>> traceProcess(String processInstanceId) throws Exception {
    Execution execution = runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();//执行实例
    Object property = PropertyUtils.getProperty(execution, "activityId");
    String activityId = "";
    if (property != null) {
        activityId = property.toString();
    }
    ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId)
            .singleResult();
    ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
            .getDeployedProcessDefinition(processInstance.getProcessDefinitionId());
    List<ActivityImpl> activitiList = processDefinition.getActivities();//获得当前任务的所有节点

    List<Map<String, Object>> activityInfos = new ArrayList<Map<String, Object>>();
    for (ActivityImpl activity : activitiList) {

        boolean currentActiviti = false;
        String id = activity.getId();

        // 当前节点
        if (id.equals(activityId)) {
            currentActiviti = true;
        }

        Map<String, Object> activityImageInfo = packageSingleActivitiInfo(activity, processInstance, currentActiviti);

        activityInfos.add(activityImageInfo);
    }

    return activityInfos;
}
 
开发者ID:batizhao,项目名称:microservice,代码行数:38,代码来源:WorkflowTraceService.java

示例2: traceProcess

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
/**
 * 流程跟踪图信息
 * @param processInstanceId		流程实例ID
 * @return	封装了各种节点信息
 */
public List<Map<String, Object>> traceProcess(String processInstanceId) throws Exception {
	Execution execution = runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();//执行实例
	Object property = PropertyUtils.getProperty(execution, "activityId");
	String activityId = "";
	if (property != null) {
		activityId = property.toString();
	}
	ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId)
			.singleResult();
	ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
			.getDeployedProcessDefinition(processInstance.getProcessDefinitionId());
	List<ActivityImpl> activitiList = processDefinition.getActivities();//获得当前任务的所有节点

	List<Map<String, Object>> activityInfos = new ArrayList<Map<String, Object>>();
	for (ActivityImpl activity : activitiList) {

		boolean currentActiviti = false;
		String id = activity.getId();

		// 当前节点
		if (id.equals(activityId)) {
			currentActiviti = true;
		}

		Map<String, Object> activityImageInfo = packageSingleActivitiInfo(activity, processInstance, currentActiviti);

		activityInfos.add(activityImageInfo);
	}

	return activityInfos;
}
 
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:37,代码来源:ActTaskService.java

示例3: execute

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
public void execute(InterpretableExecution execution) {
    ActivityImpl activity = (ActivityImpl) execution.getActivity();

    ActivityBehavior activityBehavior = activity.getActivityBehavior();
    if (activityBehavior == null) {
        throw new PvmException("no behavior specified in " + activity);
    }

    LOGGER.debug("{} executes {}: {}", execution, activity, activityBehavior.getClass().getName());

    try {
        if (Context.getProcessEngineConfiguration() != null && Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
            Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createActivityEvent(FlowableEngineEventType.ACTIVITY_STARTED,
                            execution.getActivity().getId(),
                            (String) execution.getActivity().getProperty("name"),
                            execution.getId(),
                            execution.getProcessInstanceId(),
                            execution.getProcessDefinitionId(),
                            (String) activity.getProperties().get("type"),
                            activity.getActivityBehavior().getClass().getCanonicalName()));
        }

        activityBehavior.execute(execution);

    } catch (ActivitiException e) {
        throw e;
    } catch (Throwable t) {
        LogMDC.putMDCExecution(execution);
        throw new ActivitiActivityExecutionException("couldn't execute activity <" + activity.getProperty("type") + " id=\"" + activity.getId() + "\" ...>: " + t.getMessage(), t);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:34,代码来源:AtomicOperationActivityExecute.java

示例4: setActivity

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
public void setActivity(ActivityImpl activity) {
    this.activity = activity;
    if (activity != null) {
        this.activityId = activity.getId();
        this.activityName = (String) activity.getProperty("name");
    } else {
        this.activityId = null;
        this.activityName = null;
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:12,代码来源:ExecutionEntity.java

示例5: createErrorStartEventDefinition

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
protected void createErrorStartEventDefinition(ErrorEventDefinition errorEventDefinition, ActivityImpl startEventActivity, ScopeImpl scope) {
    org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition definition = new org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition(startEventActivity.getId());
    if (StringUtils.isNotEmpty(errorEventDefinition.getErrorCode())) {
        definition.setErrorCode(errorEventDefinition.getErrorCode());
    }
    definition.setPrecedence(10);
    addErrorEventDefinition(definition, scope);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:ErrorEventDefinitionParseHandler.java

示例6: setActivity

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
public void setActivity(ActivityImpl activity) {
    this.activity = activity;
    if (activity != null) {
        this.activityId = activity.getId();
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:7,代码来源:EventSubscriptionEntity.java

示例7: createBoundaryEventActivityBehavior

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
public BoundaryEventActivityBehavior createBoundaryEventActivityBehavior(BoundaryEvent boundaryEvent, boolean interrupting, ActivityImpl activity) {
    return new BoundaryEventActivityBehavior(interrupting, activity.getId());
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:5,代码来源:DefaultActivityBehaviorFactory.java

示例8: createBoundaryErrorEventDefinition

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
public void createBoundaryErrorEventDefinition(ErrorEventDefinition errorEventDefinition, boolean interrupting,
                                               ActivityImpl activity, ActivityImpl nestedErrorEventActivity) {

    nestedErrorEventActivity.setProperty("type", "boundaryError");
    ScopeImpl catchingScope = nestedErrorEventActivity.getParent();
    ((ActivityImpl) catchingScope).setScope(true);

    org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition definition = new org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition(nestedErrorEventActivity.getId());
    definition.setErrorCode(errorEventDefinition.getErrorCode());

    addErrorEventDefinition(definition, catchingScope);

}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:14,代码来源:ErrorEventDefinitionParseHandler.java


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