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.WorkflowRulesS
ervice</require>
<extension
target="org.nuxeo.ecm.platform.workflow.document.service.WorkflowRulesSe
rvice" 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