Yes, if something is not working it's due to something else :)
You should check in your log, there's several mentions of "life cycle" in it when it's registered/used.

Florent

On 6 Jun 2007, at 13:40, Craig Pugsley wrote:

Hi Florent,

Thanks for your explanation. Could you please clarify a point for me: Does this mean that we're defining the new life cycle in the correct way, but that there is an issue elsewhere that is stopping it for working?

Thanks

CraigP

On 6 Jun 2007, at 6Jun-12:34, Florent Guillaume wrote:

Hi,

Please note that the com.sun.faces.lifecycle.LifecycleImpl has nothing to do with Nuxeo lifecycles. They are JSF lifecycle, and the message is an error due to the current implementation of JSF and Seam and Trinidad (and nothing we really can do anything about in the short term).

Florent

On 6 Jun 2007, at 12:26, Craig Pugsley wrote:

I'm using the newly-released (and very nice it is too!) v5.1-M3 installer (http://www.nuxeo.org/static/NuxeoEP/nuxeo-ep-5.1.0.M2- installer.jar) now and trying to enable workflow for my new document type.

Our new document type works in the UI, and I can successfully create a new document with it. However, no matter what I try, I can't seem to get the 'workflow' tab to appear on it in the Nuxeo workbench screen.

I've stumbled across the NXCore documentation (that I can see is replicated in the nuxeo book here: http://doc.nuxeo.org/1.0- SNAPSHOT/reference/html-single/nuxeo-book.html#nuxeo-core- reference).

This suggests that I define the life cycle I want the new document type to follow by defining the 'org.nuxeo.ecm.core.lifecycle.LifeCycleService' extension point for our data type. I've taken the 'lifecycle-contrib.xml' from the sample project, and modified this for our data type.

Changing the type in this xml file from 'Sample' to my custom data type 'Policy' and deploying into Jboss/Nuxeo now gives me this error when I create a new document of our custom data type:

10:34:24,790 ERROR [STDERR] Jun 6, 2007 10:34:24 AM com.sun.faces.lifecycle.LifecycleImpl phase WARNING: phase(RESTORE_VIEW 1,org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImp [EMAIL PROTECTED]) threw exception: java.lang.IllegalStateException: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed) No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed)
org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:153)

The 'lifecycle-contrib.xml' file in the sample project we're using looks like this:

<?xml version="1.0"?>
<component name="org.nuxeo.project.sample.lifecycle">
<extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService" point="lifecycle">
    <lifecycle name="policy" lifecyclemanager="jcrlifecyclemanager"
      initial="project">
      <states>
        <state name="project">
          <transitions>
            <transition>validate</transition>
          </transitions>
        </state>
        <state name="valid">
          <transitions>
            <transition>back_to_project</transition>
            <transition>make_obsolete</transition>
          </transitions>
        </state>
        <state name="obsolete">
        </state>
      </states>
      <transitions>
        <transition name="validate"
          destinationState="valid">
          <description>Validate</description>
        </transition>
<transition name="back_to_project" destinationState="project">
          <description>Back to project</description>
        </transition>
<transition name="make_obsolete" destinationState="obsolete">
          <description>Make obsolete</description>
        </transition>
      </transitions>
    </lifecycle>
  </extension>
<extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService" point="types">
    <types>
      <type name="Policy">policy</type>
    </types>
  </extension>
</component>

I have also tried simply using:

<?xml version="1.0"?>
<component name="org.nuxeo.project.sample.lifecycle">
<extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService" point="types">
    <types>
      <type name="Policy">default</type>
    </types>
  </extension>
</component>

and defining the type 'Policy' to use the 'default' life cycle definition, but this simply does nothing (not even the SEAM exception above).

Where I'm going wrong? Should I be looking at 'nxworkflow- document-rules-contrib.xml' as previously mentioned, or is this 'org.nuxeo.ecm.core.lifecycle.LifeCycleService' the right place to be enabling workflow for this new data type?

Thanks

Craig Pugsley
Technical Consultant

PolicyMatter
Solutions for compliance and risk management

+44 1189 301839
+44 8702 403620
www.policymatter.com


Begin forwarded message:

From: Craig Pugsley <[EMAIL PROTECTED]>
Date: 25 May 2007 10:48:44 BDT
To: Julien Anguenot <[EMAIL PROTECTED]>
Cc: [email protected]
Subject: Re: [Ecm] Enabling Workflow for new Document type

On 24 May 2007, at 16:08, Julien Anguenot wrote:

Hi Craig,

Craig Pugsley wrote:
We've created a new document type in Nuxeo and, with some excellent help from the people on this list, are now able to create new documents in
this new document type.

