gpt4 book ai didi

com.atlassian.jira.workflow.WorkflowManager.getWorkflowClone()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 18:39:05 30 4
gpt4 key购买 nike

本文整理了Java中com.atlassian.jira.workflow.WorkflowManager.getWorkflowClone()方法的一些代码示例,展示了WorkflowManager.getWorkflowClone()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowManager.getWorkflowClone()方法的具体详情如下:
包路径:com.atlassian.jira.workflow.WorkflowManager
类名称:WorkflowManager
方法名:getWorkflowClone

WorkflowManager.getWorkflowClone介绍

[英]This method returns a JiraWorkflow, that contains a com.opensymphony.workflow.loader.WorkflowDescriptorthat is mutable. This method should be called, if you require to edit the workflow.

If you only need to view a workflow, please use #getWorkflow(String) as it will provide better performance. Cloning a workflow is expensive, as it requires de-constructing and re-constructing the underlying com.opensymphony.workflow.loader.WorkflowDescriptor from XML.
[中]此方法返回一个包含com的JiraWorkflow。开放交响乐团。工作流程。加载器。WorkflowDescriptor是可变的。如果需要编辑工作流,则应调用此方法。
如果您只需要查看工作流,请使用#getWorkflow(字符串),因为它将提供更好的性能。克隆工作流成本很高,因为它需要解构和重新构建底层com。开放交响乐团。工作流程。加载器。来自XML的WorkflowDescriptor。

代码示例

代码示例来源:origin: com.atlassian.jira/jira-rest-plugin

private JiraWorkflow getWorkflowForEdit()
{
  if (workflow.isDraftWorkflow())
  {
    return workflow;
  }
  else
  {
    return workflowManager.getWorkflowClone(workflow.getName());
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

private JiraWorkflow getWorkflow(PicoContainer parent, String workflowMode, String workflowName, HttpServletRequest request)
{
  // Use the WorkflowManager to get the required workflow
  WorkflowManager workflowManager = parent.getComponent(WorkflowManager.class);
  JiraWorkflow workflow;
  if (workflowMode.equals(JiraWorkflow.LIVE))
  {
    // get the "live" workflow
    workflow = workflowManager.getWorkflowClone(workflowName);
  }
  else if (workflowMode.equals(JiraWorkflow.DRAFT))
  {
    // get the draft workflow
    workflow = workflowManager.getDraftWorkflow(workflowName);
  }
  else
  {
    throw new IllegalStateException("Invalid workflow mode '" + workflowMode + "'. " + getFullRequestUrl(request));
  }
  return workflow;
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com