lenya-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Hartmann <andr...@apache.org>
Subject Workflow definition document
Date Tue, 03 Jun 2003 10:41:31 GMT
Hi Lenya developers,

could you please discuss the following draft of a workflow
definition document:



--------------------
a) general + fexible
--------------------

<workflow xmlns="http://apache.org/cocoon/lenya/workflow/1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://apache.org/cocoon/lenya/workflow/1.0
         ../../../resources/entities/workflow/workflow.xsd">

   <!-- ====================================================
     Declaration of action and condition types
     As the workflow model basically allows different kinds
     of actions and conditions, I we could allow the
     declaration of types.
   ==================================================== -->

   <condition-type name="role"
     class="org.apache.lenya.cms.workflow.RoleCondition"/>
   <condition-type name="variable"
     class="org.apache.lenya.workflow.impl.VariableCondition"/>

   <action-type name="cms"
      class="org.apache.lenya.cms.workflow.CMSAction"/>
   <action-type name="assign"
     class="org.apache.lenya.workflow
            .impl.BooleanVariableAssignmentImpl"/>

   <state id="redaktion" initial="true"/>
   <state id="review"/>
   <state id="live"/>

   <!-- ====================================================
     Variable declarations
     The model only allows boolean variables, so it makes no
     sense to declare variable types.
   ==================================================== -->

   <variable name="is-live" value="false"/>

   <!-- ====================================================
     Transitions
     Event: A transition is triggered by exactly one event with no
            further options, therefore it is expressed as an attribute.
     Conditions: Multiple conditions are allowed, they can be
            configured. I suggest to use condition elements with
            nested configuration (usually an expression).
     Assignments: In this example, assignments are expressed as
            a certain type of action.
   ==================================================== -->

   <transition event="publish" source="redaktion" destination="review">
     <condition type="role">editor</condition>
   </transition>

   <transition event="approve"
       source="review" destination="live">
     <condition type="role">manager</condition>
     <action type="assign">is-live = true</action>
     <action type="cms">publish</action>
   </transition>

   <transition event="disapprove"
       source="review" destination="redaktion">
     <condition type="role">manager</condition>
   </transition>

   <transition event="edit"
       source="live" destination="redaktion">
     <condition type="role">editor</condition>
     <action type="cms">save</action>
   </transition>

   <transition event="edit"
       source="redaktion" destination="redaktion">
     <condition type="role">editor</condition>
     <action type="cms">save</action>
   </transition>

   <transition event="deactivate"
       source="redaktion" destination="redaktion">
     <condition type="variable">is-live = true</condition>
     <action type="assign">is-live = false</action>
     <action type="task">delete-live-document</action>
   </transition>

</workflow>



-------------------------
b) simple + less flexible
-------------------------

<workflow xmlns="http://apache.org/cocoon/lenya/workflow/1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://apache.org/cocoon/lenya/workflow/1.0
         ../../../resources/entities/workflow/workflow.xsd">

   <state id="redaktion" initial="true"/>
   <state id="review"/>
   <state id="live"/>

   <variable name="is-live" value="false"/>

   <!-- ====================================================
     Transitions
     Event: A transition is triggered by exactly one event with no
            further options, therefore it is expressed as an attribute.
     Conditions: Every condition type (variable / role) is expressed
            by a certain predefined element or attribute.
     Assignments: Special elements for assignments.
   ==================================================== -->

   <transition event="publish" source="redaktion" destination="review">
     <condition type="role" value="editor"/>
   </transition>

   <transition event="approve"
       source="review" destination="live">
     <role>manager</role>
     <assign variable="is-live" value="true"/>
     <action>publish</action>
   </transition>

   <transition event="disapprove"
       source="review" destination="redaktion">
     <role>manager</role>
   </transition>

   <transition event="edit"
       source="live" destination="redaktion">
     <role>editor</role>
     <action>save</action>
   </transition>

   <transition event="edit"
       source="redaktion" destination="redaktion">
     <role>editor</role>
     <action>save</action>
   </transition>

   <transition event="deactivate"
       source="redaktion" destination="redaktion">
     <check variable="is-live" value="true"/>
     <assign variable="is-live" value="false"/>
     <action>delete-live-document</action>
   </transition>

</workflow>

What do you think?

Thanks,
Andreas



---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Mime
View raw message