Package com.aquima.web.rest.v1.service
Class CaseEventService
java.lang.Object
com.aquima.web.rest.v1.service.CaseEventService
Implements the logic of the /caseEvents endpoint.
- Since:
- 9.6
- Author:
- Petru Galanton
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic CaseEventService
forPaged
(com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ICaseEventModel, CaseEvent> converter, IResourceLinker<CaseEvent> linker, PaginatorFactory paginatorFactory) Creates an instance of this service usable in the /caseEvents endpointstatic CaseEventService
forReplay
(com.aquima.interactions.portal.IPortalEngine portalEngine, com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ICaseEventModel, CaseEvent> converter) Creates an instance of this service usable in the POST /caseEvents/{eventId} endpoint (for replaying events).static CaseEventService
forSingle
(com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ICaseEventModel, CaseEvent> converter) Creates an instance of this service usable in the GET /caseEvents/{eventId} endpointgetCaseEvent
(CaseEvent caseEvent, Long eventId) Populates the given case event resource with the details of the case event with the given id.getCaseEvents
(PagedObject<CaseEvent> pagedObject, NullableLong caseId, Integer page, Integer pageSize, String sort, List<ResourceFilter> resourceFilters) Populates the given paged object resource with a (potentially) paginated list of case events.void
replayCaseEvent
(CaseEvent eventResource, Long eventId, NullableLong caseId, com.aquima.interactions.project.IUserData userData) Replays (re-triggers) the event with the given id and populates the given event resource with the details of the newly created event.
-
Field Details
-
Method Details
-
forPaged
public static CaseEventService forPaged(com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ICaseEventModel, CaseEvent> converter, IResourceLinker<CaseEvent> linker, PaginatorFactory paginatorFactory) Creates an instance of this service usable in the /caseEvents endpoint- Parameters:
repository
- the case repositoryconverter
- converter from case event models to case event resourceslinker
- HATEOAS linker for case eventspaginatorFactory
- paginator factory- Returns:
- an instance of this service configured for use in the GET /caseEvents endpoint
-
forSingle
public static CaseEventService forSingle(com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ICaseEventModel, CaseEvent> converter) Creates an instance of this service usable in the GET /caseEvents/{eventId} endpoint- Parameters:
repository
- the case repositoryconverter
- converter from case event models to case event resources- Returns:
- an instance of this service configured for use in the /caseEvents/{eventId} endpoint
-
forReplay
public static CaseEventService forReplay(com.aquima.interactions.portal.IPortalEngine portalEngine, com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ICaseEventModel, CaseEvent> converter) Creates an instance of this service usable in the POST /caseEvents/{eventId} endpoint (for replaying events).- Parameters:
portalEngine
- the portal engine, used for obtaining a process enginerepository
- the case repositoryconverter
- converter from case event models to case event resources- Returns:
- an instance of this service configured for use in the POST /caseEvents/{eventId} endpoint
-
getCaseEvents
public List<CaseEvent> getCaseEvents(PagedObject<CaseEvent> pagedObject, NullableLong caseId, Integer page, Integer pageSize, String sort, List<ResourceFilter> resourceFilters) Populates the given paged object resource with a (potentially) paginated list of case events.- Parameters:
pagedObject
- the paged object resource where case events resources are placedcaseId
- the caseId filter, may be nullpage
- the page number (may be null - null disables paging)pageSize
- the page size (may be null - null disables paging)sort
- the sorting orderresourceFilters
- resource filters- Returns:
- the case events
-
getCaseEvent
Populates the given case event resource with the details of the case event with the given id.- Parameters:
caseEvent
- the case event resourceeventId
- the id of the case event- Returns:
- the case event
-
replayCaseEvent
public void replayCaseEvent(CaseEvent eventResource, Long eventId, NullableLong caseId, com.aquima.interactions.project.IUserData userData) Replays (re-triggers) the event with the given id and populates the given event resource with the details of the newly created event.- Parameters:
eventResource
- the event resource for the replayed eventeventId
- the id of the original eventcaseId
- (optional) for message events, the id of the case where the new event should be triggereduserData
- the user data
-