Interface IFunction<T extends IWorkflowObject>
- Type Parameters:
T
- type of the target object, seeICallContext.getTarget()
; useIWorkflowObject
if the function is general, or specific prototype interface if the function is specific for that prototype
public interface IFunction<T extends IWorkflowObject>
Workflow functions are automatically executed upon the action execution. They
can perform various tasks.
The custom functions can be contributed using the
com.polarion.alm.tracker.workflow.functions
configuration
point. The contribution looks like this:
<contribution configuration-id="com.polarion.alm.tracker.workflow.functions">
<function
name="Your-unique-function-name"
clazz="com.your.FunctionClassName"
prototype="prototype like WorkItem or *"/>
</contribution>
"WorkItem" is the default prototype value but you can use "*" if you want your function to be available for all prototypes.Note: You can only define a single prototype per function. (For example, "Module" for Documents.)
Tip: If you want to write a function with two prototypes, then write the function twice with the same "Name" and "clazz" but with two different "prototype" definitions.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(ICallContext<T> context, IArguments arguments) Performs a custom operation triggered by workflow action.
-
Method Details
-
execute
Performs a custom operation triggered by workflow action.Note: all objects which are going to be modified by the function, have to be processed through the
ICallContext.prepareObjectForModification(IPObject)
otherwise the modifications might be persisted incorrectly.- Parameters:
context
- theICallContext
object representing the context for this executionarguments
- theIArguments
object representing the arguments specified in the workflow configuration
-