gpt4 book ai didi

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

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

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

WorkflowManager.getWorkflows介绍

[英]Retrieve all of the workflows in the system
[中]检索系统中的所有工作流

代码示例

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

public Collection<JiraWorkflow> getWorkflows()
{
  if (workflows == null)
  {
    workflows = workflowManager.getWorkflows();
  }
  return workflows;
}

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

private Collection<JiraWorkflow> getWorkflows()
{
  if (workflows == null)
  {
    // Expensive call
    workflows = workflowManager.getWorkflows();
  }
  return workflows;
}

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

private Iterable<WorkflowBean> actuallyGetAllWorkflows()
{
  return Lists.newArrayList(transform(workflowManager.getWorkflows(), new Function<JiraWorkflow, WorkflowBean>()
  {
    @Override
    public WorkflowBean apply(JiraWorkflow workflow)
    {
      return jiraWorkflowToWorkflowBean(workflow);
    }
  }));
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-workflow-sharing-plugin

private List<String> getAllWorkflowNames()
{
  return ImmutableList.copyOf(Collections2.transform(workflowManager
      .getWorkflows(), new Function<JiraWorkflow, String>()
  {
    @Override
    public String apply(JiraWorkflow wf)
    {
      return wf.getName();
    }
  }));
}

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

@Override
public void doUpgrade(boolean setupMode) throws Exception
{
  workflowManager.copyAndDeleteDraftsForInactiveWorkflowsIn(null, workflowManager.getWorkflows());
}

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

public Map<JiraWorkflow, Collection<ActionDescriptor>> getWorkflows(FieldScreen fieldScreen)
{
  Map<JiraWorkflow, Collection<ActionDescriptor>> workflows = new TreeMap<JiraWorkflow, Collection<ActionDescriptor>>();
  for (final JiraWorkflow workflow : workflowManager.getWorkflows())
  {
    Collection<ActionDescriptor> actions = workflow.getActionsForScreen(fieldScreen);
    if (actions != null && !actions.isEmpty())
    {
      workflows.put(workflow, actions);
    }
  }
  return workflows;
}

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

public Set<Map<String, String>> getTransitionLinkedToWebHookListener(final int id) {
  final Set<Map<String, String>> transitions = Sets.newHashSet();
  final Collection<JiraWorkflow> workflows = workflowManager.getWorkflows();
  for (JiraWorkflow workflow : workflows) {
    transitions.addAll(getTransitions(id, workflow));
  }
  return transitions;
}

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

public Collection<WorkflowTransitionViewHelper> getWorkflowTransitionViews(FieldScreen fieldScreen)
{
  List<WorkflowTransitionViewHelper> answer = new ArrayList<WorkflowTransitionViewHelper>();
  for (final JiraWorkflow workflow : workflowManager.getWorkflows())
  {
    Collection<ActionDescriptor> actions = workflow.getActionsForScreen(fieldScreen);
    if (actions != null && !actions.isEmpty())
    {
      for (ActionDescriptor action : actions)
      {
        answer.add(new WorkflowTransitionViewHelper(workflow, action));
      }
    }
  }
  Collections.sort(answer);
  return answer;
}

代码示例来源:origin: com.atlassian.analytics/analytics-client

private RawEvent generateWorkflowCreatedEvent(HttpServletRequest request)
{
  final Collection<JiraWorkflow> workflows = workflowManager.getWorkflows();
  if (workflows.isEmpty())
  {
    return getDummyWorkflowCreatedMessage();
  }
  WorkflowCreatedEvent workflowCreatedEvent = new WorkflowCreatedEvent(workflows.iterator().next());
  return eventSerializer.toAnalyticsEvent(workflowCreatedEvent, sessionIdProvider.getSessionId(), RequestInfo
      .fromRequest(request)).get();
}

代码示例来源:origin: com.atlassian.analytics/analytics-client

private RawEvent generateWorkflowUpdatedEvent(HttpServletRequest request)
{
  final Collection<JiraWorkflow> workflows = workflowManager.getWorkflows();
  if (workflows.isEmpty())
  {
    return getDummyWorkflowUpdatedMessage();
  }
  return eventSerializer.toAnalyticsEvent(new WorkflowUpdatedEvent(workflows.iterator().next()),
      sessionIdProvider.getSessionId(), RequestInfo.fromRequest(request)).get();
}

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

public MultiMap getAssociatedWorkflows(EventType eventType, boolean statusCheck)
{
  MultiMap workflowTransitionMap = new MultiValueMap();
  Collection<JiraWorkflow> workflows = workflowManager.getWorkflows();
  Long eventTypeId = eventType.getId();
  for (final JiraWorkflow workflow : workflows)
  {
    Map<ActionDescriptor, Collection<FunctionDescriptor>> transitionPostFunctionMap = workflowManager.getPostFunctionsForWorkflow(workflow);
    Collection<ActionDescriptor> keys = transitionPostFunctionMap.keySet();
    for (final ActionDescriptor actionDescriptor : keys)
    {
      Collection<FunctionDescriptor> postFunctions = transitionPostFunctionMap.get(actionDescriptor);
      for (final FunctionDescriptor functionDescriptor : postFunctions)
      {
        if (functionDescriptor.getArgs().containsKey(EVENT_TYPE_ID) &&
            eventTypeId.equals(new Long((String) functionDescriptor.getArgs().get(EVENT_TYPE_ID))))
        {
          workflowTransitionMap.put(workflow.getName(), actionDescriptor);
          // Exit now as we only need one association for a status check
          if (statusCheck)
          {
            return workflowTransitionMap;
          }
        }
      }
    }
  }
  return workflowTransitionMap;
}

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

for (JiraWorkflow workflow : workflowManager.getWorkflows())

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

@Override
public MultiMap getAssociatedWorkflows(ProjectRole projectRole, ErrorCollection errorCollection)
{
  Collection<JiraWorkflow> workflows = workflowManager.getWorkflows();
  MultiMap associatedWorkflows = new MultiHashMap(workflows.size());
  for (JiraWorkflow jiraWorkflow : workflows)
  {
    Collection<ActionDescriptor> actions = jiraWorkflow.getAllActions();
    for (ActionDescriptor actionDescriptor : actions)
    {
      RestrictionDescriptor restriction = actionDescriptor.getRestriction();
      if (restriction != null)
      {
        ConditionsDescriptor conditionsDescriptor = restriction.getConditionsDescriptor();
        if (conditionsDescriptorContainsProjectRoleCondition(conditionsDescriptor, projectRole.getId()))
        {
          associatedWorkflows.put(jiraWorkflow, actionDescriptor);
          // workflow matches, don't need to check the conditions on any more actions
        }
      }
    }
  }
  return associatedWorkflows;
}

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

@Override
public void doUpgrade(boolean setupMode) throws Exception
{
  DescriptorFactory descriptorFactory = DescriptorFactory.getFactory();
  WorkflowManager workflowManager = ComponentAccessor.getComponentOfType(WorkflowManager.class);
  for (JiraWorkflow workflow : workflowManager.getWorkflows())
  {
    if (workflow instanceof ConfigurableJiraWorkflow)
    {
      ConfigurableJiraWorkflow mutableWorkflow = (ConfigurableJiraWorkflow) workflow;
      try
      {
        Element upgradedDescriptor = upgradeDescriptor(mutableWorkflow.getDescriptor().asXML());
        WorkflowDescriptor workflowDescriptor = descriptorFactory.createWorkflowDescriptor(upgradedDescriptor);
        mutableWorkflow.setDescriptor(workflowDescriptor);
        workflowManager.saveWorkflowWithoutAudit(mutableWorkflow);
        log.debug("Upgraded workflow '{}'", mutableWorkflow.getName());
      }
      catch (Exception e)
      {
        throw new RuntimeException("Failed to upgrade workflow: " + workflow.getName(), e);
      }
    }
  }
}

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

public void doUpgrade() throws FishEyeUpgradeException {
  for (Iterator workflows = workflowManager.getWorkflows().iterator(); workflows.hasNext();) {
    JiraWorkflow workflow = (JiraWorkflow) workflows.next();
    if (shouldUpgradeWorkflow(workflow)) {
      try {
        workflowManager.saveWorkflowWithoutAudit(workflow);
      } catch (WorkflowException e) {
        logError("Exception encountered when attempting to storing updated workflow " + workflow.getName(),
            e);
      }
    }
    //upgrade the draft workflow as well, if one exists
    JiraWorkflow draft = workflowManager.getDraftWorkflow(workflow.getName());
    if (draft != null) {
      if (shouldUpgradeWorkflow(draft)) {
        try {
          workflowManager.saveWorkflowWithoutAudit(draft);
        } catch (WorkflowException e) {
          logError("Exception encountered when attempting to storing updated draft workflow " +
              draft.getName(), e);
        }
      }
    }
  }
  properties.setBoolean(getUpgradeString(), true);
}

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

for (final JiraWorkflow workflow : (Iterable<JiraWorkflow>) workflowManager.getWorkflows())

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