public class WorkflowUtil extends Object
Constructor and Description |
---|
WorkflowUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addToExistingTransientArgs(Map transientArgs,
String key,
List list)
This method adds to an existing list stored in the transient args map.
|
static void |
checkInvalidCharacters(String fieldValue,
String fieldName,
ErrorCollection errorCollection)
JRA-4429 (prevent invalid characters)
|
static String |
cloneWorkflowName(String currentName)
Deprecated.
Since 5.1. Use
WorkflowCopyNameFactory instead. |
static String |
convertDescriptorToXML(com.opensymphony.workflow.loader.WorkflowDescriptor descriptor)
Converts a
WorkflowDescriptor to XML. |
static com.opensymphony.workflow.loader.WorkflowDescriptor |
convertXMLtoWorkflowDescriptor(String workflowDescriptorXML)
Converts a string representation of a workflow XML into the
WorkflowDescriptor
object representation. |
static com.atlassian.crowd.embedded.api.User |
getCaller(Map transientVars)
Deprecated.
Use
getCallerUser(java.util.Map) instead. Since v6.0. |
static String |
getCallerKey(Map transientVars)
Given a map of transientVars from a Workflow Function, returns the user's key of the caller.
|
static String |
getCallerName(Map transientVars)
Deprecated.
Use
getCallerUser(java.util.Map) instead. Since v6.0. |
static ApplicationUser |
getCallerUser(Map transientVars)
Given a map of transientVars from a Workflow Function, returns the
ApplicationUser object of the caller. |
static String |
getGlobalMetaAttributeForIssue(org.ofbiz.core.entity.GenericValue issue,
String metaKey)
Deprecated.
Use WorkflowManager instead as described above. Since v6.3.
|
static String |
getMetaAttributeForIssue(org.ofbiz.core.entity.GenericValue issue,
String metaKey)
Deprecated.
Use
Issue and WorkflowManager instead as described above. Since v6.3. |
static Map |
getMetaAttributesForIssue(org.ofbiz.core.entity.GenericValue issue)
Deprecated.
Use
Issue and WorkflowManager instead as described above. Since v6.3. |
static List |
getMetaAttributesForIssue(org.ofbiz.core.entity.GenericValue issue,
String metaKeyPrefix)
Deprecated.
Use
Issue and WorkflowManager instead as described above. Since v6.3. |
static int |
getNextId(List descriptors)
Get the next usable ID value for a given list of descriptors.
|
static int |
getNextId(List descriptors,
int start)
Get the next usable ID value for a given list of descriptors and a start point.
|
static String |
getWorkflowDisplayName(JiraWorkflow workflow)
Appends "(Draft)" to the end of the workflow name for an draft workflow.
|
static WorkflowManager |
getWorkflowManager() |
static String |
getWorkflowTransitionDescription(com.opensymphony.workflow.loader.ActionDescriptor descriptor)
Get the translated description of the workflow transition.
|
static String |
getWorkflowTransitionDisplayName(com.opensymphony.workflow.loader.ActionDescriptor descriptor)
Get the translated display name of a workflow transition.
|
static String |
interpolateProjectKey(org.ofbiz.core.entity.GenericValue project,
String groupName)
Deprecated.
Use
replaceProjectKey(com.atlassian.jira.project.Project, String) instead. Since v5.0. |
static boolean |
isAcceptableName(String workflowName)
See
isAcceptableName(String, String, com.atlassian.jira.util.ErrorCollection)
This method does not provide information about error type. |
static boolean |
isAcceptableName(String workflowName,
String fieldName,
ErrorCollection errorCollection)
Check if given workflow name is valid that means it: Is not blank, contains only ASCII characters, does not
contain leading or trailing whitespaces If any of the above is not meet the first error is added to
errorCollection
If workflow name is valid then no error will be added to errorCollection |
static boolean |
isReservedKey(String key)
Return true if the passed string is a reserved workflow property key.
|
static String |
replaceProjectKey(Project project,
String groupName)
Deprecated.
Use Project Roles instead. Since v5.2.
|
static void |
setActionScreen(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor,
FieldScreen screen)
Sets the view and screen for the given action.
|
public static void addToExistingTransientArgs(Map transientArgs, String key, List list)
public static int getNextId(List descriptors)
public static int getNextId(List descriptors, int start)
public static String interpolateProjectKey(org.ofbiz.core.entity.GenericValue project, String groupName)
replaceProjectKey(com.atlassian.jira.project.Project, String)
instead. Since v5.0.public static String replaceProjectKey(Project project, String groupName)
public static String getGlobalMetaAttributeForIssue(org.ofbiz.core.entity.GenericValue issue, String metaKey)
workflowManager.getWorkflow(issue).getDescriptor().getMetaAttributes().get(metaKey);
public static String getMetaAttributeForIssue(org.ofbiz.core.entity.GenericValue issue, String metaKey)
Issue
object and WorkflowManager
component.
eg:
workflowManager.getWorkflow(issue).getLinkedStep(issue.getStatusObject()).getMetaAttributes();
public static List getMetaAttributesForIssue(org.ofbiz.core.entity.GenericValue issue, String metaKeyPrefix)
Issue
object and WorkflowManager
component.
eg:
workflowManager.getWorkflow(issue).getLinkedStep(issue.getStatusObject()).getMetaAttributes();
public static Map getMetaAttributesForIssue(org.ofbiz.core.entity.GenericValue issue)
Issue
object and WorkflowManager
component.
eg:
workflowManager.getWorkflow(issue).getLinkedStep(issue.getStatusObject()).getMetaAttributes();
public static String convertDescriptorToXML(com.opensymphony.workflow.loader.WorkflowDescriptor descriptor)
WorkflowDescriptor
to XML.descriptor
- The WorkflowDescriptor
to convertpublic static boolean isAcceptableName(String workflowName, @Nonnull String fieldName, @Nonnull ErrorCollection errorCollection)
errorCollection
If workflow name is valid then no error will be added to errorCollection
workflowName
- name of the workflow to checkfieldName
- field name that the error should be associated with in errorCollection
errorCollection
- error collection that collects errorsNullPointerException
- if fieldName or errorCollection is nullpublic static boolean isAcceptableName(String workflowName)
isAcceptableName(String, String, com.atlassian.jira.util.ErrorCollection)
This method does not provide information about error type.public static void checkInvalidCharacters(String fieldValue, String fieldName, ErrorCollection errorCollection)
public static boolean isReservedKey(String key)
key
- the key to check.true
if the passed key is reserved or false
otherwise.public static com.opensymphony.workflow.loader.WorkflowDescriptor convertXMLtoWorkflowDescriptor(String workflowDescriptorXML) throws com.opensymphony.workflow.FactoryException
WorkflowDescriptor
object representation.workflowDescriptorXML
- the XML representation of an OSWorkflowWorkflowDescriptor
that represents the workflow.com.opensymphony.workflow.FactoryException
- thrown if the XML is malformed or can not be converted to the object representation.public static String getWorkflowDisplayName(JiraWorkflow workflow)
workflow
- The workflow to create the display name for.@Deprecated public static String cloneWorkflowName(String currentName)
WorkflowCopyNameFactory
instead.currentName
- The name of the current workflow.public static WorkflowManager getWorkflowManager()
public static String getWorkflowTransitionDisplayName(com.opensymphony.workflow.loader.ActionDescriptor descriptor)
descriptor
- The action descriptor to get the name ofpublic static String getWorkflowTransitionDescription(com.opensymphony.workflow.loader.ActionDescriptor descriptor)
descriptor
- The action descriptor to get the description ofpublic static String getCallerName(Map transientVars)
getCallerUser(java.util.Map)
instead. Since v6.0.transientVars
- the "transientVars" from the workflow FunctionProviderFunctionProvider.execute(java.util.Map, java.util.Map, com.opensymphony.module.propertyset.PropertySet)
,
WorkflowContext.getCaller()
,
getCaller(java.util.Map)
public static String getCallerKey(Map transientVars)
getCallerUser(java.util.Map)
instead.transientVars
- the "transientVars" from the workflow FunctionProvidergetCallerUser(java.util.Map)
public static ApplicationUser getCallerUser(Map transientVars)
ApplicationUser
object of the caller.transientVars
- the "transientVars" from the workflow FunctionProviderpublic static com.atlassian.crowd.embedded.api.User getCaller(Map transientVars)
getCallerUser(java.util.Map)
instead. Since v6.0.User
object of the caller.transientVars
- the "transientVars" from the workflow FunctionProviderFunctionProvider.execute(java.util.Map, java.util.Map,
com.opensymphony.module.propertyset.PropertySet)
,
WorkflowContext.getCaller()
,
getCallerUser(java.util.Map)
public static void setActionScreen(@Nonnull com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor, @Nullable FieldScreen screen)
actionDescriptor
- Action who's screen to set.screen
- Screen to be set for the action. Null indicates no screen.Copyright © 2002-2015 Atlassian. All Rights Reserved.