How can I define a custom workflow with two states or more? I test with 
the following definition:

    <event type="process-start">
        <script><expression>
                executionContext.setVariable("workflow_review_type",
                "ofertas");
                System.out.println("Setting workflow review type....");
                executionContext.setVariable("workflowDirectives", new
                String[] {"workflowDirectiveCheck",
                "workflowDirectiveDiffusion",
                "workflowDirectiveOpinion"});
                System.out.println("Setting work item directives for
                this process definition ....");
            </expression>
           


       
        </script>
    </event>

    <start-state name="start">
        <transition name="create" to="draft">
            <action 
class="org.nuxeo.ecm.platform.workflow.jbpm.handlers.StartupActionHandler"/>
        </transition>
    </start-state>

    <task-node name="draft" create-tasks="false" end-tasks="true" 
signal="last-wait">
        <event type="node-enter">
            <action 
class="org.nuxeo.ecm.platform.workflow.jbpm.handlers.EnterNodeActionHandler"/>
        </event>
        <task name="draft">
            <assignment 
class="org.nuxeo.ecm.platform.workflow.jbpm.handlers.NuxeoAssignmentHandler"/>
        </task>
        <transition name="propose" to="proposed">
            <action 
class="es.yerbabuena.ofertas.workflow.ToProposedActionHandler"/>
        </transition>
    </task-node>

    <task-node name="proposed" create-tasks="false" end-tasks="true" 
signal="last-wait">
        <task name="proposed">
            <assignment 
class="org.nuxeo.ecm.platform.workflow.jbpm.handlers.NuxeoAssignmentHandler" 
/>
        </task>
        <event type="node-enter">
            <action 
class="org.nuxeo.ecm.platform.workflow.jbpm.handlers.EnterNodeActionHandler"/>
        </event>
        <transition to="end">
            <action 
class="es.yerbabuena.ofertas.workflow.ToAcceptActionHandler"/>
        </transition>
    </task-node>

    <end-state name="end"/>
</process-definition>

But the workflow never enter in the task proposed.

I think that I must use lifecycle, so I define the following one:

<?xml version="1.0"?>

<component name="es.yerbabuena.ofertas.lifecycle">

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

        <lifecycle name="ofertaslifecycle"
            lifecyclemanager="jcrlifecyclemanager" initial="draft">

            <states>
                <state name="project">
                    <transitions>
                        <transition>create</transition>
                        <transition>delete</transition>
                        <transition>propose</transition>
                    </transitions>
                </state>
                <state name="draft">
                    <transitions>
                        <transition>propose</transition>
                        <transition>delete</transition>
                    </transitions>
                </state>
                <state name="proposed">
                    <transitions>
                        <transition>reject</transition>
                        <transition>accept</transition>
                        <transition>delete</transition>
                    </transitions>
                </state>
                <state name="rejected">
                    <transitions>
                        <transition>delete</transition>
                    </transitions>
                </state>
                <state name="accepted">
                    <transitions>
                        <transition>delete</transition>
                    </transitions>
                </state>
                <state name="deleted"
                    description="Document is deleted">
                </state>
            </states>

            <transitions>
                <transition name="create" destinationState="draft">
                    <description>Create</description>
                </transition>
                <transition name="propose"
                    destinationState="proposed">
                    <description>Proposed</description>
                </transition>
                <transition name="reject" destinationState="rejected">
                </transition>
                <transition name="accept" destinationState="accepted">
                </transition>
                <transition name="delete" destinationState="deleted">
                    <description>
                        Move document to trash (temporary delete)
                    </description>
                </transition>
            </transitions>
        </lifecycle>
    </extension>

    <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
        point="types">
        <types>
            <type name="Ofertas">ofertaslifecycle</type>
        </types>
    </extension>

</component>


But when I do (in the action class of the transition "propose"):

String transition = 
getLifeCycleTransitionToDestinationState(executionContext);

transition has a null value. Do I have to bind the workflow and the 
lifecycle? Has anybody done something similar?

Thanks in advance.

Regards.

-- 
Enrique Pérez Olivares.
Dpto I+D.
Yerbabuena Software.
[EMAIL PROTECTED]
http://www.yerbabuena.es
Tlf/Fax: 902 995 246 

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

Reply via email to