class CheckConcurrentWorkflowLockHandler extends ActionHandler {

    @Override
    public ItemStatus execute(WorkerParameters param, HandlerIO handler)
        throws ProcessingException {

        try {

            String workflowIdsStr = (String) handler.getInput(WORKFLOW_IDS_RANK);
            List<String> workflowIds = Arrays.stream(workflowIdsStr.split(","))
                .map(String::trim)
                .collect(Collectors.toList());

            List<ProcessDetail> concurrentWorkflows = lightweightWorkflowLock
                .listConcurrentWorkflows(workflowIds, param.getContainerName());

            if (!concurrentWorkflows.isEmpty()) {

                LOGGER.error("Concurrent process(es) found " +
                    concurrentWorkflows.stream().map(
                        i -> i.getProcessType() + " " + i.getOperationId() + "(" + i.getGlobalState() + "/" +
                            i.getStepStatus() + ")")
                        .collect(Collectors.joining(", ", "[", "]")));

                ObjectNode eventDetails = JsonHandler.createObjectNode();
                eventDetails.put("error", CONCURRENT_PROCESSES_FOUND);
                return buildItemStatus(CHECK_CONCURRENT_WORKFLOW_LOCK, StatusCode.KO, eventDetails);
            }

        } catch (VitamClientException e) {
            LOGGER.error("Concurrent workflow lock check failed", e);
            return buildItemStatus(CHECK_CONCURRENT_WORKFLOW_LOCK, StatusCode.FATAL, null);
        }

        LOGGER.info("Concurrent workflow lock check succeeded");
        return buildItemStatus(CHECK_CONCURRENT_WORKFLOW_LOCK, StatusCode.OK, null);
    }

    public  CheckConcurrentWorkflowLockHandler();
    @VisibleForTesting  CheckConcurrentWorkflowLockHandler(LightweightWorkflowLock lightweightWorkflowLock);

}