public static void apply()

in kogito-quarkus-examples/process-error-handling/src/main/java/org/acme/script/ErrorHandlingScript.java [50:65]


    public static void apply(KogitoProcessContext kcontext) {
        LOG.debug("start");
        ProcessWorkItemHandlerException exception = (ProcessWorkItemHandlerException) kcontext.getVariable("Error");
        String strategy = (String) kcontext.getVariable("strategy");
        LOG.debug("strategy: {}", strategy);

        // apply strategy
        if (exception != null && strategy != null && strategy.matches("(RETRY|COMPLETE|ABORT|RETHROW)")) {
            ProcessWorkItemHandlerException exception2 = new ProcessWorkItemHandlerException(exception.getProcessId(),
                    ProcessWorkItemHandlerException.HandlingStrategy.valueOf(strategy),
                    exception.getCause());

            kcontext.setVariable("Error", exception2);
        }
        LOG.debug("end");
    }