01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.workflow;
06:
07: import com.opensymphony.module.propertyset.PropertySet;
08:
09: import java.util.Map;
10:
11: /**
12: * Interface to be implemented by any class that are to be called from within a workflow as a function,
13: * either as a pre-function or a post-function. The args nested elements within the function xml call
14: * will be mapped to the properties parameter.
15: *
16: * @author <a href="mailto:plightbo@hotmail.com">Pat Lightbody</a>
17: */
18: public interface FunctionProvider {
19: //~ Methods ////////////////////////////////////////////////////////////////
20:
21: /**
22: * Execute this function
23: * @param transientVars Variables that will not be persisted. These include inputs
24: * given in the {@link Workflow#initialize} and {@link Workflow#doAction} method calls.
25: * There are a number of special variable names:
26: * <ul>
27: * <li><code>entry</code>: (object type: {@link com.opensymphony.workflow.spi.WorkflowEntry})
28: * The workflow instance
29: * <li><code>context</code>:
30: * (object type: {@link com.opensymphony.workflow.WorkflowContext}). The workflow context.
31: * <li><code>actionId</code>: The Integer ID of the current action that was take (if applicable).
32: * <li><code>currentSteps</code>: A Collection of the current steps in the workflow instance.
33: * <li><code>store</code>: The {@link com.opensymphony.workflow.spi.WorkflowStore}.
34: * <li><code>descriptor</code>: The {@link com.opensymphony.workflow.loader.WorkflowDescriptor}.
35: * </ul>
36: * Also, any variable set as a {@link com.opensymphony.workflow.Register}), will also be
37: * available in the transient map, no matter what. These transient variables only last through
38: * the method call that they were invoked in, such as {@link Workflow#initialize}
39: * and {@link Workflow#doAction}.
40: * @param args The properties for this function invocation. Properties are created
41: * from arg nested elements within the xml, an arg element takes in a name attribute
42: * which is the properties key, and the CDATA text contents of the element map to
43: * the property value.
44: * @param ps The persistent variables that are associated with the current
45: * instance of the workflow. Any change made to the propertyset are persisted to
46: * the propertyset implementation's persistent store.
47: */
48: public void execute(Map transientVars, Map args, PropertySet ps)
49: throws WorkflowException;
50: }
|