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

org.ow2.bonita.facade.runtime.ProcessInstance Maven / Gradle / Ivy

/**
 * Copyright (C) 2007  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.facade.runtime;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.ow2.bonita.facade.uuid.ActivityInstanceUUID;
import org.ow2.bonita.facade.uuid.ProcessInstanceUUID;
import org.ow2.bonita.services.Archivable;

/**
 * Interface for getting recorded (runtime) information on process instance.
 */
public interface ProcessInstance extends RuntimeRecord, Archivable {

  /**
   * Returns the UUID of the process instance.
   * @return The UUID of the process instance.
   */
  ProcessInstanceUUID getUUID();

  /**
   * If the instance is created to execute a subflow it returns
   * the instance processDefinitionUUID of the instance creating this instance of subflow,
   * otherwise it returns null.
   * @return the ProcessInstanceUUID of the parent instance (case of subflow) otherwise null.
   */
  ProcessInstanceUUID getParentInstanceUUID();

  /**
   * If this instance is a parent execution, it returns UUID of children instances
   * otherwise an empty set
   * @return  If this instance is a parent execution, it returns UUID of children instances
   * otherwise an empty set
   */
  Set getChildrenInstanceUUID();
  /**
   * Returns the date recorded when the instance has been created and started.
   * @return the date recorded when the instance has been created and started.
   */
  Date getStartedDate();
  /**
   * Returns the date recorded when the instance is finished.
   * @return the date recorded when the instance is finished.
   */
  Date getEndedDate();
  /**
   * Returns the user creating and starting the instance of the workflow process.
   * @return the user creating and starting the instance of the workflow process.
   */
  String getStartedBy();
  /**
   * Returns the user finishing the instance of the workflow process.
   * @return the user finishing the instance of the workflow process.
   */
  String getEndedBy();
  /**
   * Returns all global variables (for the process instance) defined  within the xml definition file
   * and also optionally added as parameter (variable map) of the instantiateProcess() method.
   * Variable values are ones recorded at instance creation.
   * Map Key is the variable processDefinitionUUID.
   * Map Object is the variable value.
   * An empty map is returned if no variable is found.
   * @return the map containing global (for process instance) variables recorded at instance creation.
   * The variable object (can be: an {@link org.ow2.bonita.facade.runtime.var.Enumeration Enumeration},
   * a plain {@link String}, a {@link Boolean}, a {@link Date}, a {@link Long} or a {@link Double}).
   */
  Map getInitialVariableValues();
  /**
   * Returns the value of the variable with the specified key recorded at the instance creation.
   * @param variableId the variable processDefinitionUUID.
   * @return the value of the variable with the specified key recorded at the instance creation.
   * (can be: an {@link org.ow2.bonita.facade.runtime.var.Enumeration Enumeration},
   * a plain {@link String}, a {@link Boolean}, a {@link Date}, a {@link Long} or a {@link Double}).
   */
  Object getInitialVariableValue(String variableId);
  /**
   * Returns the map containing all variables with the last updated value.
   * @return The map containing all variables with the last updated value.
   * the variable object can be: an {@link org.ow2.bonita.facade.runtime.var.Enumeration Enumeration},
   * a plain {@link String}, a {@link Boolean}, a {@link Date}, a {@link Long} or a {@link Double}.
   */
  Map getLastKnownVariableValues();
  /**
   * Returns the current instance state.
   * @return the current instance state.
   */
  InstanceState getInstanceState();

  /**
   * Returns the list of recorded {@link InstanceStateUpdate state changes}.
   * @return The list of recorded {@link InstanceStateUpdate state changes}.
   */
  List getInstanceStateUpdates();
  /**
   * Gives access to the historic of variables updates.
   * @return The list of recorded informations for the variable updates.
   */
  List getVariableUpdates();
  
  List getCommentFeed();
  
  ActivityInstance getActivity(ActivityInstanceUUID activityUUID);

  ActivityInstance getActivity(String activityId, String iterationId, String activityInstanceId);
  
  Set getWebLabels();
  
  Set getActivities();
  
  Set getTasks();
  
  Set getActivities(String activityId);
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy