Example usage for com.liferay.portal.kernel.service WorkflowDefinitionLinkLocalServiceUtil getWorkflowDefinitionLinksCount

List of usage examples for com.liferay.portal.kernel.service WorkflowDefinitionLinkLocalServiceUtil getWorkflowDefinitionLinksCount

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service WorkflowDefinitionLinkLocalServiceUtil getWorkflowDefinitionLinksCount.

Prototype

public static int getWorkflowDefinitionLinksCount(long companyId, String workflowDefinitionName,
            int workflowDefinitionVersion) 

Source Link

Usage

From source file:com.liferay.journal.web.internal.display.context.JournalDisplayContext.java

License:Open Source License

public List<ManagementBarFilterItem> getManagementBarStatusFilterItems()
        throws PortalException, PortletException {

    List<ManagementBarFilterItem> managementBarFilterItems = new ArrayList<>();

    managementBarFilterItems.add(getManagementBarFilterItem(WorkflowConstants.STATUS_ANY));
    managementBarFilterItems.add(getManagementBarFilterItem(WorkflowConstants.STATUS_DRAFT));

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    int workflowDefinitionLinksCount = WorkflowDefinitionLinkLocalServiceUtil.getWorkflowDefinitionLinksCount(
            themeDisplay.getCompanyId(), themeDisplay.getScopeGroupId(), JournalFolder.class.getName());

    if (workflowDefinitionLinksCount > 0) {
        managementBarFilterItems.add(getManagementBarFilterItem(WorkflowConstants.STATUS_PENDING));
        managementBarFilterItems.add(getManagementBarFilterItem(WorkflowConstants.STATUS_DENIED));
    }/*w  w w.j  a v  a  2  s  .c  om*/

    managementBarFilterItems.add(getManagementBarFilterItem(WorkflowConstants.STATUS_SCHEDULED));
    managementBarFilterItems.add(getManagementBarFilterItem(WorkflowConstants.STATUS_APPROVED));
    managementBarFilterItems.add(getManagementBarFilterItem(WorkflowConstants.STATUS_EXPIRED));

    return managementBarFilterItems;
}