Search in sources :

Example 1 with AbstractWaitCondition

use of com.walmartlabs.concord.server.process.waits.AbstractWaitCondition in project concord by walmartlabs.

the class ProcessResource method setWaitCondition.

/**
 * Set the process' wait condition.
 */
@POST
@ApiOperation(value = "Set the process' wait condition")
@javax.ws.rs.Path("{id}/wait")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@WithTimer
public Response setWaitCondition(@ApiParam @PathParam("id") UUID instanceId, @ApiParam Map<String, Object> waitCondition) {
    ProcessKey processKey = assertProcessKey(instanceId);
    AbstractWaitCondition condition = objectMapper.convertValue(waitCondition, AbstractWaitCondition.class);
    processWaitManager.addWait(processKey, condition);
    return Response.ok().build();
}
Also used : PartialProcessKey(com.walmartlabs.concord.server.sdk.PartialProcessKey) ProcessKey(com.walmartlabs.concord.server.sdk.ProcessKey) AbstractWaitCondition(com.walmartlabs.concord.server.process.waits.AbstractWaitCondition) WithTimer(com.walmartlabs.concord.server.sdk.metrics.WithTimer) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

AbstractWaitCondition (com.walmartlabs.concord.server.process.waits.AbstractWaitCondition)1 PartialProcessKey (com.walmartlabs.concord.server.sdk.PartialProcessKey)1 ProcessKey (com.walmartlabs.concord.server.sdk.ProcessKey)1 WithTimer (com.walmartlabs.concord.server.sdk.metrics.WithTimer)1 ApiOperation (io.swagger.annotations.ApiOperation)1