• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java HistoricActivityInstanceQuery类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.activiti.engine.history.HistoricActivityInstanceQuery的典型用法代码示例。如果您正苦于以下问题:Java HistoricActivityInstanceQuery类的具体用法?Java HistoricActivityInstanceQuery怎么用?Java HistoricActivityInstanceQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HistoricActivityInstanceQuery类属于org.activiti.engine.history包,在下文中一共展示了HistoricActivityInstanceQuery类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testGetHistoricActivityInstancesByProcessInstanceId

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的package包/类
@Test
public void testGetHistoricActivityInstancesByProcessInstanceId()
{
    String processInstanceId = "processInstanceId";
    HistoricActivityInstanceQuery historicActivityInstanceQuery = mock(HistoricActivityInstanceQuery.class);
    when(activitiHistoryService.createHistoricActivityInstanceQuery()).thenReturn(historicActivityInstanceQuery);
    when(historicActivityInstanceQuery.processInstanceId(processInstanceId)).thenReturn(historicActivityInstanceQuery);
    when(historicActivityInstanceQuery.orderByHistoricActivityInstanceStartTime()).thenReturn(historicActivityInstanceQuery);
    when(historicActivityInstanceQuery.asc()).thenReturn(historicActivityInstanceQuery);
    when(historicActivityInstanceQuery.orderByHistoricActivityInstanceEndTime()).thenReturn(historicActivityInstanceQuery);
    when(historicActivityInstanceQuery.asc()).thenReturn(historicActivityInstanceQuery);
    List<HistoricActivityInstance> expectedHistoricActivityInstances = new ArrayList<>();
    when(historicActivityInstanceQuery.list()).thenReturn(expectedHistoricActivityInstances);
    List<HistoricActivityInstance> actualHistoricActivityInstances = activitiService.getHistoricActivityInstancesByProcessInstanceId(processInstanceId);
    assertSame(expectedHistoricActivityInstances, actualHistoricActivityInstances);
    InOrder inOrder = inOrder(historicActivityInstanceQuery);
    inOrder.verify(historicActivityInstanceQuery).processInstanceId(processInstanceId);
    inOrder.verify(historicActivityInstanceQuery).orderByHistoricActivityInstanceStartTime();
    inOrder.verify(historicActivityInstanceQuery).asc();
    inOrder.verify(historicActivityInstanceQuery).orderByHistoricActivityInstanceEndTime();
    inOrder.verify(historicActivityInstanceQuery).asc();
    inOrder.verify(historicActivityInstanceQuery).list();
    inOrder.verifyNoMoreInteractions();
}
 
开发者ID:FINRAOS,项目名称:herd,代码行数:25,代码来源:ActivitiServiceTest.java


