com.atlassian.jira.plugin.workflow
Interface WorkflowPluginFactory

All Known Subinterfaces:
WorkflowPluginConditionFactory, WorkflowPluginFunctionFactory, WorkflowPluginValidatorFactory
All Known Implementing Classes:
AbstractWorkflowPermissionPluginFactory, AbstractWorkflowPluginFactory, UpdateIssueFieldFunctionPluginFactory, WorkflowAllowOnlyAssigneeConditionFactoryImpl, WorkflowAllowOnlyReporterConditionFactoryImpl, WorkflowChangeHistoryFunctionPluginFactory, WorkflowFireIssueEventFunctionPluginFactory, WorkflowIsUserInGroupCFConditionFactoryImpl, WorkflowIsUserInGroupConditionFactoryImpl, WorkflowIsUserInProjectRoleConditionFactoryImpl, WorkflowNoInputPluginFactory, WorkflowPermissionConditionFactoryImpl, WorkflowPermissionValidatorPluginFactory, WorkflowSubTaskBlockingConditionFactoryImpl, WorkflowUberFunctionPluginFactory, WorkflowUserPermissionValidatorPluginFactory

public interface WorkflowPluginFactory

A WorkflowPluginFactory implements methods used to configure a workflow plugin. Generally there will be a WorkflowPluginFactory implementation for each workflow plugin type.

There are two methods to implement - getVelocityParams provides parameters for the velocity template that configures the plugin, and getDescriptorParams(java.util.Map) parses the velocity form submission, and extracts plugin args from it.

See Also:
AbstractJiraFunctionProvider

Method Summary
 Map<String,?> getDescriptorParams(Map<String,Object> formParams)
          Given a set of name:value parameters from the plugin configuration page (ie.
 Map<String,?> getVelocityParams(String resourceName, com.opensymphony.workflow.loader.AbstractDescriptor descriptor)
          Given a plugin resource name, return the parameters it needs.
 

Method Detail

getVelocityParams

Map<String,?> getVelocityParams(String resourceName,
                                com.opensymphony.workflow.loader.AbstractDescriptor descriptor)
Given a plugin resource name, return the parameters it needs. When workflow editor is rendering or configuring a workflow condition, this method will be called to fill in a Velocity template.

Parameters:
resourceName - Typically "view", "input-parameters" or "edit-parameters".
descriptor - A ConditionDescriptor describing the Condition and its current configuration.
Returns:
Map of params, eg. {"group": ['jira-users', 'jira-developers']}

getDescriptorParams

Map<String,?> getDescriptorParams(Map<String,Object> formParams)
Given a set of name:value parameters from the plugin configuration page (ie. the 'input-parameters' velocity template) return a map of sanitized parameters which will be passed into workflow plugin instances. For example, the results are passed in the 'arg' parameter of post-functions' execute() or conditions' passesCondition methods. The velocity page often submits values in array form, and this method extracts just the relevant value.

Parameters:
formParams - Parameters from the velocity template, eg. {"fieldId" : ["assignee"], "fieldValue":["-1"]}
Returns:
Parameters to be passed into workflow functions via the 'args' map. Eg. {"assignee": "-1"}


Copyright © 2002-2009 Atlassian. All Rights Reserved.