Hi,

Nel Taurisson a écrit :
Hy,

What is the correct way of following a lyfe cycle transition in an action.

I've definied a life cycle (the document gets it assigned correctly), then in an action I've tried the following which throws an exception :

[...]

This code seems to be good.

Here's the life cycle definition :

<extension target=" org.nuxeo.ecm.core.lifecycle.LifeCycleService" point="lifecycle">

    <lifecycle name="issue-lf" lifecyclemanager="jcrlifecyclemanager"
      initial="opened">

      <states>
        <state name="opened">
          <transitions>
            <transition>close</transition>
            <transition>assign</transition>
          </transitions>
        </state>
        <state name="assigned">
          <transitions>
            <transition>close</transition>
            <transition>assign</transition>
          </transitions>
        </state>
        <state name="closes">
          <transitions>
            <transition>reopen</transition>
          </transitions>
        </state>
      </states>

      <transitions>
        <transition name="close" destinationState="closed">
          <description>Close Issue</description>
        </transition>
        <transition name="assign" destinationState="assigned">
          <description>Assign Issue</description>
        </transition>
        <transition name="reopen" destinationState="opened">
          <description>Re open Issue</description>
        </transition>
      </transitions>
    </lifecycle>
  </extension>

<extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService" point="types">
    <types>
      <type name="Issue">issue-lf</type>
    </types>
  </extension>

And here's the exception reported :

[...]

There's an ugly bug in the life cycle registration when you define states before transitions :
http://jira.nuxeo.org/browse/NXP-1472

Move your states definitions and it should work fine.

Regards,

--
Anahide Tchertchian, Nuxeo
Mail: [EMAIL PROTECTED] - Tel: +33 (0)1 40 33 79 87
http://www.nuxeo.com - http://www.nuxeo.org
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to