OKMWorkflow

On all methods you'll see parameter named "token". When accessing application across SOAP the login process returns a token, what is used to identify the user on all the exposed methods. From default application execution context you must use "null" value what indicates to the application must use the "user session".

On special cases you might be "promoted as Administrator" using the "administrator token".

String systemToken = DbSessionManager.getInstance().getSystemToken();

Methods

registerProcessDefinition

Description:

MethodReturn valuesDescription

registerProcessDefinition(String token, InputStream is)

void

Registers a new workflow.

Example:

package com.openkm;

import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            InputStream is = new FileInputStream("/opt/files/Purchase.par");
            OKMWorkflow.getInstance().registerProcessDefinition(null, is);
            IOUtils.closeQuietly(is);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

deleteProcessDefinition

Description:

MethodReturn valuesDescription

deleteProcessDefinition(String token, long processDefinitionId)

void

Deletes a workflow.

The parameter processDefinitionId value is a valid workflow process definition.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long pdId = 5; // Valid workflow process definition
            OKMWorkflow.getInstance().deleteProcessDefinition(null, pdId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getProcessDefinitionImage

Description:

MethodReturn valuesDescription

getProcessDefinitionImage(String token, long processDefinitionId, String node)

byte[]

Returns a workflow image process definition.

The parameter processDefinitionId value is a valid workflow process definition.

The parameter node is a node with a workflow in execution.

Example:

package com.openkm;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;

import org.apache.commons.io.IOUtils;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long pdId = 5; // Valid workflow process definition
            byte[] img = OKMWorkflow.getInstance().getProcessDefinitionImage(null, pdId, "/okm:root/sample.pdf");
            ByteArrayInputStream in = new ByteArrayInputStream(img);
            FileOutputStream out = new FileOutputStream(new File("/home/test/img.jpg"));
            IOUtils.copy(in, out);
            IOUtils.closeQuietly(in);
            IOUtils.closeQuietly(out);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getProcessDefinitionForms

Description:

MethodReturn valuesDescription

Map<String, List<FormElement>> getProcessDefinitionForms(String token, long processDefinitionId)

Map<String, List<FormElement>>

Returns a map with all workflow form definitions.

The parameter processDefinitionId value is a valid workflow process definition.

Example:

package com.openkm;

import java.util.List;
import java.util.Map;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.form.FormElement;

public class Test {
    public static void main(String[] args) {
        try {
            long pdId = 5; // Valid workflow process definition
            Map<String,List<FormElement>> map = OKMWorkflow.getInstance().getProcessDefinitionForms(null, pdId);
            for (String key : map.keySet()) {
                System.out.println("group:"+key);
                for (FormElement fe : map.get(key)) {
                    System.out.println(fe);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

runProcessDefinition

Description:

MethodReturn valuesDescription

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

ProcessInstance

Executes a workflow on a node.

The parameter processDefinitionId value is a valid workflow process definition.

The parameter uuid can be any document, mail, or folder UUID.

The parameter values are form element values needed for starting the workflow ( not all workflows need form values for starting ).

Example:

package com.openkm;

import java.util.ArrayList;
import java.util.List;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.form.FormElement;
import com.openkm.bean.form.Input;
import com.openkm.bean.form.TextArea;

public class Test {
    public static void main(String[] args) {
        try {
            long pdId = 8041; // Some valid workflow process definition id
            List<FormElement> feList = new ArrayList<>(); // Case as part of starting workflow are required form parameter
            Input price = new Input();
            price.setName("price");
            price.setValue("1000");
            feList.add(price);
            TextArea textArea = new TextArea();
            textArea.setName("description");
            textArea.setValue("some description here");
            feList.add(textArea);
            OKMWorkflow.getInstance().runProcessDefinition(null, pdId, "f86cc22d-9b50-434f-a940-b04cea9c0048", feList);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

sendProcessInstanceSignal

Description:

MethodReturn valuesDescription

sendProcessInstanceSignal(String token, long processInstanceId, String transitionName)

ProcessInstance

Send a signal to a process intance id.

The parameter processInstanceId value is a valid workflow process instance.

The parameter uuid can be any document, mail, or folder UUID.

The parameter transactionName is the choosen transaction.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long pId = 1046; // Some valid process instance id
            OKMWorkflow.getInstance().sendProcessInstanceSignal(null, pId, "jump2");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

endProcessInstance

Description:

MethodReturn valuesDescription

endProcessInstance(String token, long processInstanceId)

void

Ends a process intance id.

The parameter processInstanceId value is a valid workflow process instance.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long pId = 1046; // Some valid process instance id
            OKMWorkflow.getInstance().endProcessInstance(null, pId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

deleteProcessInstance

Description:

MethodReturn valuesDescription

deleteProcessInstance(String token, long processInstanceId)

void

Delete a process intance id.

The parameter processInstanceId value is a valid workflow process instance.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long pId = 1046; // Some valid process instance id
            OKMWorkflow.getInstance().deleteProcessInstance(null, pId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findProcessInstances

Description:

MethodReturn valuesDescription

findProcessInstances(String token, long processDefinitionId)

List<ProcessInstance>

Retrieves a list of all process instances of some registered workflows definition.

The parameter processDefinitionId value is a valid workflow process definition.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessDefinition;
import com.openkm.bean.workflow.ProcessInstance;

public class Test {
    public static void main(String[] args) {
        try {
            // Get all workflow definitions
            for (ProcessDefinition pd : OKMWorkflow.getInstance().findAllProcessDefinitions(null)) {
                System.out.println("WF definition: "+pd);
                
                // Get all process of some workflow definition
                for (ProcessInstance pi : OKMWorkflow.getInstance().findProcessInstances(null, pd.getId())) {
                    System.out.println("PI: "+pi);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findAllProcessDefinitions

Description:

MethodReturn valuesDescription

findAllProcessDefinitions(String token, long processDefinitionId)

List<ProcessDefinition>

Retrieves a list of all registered workflows definitions.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessDefinition;

public class Test {
    public static void main(String[] args) {
        try {
            // Get all workflow definitions
            for (ProcessDefinition pd : OKMWorkflow.getInstance().findAllProcessDefinitions(null)) {
                System.out.println("WF definition: "+pd);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findLatestProcessDefinitions

Description:

MethodReturn valuesDescription

findLatestProcessDefinitions(String token)

List<ProcessDefinition>

Retrieves a list of the last workflows definitions.

Several versions of the same workflow can be registered.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessDefinition;

public class Test {
    public static void main(String[] args) {
        try {
            // Get all workflow definitions
            for (ProcessDefinition pd : OKMWorkflow.getInstance().findLatestProcessDefinitions(null)) {
                System.out.println("WF definition: "+pd);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findLastProcessDefinition

Description:

MethodReturn valuesDescription

findLastProcessDefinition(String token, String name)

ProcessDefinition

Retrieves last workflow definition of some specific workflow.

The parameter name identifies an specific workflow definitions group.

Several workflow definition versions that have the same name.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessDefinition;

public class Test {
    public static void main(String[] args) {
        try {
            ProcessDefinition pd = OKMWorkflow.getInstance().findLastProcessDefinition(null, "purchase");
            System.out.println("WF definition: " + pd);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findAllProcessDefinitionVersions

Description:

MethodReturn valuesDescription

findAllProcessDefinitionVersions(String token, String name)

ProcessDefinition

Retrieves all workflow definition versions of some specific workflow.

The parameter name identifies an specific workflow definitions group.

Several workflow definition versions that have the same name.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessDefinition;

public class Test {
    public static void main(String[] args) {
        try {
            for (ProcessDefinition pd : OKMWorkflow.getInstance().findAllProcessDefinitionVersions(null, "purchase")) {
                System.out.println("WF definition: " + pd);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getProcessInstance

Description:

MethodReturn valuesDescription

getProcessInstance(String token, long processInstanceId)

ProcessInstance

Returns the process instance.

The parameter processInstanceId is a valid process instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessInstance;

public class Test {
    public static void main(String[] args) {
        try {
            long piId = 8108; // Some valid process instance id
            ProcessInstance pi = OKMWorkflow.getInstance().getProcessInstance(null, piId);
            System.out.println("PI: " + pi);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

suspendProcessInstance

Description:

MethodReturn valuesDescription

suspendProcessInstance(String token, long processInstanceId)

void

Suspends the process instance.

The parameter processInstanceId is a valid process instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessInstance;

public class Test {
    public static void main(String[] args) {
        try {
            long piId = 8108; // Some valid process instance id
            OKMWorkflow.getInstance().suspendProcessInstance(null, piId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

resumeProcessInstance

Description:

MethodReturn valuesDescription

resumeProcessInstance(String token, long processInstanceId)

void

Resume the process instance.

The parameter processInstanceId is a valid process instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessInstance;

public class Test {
    public static void main(String[] args) {
        try {
            long piId = 8108; // Some valid process instance id
            OKMWorkflow.getInstance().resumeProcessInstance(null, piId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addProcessInstanceVariable

Description:

MethodReturn valuesDescription

addProcessInstanceVariable(String token, long processInstanceId, String name, Object value)

void

Add a variable in a process instance.

The parameter processInstanceId is a valid process instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessInstance;

public class Test {
    public static void main(String[] args) {
        try {
            long piId = 8108; // Some valid process instance id
            OKMWorkflow.getInstance().addProcessInstanceVariable(null, piId, "key", "value");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

deleteProcessInstanceVariable

Description:

MethodReturn valuesDescription

deleteProcessInstanceVariable(String token, long processInstanceId, String name)

void

Delete a variable in a process instance.

The parameter processInstanceId is a valid process instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.ProcessInstance;

public class Test {
    public static void main(String[] args) {
        try {
            long piId = 8108; // Some valid process instance id
            OKMWorkflow.getInstance().deleteProcessInstanceVariable(null, piId, "key");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findUserTaskInstances

Description:

MethodReturn valuesDescription

findUserTaskInstances(String token)

List<TaskInstance>

Retrieves a list of task instances assigned to the user.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.TaskInstance;

public class Test {
    public static void main(String[] args) {
        try {
            // Get all user task intances
            for (TaskInstance ti : OKMWorkflow.getInstance().findUserTaskInstances(null)) {
                System.out.println(ti);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findPooledTaskInstances

Description:

MethodReturn valuesDescription

findPooledTaskInstances(String token)

List<TaskInstance>

Retrieves a list of pooled task instances assigned to the user.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.TaskInstance;

public class Test {
    public static void main(String[] args) {
        try {
            // Get all user task intances
            for (TaskInstance ti : OKMWorkflow.getInstance().findPooledTaskInstances(null)) {
                System.out.println(ti);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

findTaskInstances

Description:

MethodReturn valuesDescription

findTaskInstances(String token, long processInstanceId)

List<TaskInstance>

Retrieves a list of task instances by process intance.

The parameter processInstanceId is a valid process instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.TaskInstance;

public class Test {
    public static void main(String[] args) {
        try {
            // Get all user task intances
            long piId = 8108; // Some valid process instance id
            for (TaskInstance ti : OKMWorkflow.getInstance().findTaskInstances(null, piId)) {
                System.out.println(ti);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

setTaskInstanceValues

Description:

MethodReturn valuesDescription

setTaskInstanceValues(String token, long taskInstanceId, String transitionName, List<FormElement> values)

void

Set a task instance values.

The parameter taskInstanceId is a valid task instance id.

The parameter transitionName is the choosen transaction.

The parameter values are form element values needed for starting the workflow ( not all workflow tasks need form values ).

Example:

package com.openkm;

import java.util.ArrayList;
import java.util.List;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.form.FormElement;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            List<FormElement> feList = new ArrayList<>();
            OKMWorkflow.getInstance().setTaskInstanceValues(null, tiId, "approve", feList);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addTaskInstanceComment

Description:

MethodReturn valuesDescription

addTaskInstanceComment(String token, long taskInstanceId, String message)

void

Set a task instance comment.

The parameter taskInstanceId is a valid task instance id.

Example:

package com.openkm;

import java.util.ArrayList;
import java.util.List;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            OKMWorkflow.getInstance().addTaskInstanceComment(null, tiId, "here the comment");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getTaskInstance

Description:

MethodReturn valuesDescription

getTaskInstance(String token, long taskInstanceId)

TaskInstance

Returns a task instance.

The parameter taskInstanceId is a valid task instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.TaskInstance;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            TaskInstance ti = OKMWorkflow.getInstance().getTaskInstance(null, tiId);
            System.out.println(ti);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

setTaskInstanceActorId

Description:

MethodReturn valuesDescription

setTaskInstanceActorId(String token, long taskInstanceId, String actorId)

void

Set the actor to a task instance.

The parameter taskInstanceId is a valid task instance id.

The parameter actorId must be some valid OpenKM userId.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            OKMWorkflow.getInstance().setTaskInstanceActorId(null, tiId, "okmAdmin");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addTaskInstanceVariable

Description:

MethodReturn valuesDescription

addTaskInstanceVariable(String token, long taskInstanceId, String name, Object value)

void

Add variable into a task instance.

The parameter taskInstanceId is a valid task instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            OKMWorkflow.getInstance().addTaskInstanceVariable(null, tiId, "key", "value");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

deleteTaskInstanceVariable

Description:

MethodReturn valuesDescription

deleteTaskInstanceVariable(String token, long taskInstanceId, String name)

void

Delete variable from a task instance.

The parameter taskInstanceId is a valid task instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            OKMWorkflow.getInstance().deleteTaskInstanceVariable(null, tiId, "key");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

startTaskInstance

Description:

MethodReturn valuesDescription

startTaskInstance(String token, long taskInstanceId)

void

Starts a task instance.

The parameter taskInstanceId is a valid task instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            OKMWorkflow.getInstance().startTaskInstance(null, tiId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

endTaskInstance

Description:

MethodReturn valuesDescription

endTaskInstance(String token, long taskInstanceId, String transitionName)

void

Ends a task instance.

The parameter taskInstanceId is a valid task instance id.

The parameter transitionName is a transaction name.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            OKMWorkflow.getInstance().endTaskInstance(null, tiId, "end");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

suspendTaskInstance

Description:

MethodReturn valuesDescription

suspendTaskInstance(String token, long taskInstanceId)

void

Suspend a task instance.

The parameter taskInstanceId is a valid task instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            OKMWorkflow.getInstance().suspendTaskInstance(null, tiId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

resumeTaskInstance

Description:

MethodReturn valuesDescription

resumeTaskInstance(String token, long taskInstanceId)

void

Resume a task instance.

The parameter taskInstanceId is a valid task instance id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;

public class Test {
    public static void main(String[] args) {
        try {
            long tiId = 8110; // Some valid task instance id
            OKMWorkflow.getInstance().resumeTaskInstance(null, tiId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getToken

Description:

MethodReturn valuesDescription

getToken(String token, long tokenId)

Token

Return a token object.

The parameter tokenId is a valid token id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.Token;

public class Test {
    public static void main(String[] args) {
        try {
            long tkId = 8110; // Some valid token id
            Token tk = OKMWorkflow.getInstance().getToken(null, tkId);
            System.out.println(tk);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addTokenComment

Description:

MethodReturn valuesDescription

addTokenComment(String token, long tokenId, String message)

void

Add a token comment.

The parameter tokenId is a valid token id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.Token;

public class Test {
    public static void main(String[] args) {
        try {
            long tkId = 8110; // Some valid token id
            Token tk = OKMWorkflow.getInstance().addTokenComment(null, tkId, "here the comment");
            System.out.println(tk);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

suspendToken

Description:

MethodReturn valuesDescription

suspendToken(String token, long tokenId)

void

Suspend a token.

The parameter tokenId is a valid token id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.Token;

public class Test {
    public static void main(String[] args) {
        try {
            long tkId = 8110; // Some valid token id
            Token tk = OKMWorkflow.getInstance().suspendToken(null, tkId);
            System.out.println(tk);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

resumeToken

Description:

MethodReturn valuesDescription

resumeToken(String token, long tokenId)

void

Resume a token.

The parameter tokenId is a valid token id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.Token;

public class Test {
    public static void main(String[] args) {
        try {
            long tkId = 8110; // Some valid token id
            Token tk = OKMWorkflow.getInstance().resumeToken(null, tkId);
            System.out.println(tk);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

sendTokenSignal

Description:

MethodReturn valuesDescription

sendTokenSignal(String token, long tokenId, String transitionName)

Token

Send a signal.

The parameter tokenId is a valid token id.

The parameter transitionName is a transaction name.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.Token;

public class Test {
    public static void main(String[] args) {
        try {
            long tkId = 8110; // Some valid token id
            Token tk = OKMWorkflow.getInstance().sendTokenSignal(null, tkId, "end");
            System.out.println(tk);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

setTokenNode

Description:

MethodReturn valuesDescription

setTokenNode(String token, long tokenId, String nodeName)

void

Set token node.

The parameter tokenId is a valid token id.

The parameter nodeName is a node name.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.Token;

public class Test {
    public static void main(String[] args) {
        try {
            long tkId = 8110; // Some valid token id
            OKMWorkflow.getInstance().setTokenNode(null, tkId, "formA");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

endToken

Description:

MethodReturn valuesDescription

endToken(String token, long tokenId)

Token

End token.

The parameter tokenId is a valid token id.

Example:

package com.openkm;

import com.openkm.api.OKMWorkflow;
import com.openkm.bean.workflow.Token;

public class Test {
    public static void main(String[] args) {
        try {
            long tkId = 8110; // Some valid token id
            OKMWorkflow.getInstance().setTokenNode(null, tkId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}