本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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();
}
}
示例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());
}
示例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);
}