Difference between revisions of "Examples: Purchase"

From OpenKM Documentation
Jump to: navigation, search
(Created page with '{{TOCright}} __TOC__ Download and test this process definition: File:Purchase.par. {{Note|The taks will be assigned to an user called "monkiki" so you need to create this u…')
 
(Process definition)
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
Download and test this process definition: [[File:Purchase.par]].
 
Download and test this process definition: [[File:Purchase.par]].
  
{{Note|The taks will be assigned to an user called "monkiki" so you need to create this user and log as him to see the task assignment. Also you can assing this task to another user from the process instance workflow administration.}}
+
{{Note|The taks will be assigned to an user called "manager" so you need to create this user and log as him to see the task assignment. Also you can assing this task to another user from the process instance workflow administration.}}
  
 
== Process image ==
 
== Process image ==
Line 44: Line 44:
 
   <state name="denied">
 
   <state name="denied">
 
     <description>The purchase has been denied.</description>
 
     <description>The purchase has been denied.</description>
     <timer duedate="15 seconds" name="denied timer">
+
     <timer duedate="15 seconds" name="denied timer" transition="toend">
 
       <script>print(&quot;From DENIED Go to END&quot;);</script>
 
       <script>print(&quot;From DENIED Go to END&quot;);</script>
 
     </timer>
 
     </timer>
Line 78: Line 78:
  
 
[[Category: Workflow Guide]]
 
[[Category: Workflow Guide]]
[[Category:OKM Network]]
 

Latest revision as of 11:16, 11 November 2014

Download and test this process definition: File:Purchase.par.


Nota clasica.png The taks will be assigned to an user called "manager" so you need to create this user and log as him to see the task assignment. Also you can assing this task to another user from the process instance workflow administration.

Process image

Workflow example purchase.png

Process definition

<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="purchase">
  <start-state name="start">
    <transition to="decision"></transition>
  </start-state>

  <decision name="decision">
    <transition to="approved" name="is cheap">
      <condition expression="#{price.value &lt;= 500}"></condition>
    </transition>
    <transition to="manager" name="is expensive">
      <condition expression="#{price.value &gt; 500}"></condition>
    </transition>
  </decision>

  <task-node name="manager">
    <task name="evaluate price">
      <description>The manager may deny purchase or go ahead.</description>
      <assignment actor-id="manager"></assignment>
    </task>
    <transition to="denied" name="deny"></transition>
    <transition to="approved" name="approve"></transition>
  </task-node>

  <state name="approved">
    <description>The purchase has been approved.</description>
    <timer duedate="15 seconds" name="approved timer" transition="toend">
      <script>print(&quot;From APPROVED Go to END&quot;);</script>
    </timer>
    <transition to="end" name="toend"></transition>
  </state>

  <state name="denied">
    <description>The purchase has been denied.</description>
    <timer duedate="15 seconds" name="denied timer" transition="toend">
      <script>print(&quot;From DENIED Go to END&quot;);</script>
    </timer>
    <transition to="end" name="toend"></transition>
  </state>

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

Process handlers

None.

Form definition

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.0//EN"
                                "http://www.openkm.com/dtd/workflow-forms-2.0.dtd">
<workflow-forms>
  <workflow-form task="run_config">
    <input label="Purchase price" name="price" />
    <textarea label="Purchase description" name="description" />
    <button name="submit" label="Submit" />
  </workflow-form>
  <workflow-form task="evaluate price">
    <input label="Purchase price" name="price" data="price" readonly="true" />
    <textarea label="Purchase description" name="description" data="description" readonly="true" />
    <button name="approve" label="Approve" transition="approve"/>
    <button name="deny" label="Deny" transition="deny"/>
  </workflow-form>
</workflow-forms>