Search in sources :

Example 1 with HistoricIdentityLinkResponse

use of org.wso2.carbon.bpmn.rest.model.history.HistoricIdentityLinkResponse in project carbon-business-process by wso2.

the class HistoricProcessInstanceService method getProcessIdentityLinks.

@GET
@Path("/{processInstanceId}/identitylinks")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getProcessIdentityLinks(@PathParam("processInstanceId") String processInstanceId) {
    HistoryService historyService = BPMNOSGIService.getHistoryService();
    List<HistoricIdentityLink> identityLinks = historyService.getHistoricIdentityLinksForProcessInstance(processInstanceId);
    if (identityLinks != null) {
        List<HistoricIdentityLinkResponse> historicIdentityLinkResponses = new RestResponseFactory().createHistoricIdentityLinkResponseList(identityLinks, uriInfo.getBaseUri().toString());
        HistoricIdentityLinkResponseCollection historicIdentityLinkResponseCollection = new HistoricIdentityLinkResponseCollection();
        historicIdentityLinkResponseCollection.setHistoricIdentityLinkResponses(historicIdentityLinkResponses);
        return Response.ok().entity(historicIdentityLinkResponseCollection).build();
    }
    return Response.ok().build();
}
Also used : HistoricIdentityLinkResponse(org.wso2.carbon.bpmn.rest.model.history.HistoricIdentityLinkResponse) HistoricIdentityLink(org.activiti.engine.history.HistoricIdentityLink) RestResponseFactory(org.wso2.carbon.bpmn.rest.common.RestResponseFactory) HistoricIdentityLinkResponseCollection(org.wso2.carbon.bpmn.rest.model.history.HistoricIdentityLinkResponseCollection)

Example 2 with HistoricIdentityLinkResponse

use of org.wso2.carbon.bpmn.rest.model.history.HistoricIdentityLinkResponse in project carbon-business-process by wso2.

the class HistoricTaskInstanceService method getTaskIdentityLinks.

@GET
@Path("/{taskId}/identitylinks")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getTaskIdentityLinks(@PathParam("taskId") String taskId) {
    HistoryService historyService = BPMNOSGIService.getHistoryService();
    List<HistoricIdentityLink> identityLinks = historyService.getHistoricIdentityLinksForTask(taskId);
    List<HistoricIdentityLinkResponse> historicIdentityLinkResponseList = new ArrayList<>();
    if (identityLinks != null) {
        historicIdentityLinkResponseList = new RestResponseFactory().createHistoricIdentityLinkResponseList(identityLinks, uriInfo.getBaseUri().toString());
    }
    HistoricIdentityLinkResponseCollection historicIdentityLinkResponseCollection = new HistoricIdentityLinkResponseCollection();
    historicIdentityLinkResponseCollection.setHistoricIdentityLinkResponses(historicIdentityLinkResponseList);
    return Response.ok().entity(historicIdentityLinkResponseCollection).build();
}
Also used : HistoricIdentityLinkResponse(org.wso2.carbon.bpmn.rest.model.history.HistoricIdentityLinkResponse) HistoricIdentityLink(org.activiti.engine.history.HistoricIdentityLink) RestResponseFactory(org.wso2.carbon.bpmn.rest.common.RestResponseFactory) HistoricIdentityLinkResponseCollection(org.wso2.carbon.bpmn.rest.model.history.HistoricIdentityLinkResponseCollection) ArrayList(java.util.ArrayList) HistoryService(org.activiti.engine.HistoryService)

Aggregations

HistoricIdentityLink (org.activiti.engine.history.HistoricIdentityLink)2 RestResponseFactory (org.wso2.carbon.bpmn.rest.common.RestResponseFactory)2 HistoricIdentityLinkResponse (org.wso2.carbon.bpmn.rest.model.history.HistoricIdentityLinkResponse)2 HistoricIdentityLinkResponseCollection (org.wso2.carbon.bpmn.rest.model.history.HistoricIdentityLinkResponseCollection)2 ArrayList (java.util.ArrayList)1 HistoryService (org.activiti.engine.HistoryService)1