Hi!

Thanks for the quick reply. Works perfectly!

Regards
Christoph
I am using Lenya1.2 right now. I'm trying to write a custom Workflow-Condition. To do so my Java-class extends org.apache.lenya.workflow.impl.AbstractCondition.

The condition is intended to compare the current user with the creator of a document. I managed to get the current user:
CMSSituation situationImpl = (CMSSituation) situation;
String currentUser = situationImpl.getUserId();
But I'm struggeling to get access to the Creator of the Document. My first idea was to use the DublinCore-class of a document to access the meta-data of the document. Unfortunately I didn't find a way to retrieve the current Document.

2)Has anyone an idea how this could work?

This could work - beware of typos :)


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);
}

_________________________________________________________________
Die neue MSN Suche Toolbar mit Windows-Desktopsuche. Suchen Sie gleichzeitig im Web, Ihren E-Mails und auf Ihrem PC! Jetzt neu! http://desktop.msn.de/ Jetzt gratis downloaden!


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to