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());
}
Aggregations