Workflow forms definition

Workflow forms are based on a 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 on our website at http://www.openkm.com/dtd/workflow-forms-{major}.{minor}.dtd where {major} and {minor} are two numbers (major release and minor release).
For example, the location of the version of the DTD of the version 1.0 is  https://www.openkm.com/dtd/workflow-form-1.0.dtd

Basic XML skeleton

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-form PUBLIC "-//OpenKM//DTD Workflow Form 1.0//EN"
                                "https://www.openkm.com/dtd/workflow-form-1.0.dtd">
<workflow-form>

</workflow-form>
  • The DOCTYPE is a formal definition of a DTD. In the previous example, the DTD is workflow-form-1.0.dtd.
  • The XML begins with the <workflow-form> tag and ends with </workflow-form>. This defines the workflow form structure.

Workflow task form definition

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-form PUBLIC "-//OpenKM//DTD Workflow Form 1.0//EN"
                                "https://www.openkm.com/dtd/workflow-form-1.0.dtd">
<workflow-form>

</workflow-form>
  • The <workflow-form> ... </workflow-form> block defines the workflow form structure.
  • Form elements are defined within the workflow-form tags.
AttributeDescriptionRequired

task

Unique field identifier.

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

The name must start with "okg:".

Do not use special characters in the task name. We suggest (0-9a-zA-Z_).

true

defaultValueClassName

Set custom JAVA class for setting initial default values.

false

Two form tasks can't have the same name.

Do not use special characters in the 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 is at Workflow fields 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-form PUBLIC "-//OpenKM//DTD Workflow Form 1.0//EN"
                                "https://www.openkm.com/dtd/workflow-form-1.0.dtd">
<workflow-form>
  <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>

Using a file system DTD

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

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

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

<!DOCTYPE workflow-form PUBLIC "-//OpenKM//DTD Workflow Form 1.0//EN"
                                 "file:///home/openkm/workflow-form-1.0.dtd">
  • In the example, /home/openkm/workflow-form-1.0.dtd is the file system path to the file.