Search in sources :

Example 1 with ProcessInstance

use of org.bonitasoft.engine.bpm.process.ProcessInstance in project tdi-studio-se by Talend.

the class Client method startProcess.

public String startProcess(String processDefinitionId, Map<String, Object> processVariables) throws BonitaException {
    Map<String, Serializable> listVariablesSerializable = new HashMap<String, Serializable>();
    for (String variableName : processVariables.keySet()) {
        if (processVariables.get(variableName) == null || (!(processVariables.get(variableName) instanceof Serializable))) {
            continue;
        }
        Object value = processVariables.get(variableName);
        Serializable valueSerializable = (Serializable) value;
        variableName = variableName.toLowerCase();
        listVariablesSerializable.put(variableName, valueSerializable);
    }
    ProcessInstance processInstance = processAPI.startProcess(Long.parseLong(processDefinitionId), listVariablesSerializable);
    return String.valueOf(processInstance.getId());
}
Also used : Serializable(java.io.Serializable) HashMap(java.util.HashMap) ProcessInstance(org.bonitasoft.engine.bpm.process.ProcessInstance)

Aggregations

Serializable (java.io.Serializable)1 HashMap (java.util.HashMap)1 ProcessInstance (org.bonitasoft.engine.bpm.process.ProcessInstance)1