Difference between revisions of "Examples: Purchase"
From OpenKM Documentation
(→Process definition) |
|||
(One intermediate revision by the same user not shown) | |||
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("From DENIED Go to END");</script> | <script>print("From DENIED Go to END");</script> | ||
</timer> | </timer> | ||
Line 78: | Line 78: | ||
[[Category: Workflow Guide]] | [[Category: Workflow Guide]] | ||
− |
Latest revision as of 11:16, 11 November 2014
Download and test this process definition: File:Purchase.par.
Process image
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 <= 500}"></condition>
</transition>
<transition to="manager" name="is expensive">
<condition expression="#{price.value > 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("From APPROVED Go to END");</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("From DENIED Go to END");</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>