org.acme.travels.usertasks.CustomHumanTaskLifeCycle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of process-usertasks-custom-lifecycle-springboot
Show all versions of process-usertasks-custom-lifecycle-springboot
Kogito usertasks orchestration with custom life cycle - Spring Boot
/*
* Copyright 2020 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.acme.travels.usertasks;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import org.jbpm.process.instance.impl.humantask.BaseHumanTaskLifeCycle;
import org.jbpm.process.instance.impl.humantask.HumanTaskWorkItemImpl;
import org.jbpm.process.instance.impl.humantask.phases.Claim;
import org.jbpm.process.instance.impl.humantask.phases.Release;
import org.jbpm.process.instance.impl.humantask.phases.Skip;
import org.jbpm.process.instance.impl.workitem.Abort;
import org.jbpm.process.instance.impl.workitem.Active;
import org.jbpm.process.instance.impl.workitem.Complete;
import org.kie.kogito.internal.process.runtime.KogitoWorkItem;
import org.kie.kogito.internal.process.runtime.KogitoWorkItemManager;
import org.kie.kogito.process.workitem.InvalidLifeCyclePhaseException;
import org.kie.kogito.process.workitem.InvalidTransitionException;
import org.kie.kogito.process.workitem.LifeCycle;
import org.kie.kogito.process.workitem.LifeCyclePhase;
import org.kie.kogito.process.workitem.NotAuthorizedException;
import org.kie.kogito.process.workitem.Policy;
import org.kie.kogito.process.workitem.Transition;
import org.kie.kogito.process.workitems.InternalKogitoWorkItemManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Custom life cycle definition for human tasks. It comes with following phases
*
*
* - Active
* - Claim
* - Release
* - Start
* - Complete - extended one that allows to only complete started tasks
* - Skip
* - Abort
*
* At the beginning human task enters
*
*
* Active
*
*
* phase. From there it can go to
*
*
* - Claim
* - Skip
* - Abort
*
*
* at any time. At each phase data can be associated and by that set on work item.
*
* Completion can only be performed on started tasks.
*/
public class CustomHumanTaskLifeCycle implements LifeCycle
© 2015 - 2025 Weber Informatics LLC | Privacy Policy