Difference between revisions of "Examples: Medium"

From OpenKM Documentation
Jump to: navigation, search
(Form definition)
m (Reverted edits by Suresh.grandhi.npb (Talk) to last revision by Pavila)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{TOCright}} __TOC__
 
{{TOCright}} __TOC__
 +
 +
Download and test this process definition: [[File:Medium.par]].
 +
 +
If you see log messages like these, don't worry because are normal:
 +
 +
  INFO  [JpdlXmlReader] process xml information: no swimlane or assignment specified for task
 +
  '<task xmlns="urn:jbpm.org:jpdl-3.2" name="start" blocking="false" signalling="true" priority="normal" notify="false">
 +
    <description>Task sample</description>
 +
  </task>'
 +
  WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
 +
  WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
 +
  WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
  
 
== Process image ==
 
== Process image ==
<center>[[File:Workflow example medium.png]]</center>
+
[[File:Workflow example medium.png|center]]
  
 
== Process definition ==
 
== Process definition ==
Line 49: Line 61:
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<forms xmlns="http://www.openkm.com/xsd/forms-1.0.xsd"
+
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 1.1//EN"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
                                "http://www.openkm.com/dtd/workflow-forms-1.1.dtd">
      xsi:schemaLocation="http://www.openkm.com/xsd forms-1.0.xsd">
+
<workflow-forms>
   <form task="start">
+
   <workflow-form task="start">
    <input label="Quantity" name="quantity" value="10"/>
+
  <input label="Quantity" name="quantity" value="10"/>
    <button label="Save" />
+
  <button name="save" label="Save" />
   </form>
+
   </workflow-form>
   <form task="user_info">
+
   <workflow-form task="user_info">
 
     <input label="Name" type="text" name="name" value="John" />
 
     <input label="Name" type="text" name="name" value="John" />
 
     <input label="Surname" type="text" name="surname" value="Doe" />
 
     <input label="Surname" type="text" name="surname" value="Doe" />
 
     <textarea label="Info" name="info" value=""/>
 
     <textarea label="Info" name="info" value=""/>
 
     <select label="Type" name="type" type="simple">
 
     <select label="Type" name="type" type="simple">
       <option name="Type 1" value="t1" />
+
       <option label="Type 1" value="t1" />
       <option name="Type 2" value="t2" selected="true" />
+
       <option label="Type 2" value="t2" selected="true" />
       <option name="Type 3" value="t3" />
+
       <option label="Type 3" value="t3" />
 
     </select>
 
     </select>
     <button label="Goto 1" value="route 1" type="transition" />
+
     <button name="goto1" label="Goto 1" value="route 1" type="transition" />
     <button label="Goto 2" value="route 2" type="transition" />
+
     <button name="goto2" label="Goto 2" value="route 2" type="transition" />
   </form>
+
   </workflow-form>
</forms>
+
</workflow-forms>
 
</source>
 
</source>
  
 
[[Category: Workflow Guide]]
 
[[Category: Workflow Guide]]
--[[User:Pavila|Pavila]] 09:39, 26 January 2010 (UTC)
 

Latest revision as of 07:48, 6 March 2012

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

If you see log messages like these, don't worry because are normal:

 INFO  [JpdlXmlReader] process xml information: no swimlane or assignment specified for task
 '<task xmlns="urn:jbpm.org:jpdl-3.2" name="start" blocking="false" signalling="true" priority="normal" notify="false">
   <description>Task sample</description>
 </task>'
 WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
 WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
 WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==

Process image

Workflow example medium.png

Process definition

<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="medium">
  <start-state name="start-state1">
    <task name="start">
      <description>Task sample</description>
    </task>
    <transition to="task-node1"></transition>
  </start-state>

  <task-node name="task-node1">
    <task name="user_info" priority="low">
      <assignment actor-id="okmAdmin"></assignment>
      <event type="task-create">
        <script>taskInstance.start();</script>
      </event>
    </task>
    <transition to="end-state1" name="route 1">
      <script>print(&quot;Going through: route 1&quot;);</script>
    </transition>
    <transition to="end-state1" name="route 2">
      <script>print(&quot;Going through: route 2&quot;);</script>
    </transition>
  </task-node>

  <end-state name="end-state1">
    <event type="node-enter">
      <script name="mensajes">
        print(&quot;End node reached: &quot;+node);
        print(&quot;Var 'quantity': &quot;+executionContext.getVariable(&quot;quantity&quot;));
        print(&quot;Var 'name': &quot;+executionContext.getVariable(&quot;name&quot;));
        print(&quot;Var 'type': &quot;+executionContext.getVariable(&quot;type&quot;));
      </script>
    </event>
  </end-state>
</process-definition>

Process handlers

None

Form definition

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 1.1//EN"
                                "http://www.openkm.com/dtd/workflow-forms-1.1.dtd">
<workflow-forms>
  <workflow-form task="start">
  	<input label="Quantity" name="quantity" value="10"/>
  	<button name="save" label="Save" />
  </workflow-form>
  <workflow-form task="user_info">
    <input label="Name" type="text" name="name" value="John" />
    <input label="Surname" type="text" name="surname" value="Doe" />
    <textarea label="Info" name="info" value=""/>
    <select label="Type" name="type" type="simple">
      <option label="Type 1" value="t1" />
      <option label="Type 2" value="t2" selected="true" />
      <option label="Type 3" value="t3" />
    </select>
    <button name="goto1" label="Goto 1" value="route 1" type="transition" />
    <button name="goto2" label="Goto 2" value="route 2" type="transition" />
  </workflow-form>
</workflow-forms>