
org.ow2.bonita.definition.activity.NoImplementation Maven / Gradle / Ivy
/**
* Copyright (C) 2006 Bull S. A. S.
* Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
package org.ow2.bonita.definition.activity;
import org.ow2.bonita.pvm.Execution;
import org.ow2.bonita.definition.ActivityType;
import org.ow2.bonita.definition.JavaHook;
import org.ow2.bonita.definition.Performer;
import org.ow2.bonita.facade.uuid.TaskUUID;
import org.ow2.bonita.runtime.TaskRunTime;
import org.ow2.bonita.runtime.XpdlExecution;
import org.ow2.bonita.services.Repository;
import org.ow2.bonita.util.EngineEnvTool;
/**
* @author Marc Blachon, Guillaume Porcher, Charles Souillard, Miguel Valdes, Pierre Vigneras
*/
public class NoImplementation extends AbstractActivity {
/**
*
*/
private static final long serialVersionUID = -6392840287035678094L;
protected NoImplementation() {
super();
}
public NoImplementation(final String activityName, final JoinType joinType,
final SplitType splitType,
final Performer performer,
final boolean isTask) {
super(activityName, joinType,
splitType,
isTask ? ActivityType.task : ActivityType.no,
performer);
}
@Override
protected boolean executeBusinessLogic(final Execution execution) {
final XpdlExecution xpdlExecution = (XpdlExecution) execution;
if (this.activityType.equals(ActivityType.task)) {
addTaskToRepository(getTask(xpdlExecution));
return false;
}
//noImpl must have a hook if it is not a task
EngineEnvTool.getHookExecutor()
.executeHooks(this.javaHooks, xpdlExecution, this.activityId, JavaHook.Type.automaticOnEnter);
return true;
}
@Override
protected boolean bodyStartAutomatically() {
if (this.activityType.equals(ActivityType.task)) {
return false;
}
return true;
}
protected TaskRunTime getTask(final XpdlExecution xpdlExecution) {
return new TaskRunTime(
new TaskUUID(xpdlExecution.getCurrentActivityInstanceUUID().toString()),
xpdlExecution.getNode().getName(), this, xpdlExecution);
}
protected void addTaskToRepository(final TaskRunTime taskRunTime) {
final Repository repository = EngineEnvTool.getRepository();
repository.addTask(taskRunTime);
taskRunTime.ready();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy