OKMWorkflow

From OpenKM Documentation
Jump to: navigation, search

Contents


Methods related to workflow creation and management.

void registerProcessDefinition(String token, byte[] pda)

Login into the repository and gets a token with user info for future API invocations

Parameters

  • token - The session authorization token.
  • pda - Byte array where process definition can be readed.

Returns

  • None.

Throws

  • ParseException If there is an error parsing the forms.xml file.
  • RepositoryException If there is a general repository error.
  • DatabaseException If there is a general database error.
  • WorkflowException If there is any workflow engine error.

void deleteProcessDefinition(String token, long processDefinitionId)

Delete a previously registered process definition.

Parameters

  • token The session authorization token.
  • processDefinitionId Process definition identifier.

Returns

  • None.

Throws

  • RepositoryException If there is a general repository error.
  • DatabaseException If there is a general database error.
  • WorkflowException If there is any workflow engine error.

ProcessDefinition getProcessDefinition(String token, long processDefinitionId)

Gets a process definition from the engine by the identifier.

Parameters

  • token The session authorization token.
  • processDefinitionId Process definition identifier.

Returns

  • The process definition object.

Throws

  • RepositoryException If there is a general repository error.
  • DatabaseException If there is a general database error.
  • WorkflowException If there is any workflow engine error.

getProcessDefinitionImage(String token, long processDefinitionId, String node)

Get a visual representation of the process definition.

Parameters

  • token The session authorization token.
  • processDefinitionId Process definition identifier.
  • node Mark the designed node as active, if not null.

Returns

  • A byte array with the image in JPG format.

Throws

  • RepositoryException If there is a general repository error.
  • DatabaseException If there is a general database error.
  • WorkflowException If there is any workflow engine error.

getProcessDefinitionForms(String token, long processDefinitionId)

Obtain a map with the forms defined in the process definition.

Parameters

  • token The session authorization token.
  • processDefinitionId Process definition identifier.

Returns

  • A map with the fields of each process definition form.

Throws

  • ParseException If there is an error parsing the forms.xml file.
  • RepositoryException If there is a general repository error.
  • DatabaseException If there is a general database error.
  • WorkflowException If there is any workflow engine error.

runProcessDefinition(String token, long processDefinitionId, String uuid, List<FormElement> vars)

Run a process definition to create a process instance: begins a worflow process.

Parameters

  • token The session authorization token.
  • processDefinitionId Process definition identifier.
  • uuid Node identifier associated with the created process instance.
  • vars A list of form elements with variable definitions.

Returns

  • The created process instance.

Throws

  • RepositoryException If there is a general repository error.
  • DatabaseException If there is a general database error.
  • WorkflowException If there is any workflow engine error.