All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.bonita.definition.XpdlProcess 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;

import java.util.List;

import org.ow2.bonita.pvm.internal.model.ExecutionImpl;
import org.ow2.bonita.pvm.internal.model.ProcessDefinitionImpl;
import org.ow2.bonita.pvm.internal.model.VariableDefinitionImpl;
import org.ow2.bonita.facade.uuid.PackageDefinitionUUID;
import org.ow2.bonita.facade.uuid.ProcessDefinitionUUID;
import org.ow2.bonita.runtime.XpdlInstance;
import org.ow2.bonita.util.BonitaRuntimeException;

/**
 * @author Marc Blachon, Guillaume Porcher, Charles Souillard, Miguel Valdes, Pierre Vigneras
 */
public class XpdlProcess extends ProcessDefinitionImpl {

  /**
   * 
   */
  private static final long serialVersionUID = -628269772789151365L;
  protected ProcessDefinitionUUID processUUID;
  protected PackageDefinitionUUID packageUUID;

  protected List parameters;

  protected XpdlProcess() { }

  public XpdlProcess(final ProcessDefinitionUUID processUUID,
      final PackageDefinitionUUID packageUUID,
      final List parameters) {

    super();
    this.processUUID = processUUID;
    this.packageUUID = packageUUID;
    this.parameters = parameters;
  }

  @Override
  protected ExecutionImpl newProcessInstance() {
    XpdlInstance xpdlInstance = new XpdlInstance(this);
    return xpdlInstance.getRootExecution();
  }

  public ProcessDefinitionUUID getUUID() {
    return processUUID;
  }

  public void setVariableDefinitions(List variableDefinitions) {
    this.variableDefinitions = variableDefinitions;
    hasVariableDefinitions = true; //variableDefinitions != null;
  }


  public List getParameters() {
    return parameters;
  }

  public PackageDefinitionUUID getPackageDefinitionUUID() {
    return packageUUID;
  }

  @Override
  public String getName() {
    throw new BonitaRuntimeException("Call getName method on XPDLProcess is not allowed! We must always use ids!");
  }
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy