Workflow forms definition

Workflow forms are based on formal XML definition. The DTD ( Document Type Definition ) defines the structure and the legal elements and attributes of an XML document.

You can see the latest DTD in our website http://www.openkm.com/dtd/workflow-forms-{major}.{minor}.dtd where {major} and {minor} values are two numbers ( major release and minor release ). For example the location for version 2.6 of the dtd is http://www.openkm.com/dtd/workflow-forms-2.6.dtd

Each application version supports only a couple of DTD definitions, read: Application version compatibility table to see which are supported by your application.

Basic XML skeleton

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.6//EN"
                                "http://www.openkm.com/dtd/workflow-forms-2.6.dtd">
<workflow-forms>

</workflow-forms>
  • The DOCTYPE is a formal definition of some DTD. In the previous example the workflow-forms-2.6.dtd.
  • The XML begins with <workflow-forms> tag and ends with </workflow-forms>. Into this hicheracy are defined the metada groups.

Workflow task 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="evaluate price">

  </workflow-form>
</workflow-forms>
  • Each  <workflow-form> ... </workflow-form>   block identify the beginning and end of new workflow form task definition.
  • Each task has a unique name, "evaluate price".
  • Must not use special characters for name.
AttributeDescriptionRequired

task

Unique field identifier.

Two metadata groups can't have the same name. Name must be unique.

The name must start with "okg:".

Must not use special character for task name. We suggest (0-9a-zA-Z_).

true

defaultValueClassName

Set custom JAVA class for setting initial default values.

false

Two form task can't have the same name.

Must not use special character for task name. We suggest (0-9a-zA-Z_).

Basic example

Available field types:

  • Checkbox
  • Button
  • Download
  • Input
  • Iframe
  • Select
  • Separator
  • Suggestbox
  • Text
  • TextArea
  • Upload
  • VerticalPanel
  • HorizontalPanel

More information about field type elements at Workflow fields 

<?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="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>

Using file system DTD

If the server has no access to the Internet, then the DTD file must be accessible in some way, for example can store a copy in your application server.

The XML definition must be changed to refer to the new DTD location, otherwise you will get and application error while trying to process a DTD file.

It can be a file system ( example below ) or a valid intranet URL.

<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.6//EN"
                                 "file:///home/openkm/workflow-forms-2.6.dtd">
  • In the example, /home/openkm/workflow-forms-2.6.dtd is the file system path to the file.