gpt4 book ai didi

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

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

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

WorkflowManager.getWorkflowsIncludingDrafts介绍

[英]Retrieve all of the workflows in the system including drafts. We return a list as we want to keep workflows and associated drafts are adjacent.
[中]

代码示例

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

private List<JiraWorkflow> getWorkflowsIncludingDrafts()
{
  // Cache this call as it is expensive.
  if (workflowsIncludingDrafts == null)
  {
    workflowsIncludingDrafts = workflowManager.getWorkflowsIncludingDrafts();
  }
  return workflowsIncludingDrafts;
}

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

private boolean hasAssociatedWorkflows(final Status status)
{
  List<JiraWorkflow> workflows = workflowManager.getWorkflowsIncludingDrafts();
  return Iterables.any(workflows, containsStatus(status));
}

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

private List<JiraWorkflow> getWorkflowsIncludingDrafts()
  {
    final List<JiraWorkflow> allWorkflows = workflowManager.getWorkflowsIncludingDrafts();
    
    //only include drafts if their parent is active
    Iterable<JiraWorkflow> filteredWorkflows = Iterables.filter(allWorkflows,new Predicate<JiraWorkflow>() {
      @Override
      public boolean apply(JiraWorkflow jiraWorkflow)
      {
        if(null == jiraWorkflow)
        {
          return false;
        }
        
        if(jiraWorkflow.isDraftWorkflow() && !parentWorkflowChecker.isParentWorkflowActive(jiraWorkflow))
        {
          return false;
        }
        else 
        {
          return true;
        }
      }
    });
        
    return ImmutableList.copyOf(filteredWorkflows);
  }
}

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

private List<JiraWorkflow> getDraftWorkflows()
{
  if (draftWorkflows == null)
  {
    final ImmutableList.Builder<JiraWorkflow> results = ImmutableList.builder();
    final List<JiraWorkflow> allWorkflows = workflowManager.getWorkflowsIncludingDrafts();
    for (final JiraWorkflow jiraWorkflow : allWorkflows)
    {
      if (jiraWorkflow.isDraftWorkflow())
      {
        results.add(jiraWorkflow);
      }
    }
    draftWorkflows = results.build();
  }
  return draftWorkflows;
}

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

@Override
public ServiceOutcome<List<JiraWorkflow>> getAssociatedWorkflows(ApplicationUser user, final Status status){
  List<JiraWorkflow> allWorkflows = workflowManager.getWorkflowsIncludingDrafts();
  List<JiraWorkflow>  workflows = ImmutableList.copyOf(Iterables.filter(allWorkflows, containsStatus(status)));
  return ServiceOutcomeImpl.ok(workflows);
}

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

@ActionViewData
public List<String> getWorkflowsForStatus()
{
  List<JiraWorkflow> allWorkflows = workflowManager.getWorkflowsIncludingDrafts();
  final Status status = statusService.getStatusById(getLoggedInUser(), id);
  Iterable<JiraWorkflow> workflowsForStatus = Iterables.filter(allWorkflows, new Predicate<JiraWorkflow>()
  {
    @Override
    public boolean apply(@Nullable final JiraWorkflow input)
    {
      return input.getLinkedStatusIds().contains(status.getId());
    }
  });
  List<String> workflowNamesForStatus = Lists.newArrayList(Iterables.transform(workflowsForStatus, GET_WORKFLOW_NAME));
  Collections.sort(workflowNamesForStatus);
  return workflowNamesForStatus;
}

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

@ActionViewData
public Collection<SimpleStatus> getStatuses()
{
  List<JiraWorkflow> workflows = workflowManager.getWorkflowsIncludingDrafts();
  return copyOf(transform(getConstantsManager().getStatusObjects(), new StatusMappingFunction(workflows)));
}

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

@Override
public void removeStatus(final String id)
{
  Status status = getStatusOrThrowIllegalArgumentException(id);
  final List<JiraWorkflow> existingWorkflows = workflowManager.getWorkflowsIncludingDrafts();
  for (JiraWorkflow workflow : existingWorkflows)
  {
    Collection<Status> linkStatuses = workflow.getLinkedStatusObjects();
    if (linkStatuses.contains(status))
    {
      throw new IllegalStateException("Cannot delete a status which is associated with a workflow. Status is associated with workflow " + workflow.getName());
    }
  }
  try
  {
    removeConstant(getIssueConstantField(), status, null);
  }
  catch (GenericEntityException | IndexException e)
  {
    throw new DataAccessException("Failed to remove status with id '" + id + "'", e);
  }
}

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