Example usage for com.liferay.portal.kernel.workflow WorkflowStatusManagerUtil updateStatus

List of usage examples for com.liferay.portal.kernel.workflow WorkflowStatusManagerUtil updateStatus

Introduction

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

Prototype

public static void updateStatus(int status, Map<String, Serializable> workflowContext)
            throws WorkflowException 

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
}