use of org.alfresco.repo.workflow.BPMEngineRegistry in project acs-community-packaging by Alfresco.
the class StartWorkflowEvaluator method evaluate.
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node) {
FacesContext facesContext = FacesContext.getCurrentInstance();
NavigationBean nav = (NavigationBean) FacesHelper.getManagedBean(facesContext, NavigationBean.BEAN_NAME);
// determine whether the workflow services are active
boolean workflowPresent = false;
WebApplicationContext springContext = FacesContextUtils.getRequiredWebApplicationContext(facesContext);
BPMEngineRegistry bpmReg = (BPMEngineRegistry) springContext.getBean(BPM_ENGINE_BEAN_NAME);
if (bpmReg != null) {
String[] components = bpmReg.getWorkflowComponents();
workflowPresent = (components != null && components.length > 0);
}
return (workflowPresent && nav.getIsGuest() == false && node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION) == false);
}
Aggregations