Basic workflow sample

Download the sample code  Simple.par.

Process Image

Process definition

<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="" name="simple">
  <start-state name="start">
    <transition name="to_state" to="state"></transition>
    <event type="node-leave">
        print(&quot;Node start&quot;);
  <state name="state">
    <event type="node-enter">
        print(&quot;Node state&quot;);
    <transition name="to_end" to="end">
      <action name="action" class="com.openkm.sample.MessageActionHandler">
        <message>About to finish!</message>
  <end-state name="end">
    <event type="node-enter">
        print(&quot;Node end (&quot;+executionContext.getVariable(&quot;message&quot;)+&quot;)&quot;);

Process handlers

package com.openkm;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
public class MessageActionHandler implements ActionHandler {
  private static final long serialVersionUID = 1L;
   * The message member gets its value from the configuration in the 
   * processdefinition. The value is injected directly by the engine. 
  String message;
   * A message process variable is assigned the value of the message
   * member. The process variable is created if it doesn't exist yet.
  public void execute(ExecutionContext context) throws Exception {
    context.getContextInstance().setVariable("message", message);
    System.out.println("From MessageActionHandler...");

Form definition

This sample has not a form definition.