本文整理汇总了Java中org.activiti.engine.history.HistoricActivityInstance.getActivityId方法的典型用法代码示例。如果您正苦于以下问题:Java HistoricActivityInstance.getActivityId方法的具体用法?Java HistoricActivityInstance.getActivityId怎么用?Java HistoricActivityInstance.getActivityId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.history.HistoricActivityInstance
的用法示例。
在下文中一共展示了HistoricActivityInstance.getActivityId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Activity
import org.activiti.engine.history.HistoricActivityInstance; //导入方法依赖的package包/类
public Activity(HistoricActivityInstance activity) {
this.id = activity.getId();
this.activityDefinitionId = activity.getActivityId();
this.activityDefinitionName = activity.getActivityName();
this.activityDefinitionType = activity.getActivityType();
this.startedAt = activity.getStartTime();
this.endedAt = activity.getEndTime();
this.durationInMs = activity.getDurationInMillis();
}
示例2: publishServiceTaskEvent
import org.activiti.engine.history.HistoricActivityInstance; //导入方法依赖的package包/类
/**
* @param activityInstanceQuery
*/
public void publishServiceTaskEvent(HistoricActivityInstanceQuery activityInstanceQuery) {
if (log.isDebugEnabled()) {
log.debug("Start to Publish BPMN service task instance event... ");
}
List<HistoricActivityInstance> historicActivityInstances = activityInstanceQuery.list();
for (HistoricActivityInstance instance : historicActivityInstances) {
if (instance.getActivityType().equals(AnalyticsPublisherConstants.SERVICE_TASK)) {
Object[] payload = new Object[]{
//Service task definition Id
instance.getActivityId(),
//task instance Id
instance.getId(),
//process definition id
instance.getProcessDefinitionId(),
//process instance Id
instance.getProcessInstanceId(),
//task created time
instance.getStartTime().toString(),
//task started time
instance.getStartTime().toString(),
//task end time
instance.getEndTime().toString(),
//task duration
instance.getDurationInMillis(),
//task assignee - NA as this is a service task
"NA"
};
if (dataPublisher != null) {
dataPublisher.tryPublish(getServiceTaskInstanceStreamId(), getMeta(), null, payload);
if (log.isDebugEnabled()) {
log.debug("Published BPMN service task instance event... Service task definition Id:" + instance
.getActivityId() + ", task instance Id:" + instance.getId() + ", process definition "
+ "id:" + instance.getProcessDefinitionId() + ", process instance Id:" + instance
.getProcessInstanceId());
}
} else {
log.error("Data publisher is not registered. Events will not be published.");
}
}
}
}