Examples: Purchase
From OpenKM Documentation
Revision as of 14:11, 20 July 2011 by Pavila (talk | contribs) (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…')
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">
<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>