@In is a Seam injection, and only works from inside Seam components.
Your "event java class" is not a Seam component, and cannot be as it
runs at a lower level than the Seam UI.
You can either reproduce what DocumentWorkflowActions does inside your
method (so, call wapi.startProcess by yourself), or use a Seam
listener instead of a core event listener. But they will both be
subtly different.
Florent
On 22 Sep 2008, at 18:18, [EMAIL PROTECTED] wrote:
> Hello,
>
> I need a workflow to be set on every documents that are about to be
> modified. A "request approval" workflow. I just want the same
> workflow as if I was going through the "TAB_CONTENT_REVIEW" page,
> selecting :
> - approval WF
> - modification allowed
>
> I configured an event Java class to be run when a document is
> modified.
> But in this very class, I cannot get the seam bean
> "documentWorkflowActions" :
>
> public class Event_StartWF extends AbstractEventListener implements
>
> AsynchronousEventListener {
>
> @In(required = false, create = true)
> protected transient DocumentWorkflowActions
> documentWorkflowActions;
>
> public void notifyEvent(CoreEvent coreEvent) throws
> WMWorkflowException {
> DocumentModel doc = (DocumentModel) coreEvent.getSource();
> process(doc);
> }
> public void process(DocumentModel doc) throws WMWorkflowException {
> documentWorkflowActions.startOneWorkflow();
> }
> }
>
>
> The bean documentWorkflowActions is always null.
> Is there any help for that. Am I on a wrong way to do this ?
>
> Has anyone done the pretty same feature, and maybe coded it
> differently ?
>
> Thank you all
> _______________________________________________
> ECM mailing list
> [email protected]
> http://lists.nuxeo.com/mailman/listinfo/ecm
--
Florent Guillaume, Director of R&D, Nuxeo
Open Source Enterprise Content Management (ECM)
http://www.nuxeo.com http://www.nuxeo.org +33 1 40 33 79 87
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm