Here's an example for a custom workflow action which is complied when the current user is the creator of the document:

public class CreatorCondition extends AbstractCondition {

    public boolean isComplied(situation, instance) {

        WorkflowDocument wfDoc = (WorkflowDocument) instance;
        Document doc = wfDoc.getDocument();

        String creator = doc.getDublinCore()
                            .getFirstValue(DublinCore.ELEMENT_CREATOR);

        CMSSituation situationImpl = (CMSSituation) situation;
        String currentUser = situationImpl.getUserId();

        return creator != null && creator.equals(currentUser);
    }

}

  • No labels