Our next mission with Nuxeo is to try and workflow these documents using Nuxeo's excellent workflow facilities. We know they're excellent, as we can create a 'Note' document (one of the default types) and put that
through a workflow process.

How would we go about enabling workflow for the new document type we've
just created?

Unfortunately, as far as we can see, we don't have much in the way of
documentation to help us understand how to enable workflow on our
document type. The closest seems to be this:

http://public.dev.nuxeo.com/~ogrisel/nuxeo-book/workflow- service.html

After some random looking through the code base, we have found a
'nxworkflow-document-rules-contrib.xml' in the
platform/nuxeo-platform-webapp-core project that seems to be where the
'Note' document type's workflow is defined.

We've created a local copy of this in our sample project and removed all but one of the doc type declarations, substituting the last one for our
document type. Needless to say this didn't work.

Did you think about referencing your new xml descriptor that contains
the workflow rules in the MANIFEST.MF of your bundle ?

As well, if you did a copy paste of an existing workflow rule did you think about changing the component name (name="") in the xml descriptor ?

Do not hesitate if you got more questions.

Cheers,

        J.

Hi there. Yes, I had guessed I had to do these things. We've created a 'nxworkflow-document-rules-contrib.xml' file in the OSGI-INF folder in the sample project, and have added a reference to this in the MANIFEST.MF:

nxworkflow-document-rules-contrib.xml:

<?xml version="1.0"?>
<component name="com.policymatter.workflow.nuxeo.workflowdocrules">
  <documentation>
  </documentation>
<require>org.nuxeo.ecm.platform.workflow.document.service.WorkflowR ulesService</require> <extension target="org.nuxeo.ecm.platform.workflow.document.service.WorkflowRu lesService" point="docTypeRule">
    <documentation>
Workflow document types rules contribution for <i>PolicyMatter</i> document type.
        <p/>
Defines allowed workflows for the <i>PolicyMatter</i> document type
    </documentation>
    <docTypeRule docType="Policy">
<workflowDefinition>document_review_parallel</ workflowDefinition> <workflowDefinition>document_review_serial</ workflowDefinition> <workflowDefinition>document_review_approbation</ workflowDefinition>
    </docTypeRule>
  </extension>
</component>

MANIFEST.MF:

Manifest-Version: 1.0
Bundle-ManifestVersion: 1
Bundle-Name: Nuxeo Sample project
Bundle-SymbolicName: org.nuxeo.project.sample;singleton:=true
Bundle-Version: 1.0.0
Bundle-Vendor: Nuxeo
Provide-Package: org.nuxeo.project.sample
Require-Bundle: org.nuxeo.runtime,
org.nuxeo.ecm.core.api,
org.nuxeo.ecm.core,
org.nuxeo.ecm.webapp.core,
Nuxeo-Component: OSGI-INF/core-types-contrib.xml,
OSGI-INF/ecm-types-contrib.xml,
OSGI-INF/lifecycle-contrib.xml,
OSGI-INF/event-listener-contrib.xml,
OSGI-INF/directories-contrib.xml,
OSGI-INF/nxworkflow-document-rules-contrib.xml,
OSGI-INF/theme-contrib.xml

Doing this was just pure guesswork on my part, as I have no idea what is required to enable workflow for this new document type. Therefore, there are probably other areas of Nuxeo that need to be told that we're now wanting to workflow this new document type. However, I can't seem to find any documentation on what is required to make this happen.

Interestingly, I do get this exception when I create a new document with our new document type:

org.nuxeo.ecm.core.api.ClientException: Unable to get allowed state transitions for document : 589f7a33- f6a1-4e2e-8aaa-536bcebb8d79 at org.nuxeo.ecm.core.api.AbstractSession.getAllowedStateTransitions (AbstractSession.java:1839)

...and:

10:29:44,201 INFO [LifeCycleServiceImpl] No life cycle associate to document type : ComplexType: Policy; [] 10:29:44,201 INFO [LifeCycleServiceImpl] No life cycle manager found for document type = ComplexType: Policy; [] check out your configuration.

...which suggests to me that there is somewhere else that I need to define a 'life cycle manager' to handle this new document type.

Is this documented anywhere and, if not, can someone suggest a list of config elements that I should look at and amend (over and above the 'nxworkflow-document-rules-contrib.xml' file)?

Thanks for your help

Craig Pugsley
Technical Consultant

PolicyMatter
Solutions for compliance and risk management

+44 1189 301839
+44 8702 403620
www.policymatter.com


_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

_______________________________________________
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







--
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

Reply via email to