passing contract values to process from Java app.


I'm trying to start a process from a java program, but stumped on how I can pass the contract values over. The following code fails with

"Error while validating expected inputs: [Expected input [inputForm] is missing]"

But as you can see, the "inputForm" is indeed provided in the code.

Any thoughts oh wise ones?

Thanks again


import java.util.*;

import org.bonitasoft.engine.exception.*;
import org.bonitasoft.engine.identity.*;
import org.bonitasoft.engine.session.*;
import org.bonitasoft.engine.util.*;
import org.bonitasoft.engine.api.*;

class confirm {

        public static void instantiateProcess(String processDefinitionName, String processVersion, Map variables, APISession apiSession)  {
                try {
                        ProcessAPI processAPI = TenantAPIAccessor.getProcessAPI(apiSession);
                        long processId = processAPI.getProcessDefinitionId(processDefinitionName, processVersion);
                        processAPI.startProcess(processId, variables);
                } catch (Exception e) {

        public static void main(String[] args) throws Exception {

                Map settings = new HashMap();
                settings.put("server.url", "http://localhost:8080");
                settings.put("", "bonita");
                APITypeManager.setAPITypeAndParams(ApiAccessType.HTTP, settings);

                APISession session = TenantAPIAccessor.getLoginAPI().login("username", "password");

                String processDefinitionName = "Confirm Signup";
                String processVersion = "1.0";
                Map varMap = new HashMap();
                Map inputForm = new HashMap();

                inputForm.put("value", "value-goes-here");
                inputForm.put("status", "good!");
                varMap.put("inputForm", (Serializable) inputForm);

                instantiateProcess(processDefinitionName, processVersion, varMap, session);
1 answer

This one is the BEST answer!

Ok - I've cracked it myself :)

The parameters passed in the 3rd argument of the instantiateProcess() call are "process variables" NOT contract values.

With that fact in mind, the rest seems simple.