Example usage for com.liferay.portal.kernel.workflow WorkflowConstants getLabelStatus

List of usage examples for com.liferay.portal.kernel.workflow WorkflowConstants getLabelStatus

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.workflow WorkflowConstants getLabelStatus.

Prototype

public static int getLabelStatus(String label) 

Source Link

Usage

From source file:de.iisys.service.impl.CamundaServiceImpl.java

License:Open Source License

public void updateStatus(String status, Map<String, Serializable> context) throws Exception {
    ServiceContext svcCont = null;

    //      HttpServletRequest request = AccessControlUtil
    //            .getAccessControlContext().getRequest();

    // reconstruct service context from request
    // Caution: causes Exceptions in the backend since requests/servlets are not thread safe
    //      svcCont = ServiceContextFactory.getInstance(request);
    //      context.put("serviceContext", svcCont);

    // construct service context from parameters
    svcCont = ContextUtil.getServiceContext(context);
    context.put("serviceContext", svcCont);

    WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.getLabelStatus(status), context);

    // TODO: delete link? appears to be necessary
    WorkflowInstanceLinkLocalServiceUtil.deleteWorkflowInstanceLinks(
            Long.valueOf(context.get("companyId").toString()), Long.valueOf(context.get("groupId").toString()),
            context.get("entryClassName").toString(), Long.valueOf(context.get("entryClassPK").toString()));

    // no worky - tries deleting the workflow
}