
org.ow2.bonita.definition.MultiInstantiator Maven / Gradle / Ivy
The newest version!
/**
* 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 org.ow2.bonita.facade.QueryAPIAccessor;
import org.ow2.bonita.facade.uuid.ProcessInstanceUUID;
/**
* Implementing this interface is required to get multi-instantiation feature.
* This feature allows to get multiple instantiations of an activity.
*
* Into the xpdl file, this feature is specified within an external attributes of the Activity element.
* The name of the external attribute is MultiInstantiation.
* There is two child elements defining the MultiInstantiation:
*
* - The variable element containing the name of the variable that is set at multi-instantiation execution
* for each activity instance. This variable must be defined as local to the activity.
* For instance this activity variable can be used into hooks or performer assignments defined within the activity.
* Notices this activity variable cannot be used into the condition of the outgoing transition.
* - MultiInstantiator element containing the name of the class that implements this interface
*
*
*/
public interface MultiInstantiator {
/**
* Method of the interface to be implemented.
* Put in all your required user-defined operations.
*
* This method must return an MultiInstantiatorDescriptor.
* Parameters to construct this returned object must respect the following conditions:
*
* - parameters cannot be null
* - joinNumber greater than 0
* - (*)joinNumber must be lesser than or equal to the variableValues size
*
* Otherwise a runtime exception will be raised at execution.
* (*) Temporally restriction has be added ! : joinNumber must be equal to the variableValues size.
*
*
* @param accessor The InternalQueryAPIAccessor interface to access: QueryRuntimeAPI or QueryDefinitionAPI.
* @param instanceUUID Id of the instance.
* @param activityId Id of the activity.
* @param iterationId Id of the iteration.
* @return an {@link MultiInstantiatorDescriptor} that describes the number of activities to instantiate.
* @throws Exception If an Exception has occurred.
*/
MultiInstantiatorDescriptor execute(QueryAPIAccessor accessor, ProcessInstanceUUID instanceUUID,
String activityId, String iterationId) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy