Search in sources :

Example 1 with CaseOpening

use of com.evolveum.midpoint.cases.api.events.FutureNotificationEvent.CaseOpening in project midpoint by Evolveum.

the class OpenCaseAction method executeInternal.

@Override
@Nullable
public Action executeInternal(OperationResult result) {
    CaseType currentCase = operation.getCurrentCase();
    CaseState currentState = CaseState.of(currentCase);
    if (!currentState.isCreated()) {
        LOGGER.debug("Case was already opened; its state is {}", currentState);
        return null;
    }
    auditRecords.addCaseOpening(result);
    notificationEvents.add(new CaseOpening(currentCase));
    currentCase.setState(SchemaConstants.CASE_STATE_OPEN);
    // If there are zero stages, the case will be immediately closed by "open stage" action.
    return new OpenStageAction(operation);
}
Also used : CaseType(com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType) CaseState(com.evolveum.midpoint.schema.util.cases.CaseState) CaseOpening(com.evolveum.midpoint.cases.api.events.FutureNotificationEvent.CaseOpening) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

CaseOpening (com.evolveum.midpoint.cases.api.events.FutureNotificationEvent.CaseOpening)1 CaseState (com.evolveum.midpoint.schema.util.cases.CaseState)1 CaseType (com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType)1 Nullable (org.jetbrains.annotations.Nullable)1