示例2: createHistoricActivityInstanceQuery

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的package包/类
@Override
public HistoricActivityInstanceQuery createHistoricActivityInstanceQuery() {
    return new HistoricActivityInstanceQueryImpl(commandExecutor);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:5,代码来源:HistoryServiceImpl.java


示例3: getActivities

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的package包/类
@Override
public CollectionWithPagingInfo<Activity> getActivities(String processId, Parameters parameters)
{
    Paging paging = parameters.getPaging();
    String status = parameters.getParameter("status");
    
    validateIfUserAllowedToWorkWithProcess(processId);

    HistoricActivityInstanceQuery query = activitiProcessEngine
            .getHistoryService()
            .createHistoricActivityInstanceQuery();
    
    if (STATUS_ACTIVE.equals(status)) query.unfinished();
    else if (STATUS_COMPLETED.equals(status)) query.finished();
    
    query.processInstanceId(processId);
    
    query.orderByExecutionId().asc();
    
    List<HistoricActivityInstance> activities = query.listPage(paging.getSkipCount(), paging.getMaxItems());

    List<Activity> page = new ArrayList<Activity>(activities.size());
    for (HistoricActivityInstance activityInstance: activities) 
    {
        Activity activity = new Activity(activityInstance);
        page.add(activity);
    }
    
    return CollectionWithPagingInfo.asPaged(paging, page, false, page.size());
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:31,代码来源:ActivitiesImpl.java


示例4: createHistoricActivityInstanceQuery

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的package包/类
/** Creates a new programmatic query to search for {@link HistoricActivityInstance}s. */
HistoricActivityInstanceQuery createHistoricActivityInstanceQuery();
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:3,代码来源:HistoryService.java


示例5: orderByActivityId

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的package包/类
@Override
public HistoricActivityInstanceQuery orderByActivityId() {
    orderBy(HistoricActivityInstanceQueryProperty.ACTIVITY_ID);
    return this;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:6,代码来源:HistoricActivityInstanceQueryImpl.java


示例6: createHistoricActivityInstanceQuery

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的package包/类
public HistoricActivityInstanceQuery createHistoricActivityInstanceQuery() {
  return new HistoricActivityInstanceQueryImpl(commandExecutor);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:HistoryServiceImpl.java


示例7: orderByActivityId

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的package包/类
public HistoricActivityInstanceQuery orderByActivityId() {
  orderBy(HistoricActivityInstanceQueryProperty.ACTIVITY_ID);
  return this;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:5,代码来源:HistoricActivityInstanceQueryImpl.java


示例8: publishServiceTaskEvent

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的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.");
            }
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:46,代码来源:BPMNDataPublisher.java


示例9: getQueryResponse

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的package包/类
protected DataResponse getQueryResponse(HistoricActivityInstanceQueryRequest queryRequest, Map<String,String>
        allRequestParams, UriInfo uriInfo) {
    HistoryService historyService = BPMNOSGIService.getHistoryService();
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();

    // Populate query based on request
    if (queryRequest.getActivityId() != null) {
        query.activityId(queryRequest.getActivityId());
    }

    if (queryRequest.getActivityInstanceId() != null) {
        query.activityInstanceId(queryRequest.getActivityInstanceId());
    }

    if (queryRequest.getActivityName() != null) {
        query.activityName(queryRequest.getActivityName());
    }

    if (queryRequest.getActivityType() != null) {
        query.activityType(queryRequest.getActivityType());
    }

    if (queryRequest.getExecutionId() != null) {
        query.executionId(queryRequest.getExecutionId());
    }

    if (queryRequest.getFinished() != null) {
        Boolean finished = queryRequest.getFinished();
        if (finished) {
            query.finished();
        } else {
            query.unfinished();
        }
    }

    if (queryRequest.getTaskAssignee() != null) {
        query.taskAssignee(queryRequest.getTaskAssignee());
    }

    if (queryRequest.getProcessInstanceId() != null) {
        query.processInstanceId(queryRequest.getProcessInstanceId());
    }

    if (queryRequest.getProcessDefinitionId() != null) {
        query.processDefinitionId(queryRequest.getProcessDefinitionId());
    }

    if(queryRequest.getTenantId() != null) {
        query.activityTenantId(queryRequest.getTenantId());
    }

    if(queryRequest.getTenantIdLike() != null) {
        query.activityTenantIdLike(queryRequest.getTenantIdLike());
    }

    if(Boolean.TRUE.equals(queryRequest.getWithoutTenantId())) {
        query.activityWithoutTenantId();
    }

    return new HistoricActivityInstancePaginateList(new RestResponseFactory(), uriInfo).paginateList(
            allRequestParams, queryRequest, query, "startTime", allowedSortProperties);
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:63,代码来源:BaseHistoricActivitiInstanceService.java


示例10: getQueryResponse

import org.activiti.engine.history.HistoricActivityInstanceQuery; //导入依赖的package包/类
protected DataResponse getQueryResponse(HistoricActivityInstanceQueryRequest queryRequest, Map<String,String>
     allRequestParams) {
    HistoryService historyService = BPMNOSGIService.getHistoryService();
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();

    // Populate query based on request
    if (queryRequest.getActivityId() != null) {
        query.activityId(queryRequest.getActivityId());
    }

    if (queryRequest.getActivityInstanceId() != null) {
        query.activityInstanceId(queryRequest.getActivityInstanceId());
    }

    if (queryRequest.getActivityName() != null) {
        query.activityName(queryRequest.getActivityName());
    }

    if (queryRequest.getActivityType() != null) {
        query.activityType(queryRequest.getActivityType());
    }

    if (queryRequest.getExecutionId() != null) {
        query.executionId(queryRequest.getExecutionId());
    }

    if (queryRequest.getFinished() != null) {
        Boolean finished = queryRequest.getFinished();
        if (finished) {
            query.finished();
        } else {
            query.unfinished();
        }
    }

    if (queryRequest.getTaskAssignee() != null) {
        query.taskAssignee(queryRequest.getTaskAssignee());
    }

    if (queryRequest.getProcessInstanceId() != null) {
        query.processInstanceId(queryRequest.getProcessInstanceId());
    }

    if (queryRequest.getProcessDefinitionId() != null) {
        query.processDefinitionId(queryRequest.getProcessDefinitionId());
    }

    if(queryRequest.getTenantId() != null) {
        query.activityTenantId(queryRequest.getTenantId());
    }

    if(queryRequest.getTenantIdLike() != null) {
        query.activityTenantIdLike(queryRequest.getTenantIdLike());
    }

    if(Boolean.TRUE.equals(queryRequest.getWithoutTenantId())) {
        query.activityWithoutTenantId();
    }

    RestResponseFactory restResponseFactory = new RestResponseFactory();

    return new HistoricActivityInstancePaginateList(restResponseFactory, uriInfo).paginateList(
            allRequestParams, queryRequest, query, "startTime", allowedSortProperties);
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:65,代码来源:BaseHistoricTaskInstanceService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Logman类代码示例发布时间:2022-05-22
下一篇:
Java EfficientStreamingTransformer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap