As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
import javax.faces.context.FacesContext; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.web.action.ActionEvaluator; import org.alfresco.web.app.servlet.FacesHelper; import org.alfresco.web.bean.repository.Node; import org.alfresco.service.namespace.QName; public class WorkflowEvaluator implements ActionEvaluator { public static final QName MY_TYPE = QName.createQName("my.documents.model", "mydocument"); public WorkflowEvaluator() { } public boolean evaluate(Node node) { boolean res = false; if(node.getType().isMatch(MY_TYPE) ) res = true; return res; } }
<config> <actions> <action id="start_workflow"> <label-id>start_workflow</label-id> <image>/images/icons/new_workflow.gif</image> <evaluator>com.myapplication.evaluator.WorkflowEvaluator</evaluator> <action>wizard:startWorkflow</action> <action-listener>#{WizardManager.setupParameters}</action-listener> <params> <param name="item-to-workflow">#{actionContext.id}</param> </params> </action> </actions> </config>