Thanks Karnil for the response. But I am still struggling with this. Let me 
explain in detail what I've done:

I've a new xsd book2.xsd.

I've declared a new doctype Book2 in my core-types-contrib.xml
<doctype name="*Book2*" extends="Document">
      <schema name="common" />
      <schema name="dublincore" />
      <schema name="book2" />
      <schema name="file" />
      <schema name="uid" />
      <facet name="Commentable" />
      <facet name="Versionable" />
      <facet name="Indexable" />
    </doctype>

Declared a lifecycle for it in lifecycle-contrib.xml:
<?xml version="1.0"?>
<component name="org.nuxeo.project.sample.lifecycles">

  <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
    point="types">
    <types>
      <type name="Book">default</type>
       <type name="*Book2*">default</type>
    </types>
  </extension>

</component>

Declared UI types in ui-types-contrib.xml

<type id="Book2" coretype="Book2">
      <label>*Book2*</label>
      <icon>/icons/book.png</icon>
      <default-view>view_documents</default-view>
      <layouts mode="any">
        <layout>heading</layout>
        <layout>book2</layout>
        <layout>file</layout>
      </layouts>
    </type>

<type id="Folder" coretype="Folder">
      <subtypes>
        <type>Book</type>
        <type>Book2</type>
      </subtypes>
    </type>

    <type id="Workspace" coretype="Workspace">
      <subtypes>
        <type>Book</type>
        <type>*Book2*</type>
      </subtypes>
    </type>

Pointed to my new process definition in *workflow-contrib.xml*

<extension target="org.nuxeo.ecm.platform.jbpm.core.JbpmService"
                point="typeFilter">
                <type name="Book2">
                        
<processDefinition>book2ProcessDefinition</processDefinition>
                </type>
        </extension>
        
        <extension target="org.nuxeo.ecm.platform.jbpm.core.JbpmService"
                point="processDefinition">
                <processDefinition path="process/book2.xml"
                        deployer="ifChanged" />
        </extension>

To see the tab, I had to declare it in actions-contrib.xml as follows:

<extension target="org.nuxeo.ecm.platform.actions.ActionService"
                point="filters">
                <filter id="jbpm-process" append="true">
                        <rule grant="true">
                                <permission>Read</permission>
                                <type>Book</type>
                                <type>Book2</type>
                        </rule>
                </filter>
        </extension>

(The tab didn't show up when I used point="actions")

I've defined my process definition in book2.xml as follows (which is a very 
simple flow that has a start node and end node and prints a string as it 
transits.

?xml version="1.0"?>
<process-definition name="book2ProcessDefinition">
        <swimlane name="initiator2" />
        
        <!-- Start of the workflow -->
        <start-state name="start state 2">
                <transition name="start process 2" to="end2" >
                        <task swimlane="initiator2" name="start2" />
                        <action expression="#{numberGuess.helloWorld}"/>
                </transition>
        </start-state>

        

        <!--  End of the workflow  -->
        <end-state name="end2"/>
        

</process-definition>

I can actually see the tab for my doctype Book2 as follows:
=========================================================
Start a workflow
Please, fill up the workflow property form below
Select workflow type    
                                              document_book2ProcessDefinition
Destination lifecycle after workflow    
                                              Approved
                                              Obsolete
                                              Deleted
                                              Unchanged
=========================================================
Upon clicking the 'start' button, it doesn't seem to work. It throws the 
following exception:

2009-05-14 11:43:08,215 DEBUG 
[org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionImpl] closing connection: 
org.nuxeo.ecm.core.storage.sql.ra.connectioni...@a4273
2009-05-14 11:43:08,215 DEBUG 
[org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionImpl] cleanup: 
org.nuxeo.ecm.core.storage.sql.ra.managedconnectioni...@2d0f1d
2009-05-14 11:43:08,215 DEBUG 
[org.nuxeo.ecm.core.event.impl.AsyncEventExecutor] Async listener executed, 
commiting tx
2009-05-14 11:43:08,215 ERROR 
[org.nuxeo.ecm.core.event.impl.AsyncEventExecutor] Failed to execute async 
event workflowNewProcessStarted on listener auditLoggertListener
javax.ejb.EJBTransactionRolledbackException
        at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
        at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
        at 
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
        at 
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
        at 
org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
        at 
org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
        at $Proxy139.logEvents(Unknown Source)
        at 
org.nuxeo.ecm.platform.audit.listener.AuditEventLogger.handleEvent(AuditEventLogger.java:59)
        at 
org.nuxeo.ecm.core.event.impl.AsyncEventExecutor$Job.run(AsyncEventExecutor.java:109)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
        at 
org.nuxeo.ecm.platform.audit.service.NXAuditEventsService.logDocumentEvent(NXAuditEventsService.java:598)
        at 
org.nuxeo.ecm.platform.audit.service.NXAuditEventsService.logEvent(NXAuditEventsService.java:568)
        at 
org.nuxeo.ecm.platform.audit.service.NXAuditEventsService.logEvents(NXAuditEventsService.java:557)
        at 
org.nuxeo.ecm.platform.audit.ejb.LogsBean.logEvents(LogsBean.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
        at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
        at 
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
        at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
        ... 22 more
2009-05-14 11:43:08,278 DEBUG 
[org.nuxeo.ecm.core.event.tx.EventBundleTransactionHandler] Rolling back 
transaction
2009-05-14 11:43:08,278 DEBUG 
[org.nuxeo.ecm.core.storage.sql.PersistenceContext] Saving persistence context
2009-05-14 11:43:08,278 DEBUG 
[org.nuxeo.ecm.core.storage.sql.PersistenceContext] End of save
2009-05-14 11:43:08,278 DEBUG 
[org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionImpl] closeConnections: 
org.nuxeo.ecm.core.storage.sql.ra.managedconnectioni...@195a679
2009-05-14 11:43:08,278 DEBUG 
[org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionImpl] closing connection: 
org.nuxeo.ecm.core.storage.sql.ra.connectioni...@1b64769
2009-05-14 11:43:08,278 DEBUG 
[org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionImpl] cleanup: 
org.nuxeo.ecm.core.storage.sql.ra.managedconnectioni...@195a679
2009-05-14 11:43:08,278 DEBUG [org.nuxeo.ecm.core.api.ejb.DocumentManagerBean] 
@Remove
2009-05-14 11:43:08,278 DEBUG [org.nuxeo.ecm.core.api.ejb.DocumentManagerBean] 
@PreDestroy

Any ideas about what I'm missing in this?

Thanks,
UR
--
Posted by "uraj" at Nuxeo Discussions <http://nuxeo.org/discussions>
View the complete thread: 
<http://www.nuxeo.org/discussions/thread.jspa?threadID=2411#6661>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to