Dear All
While starting a BPM Process using BPM API, I am not able to get the right code to send inputs to the BPM process.
I am not sure where to define the inputs for BPM process as well, however I can do it for individual tasks of the same process. (I am assuming there should be a solution similar to Guided Procedure i.e. providing inputs like the initiator, administrator etc during the run time of the process start)
These inputs would be used directly by the very first task of the process (The one next to start).
This data input before kicking off the process also has the User Principle in it, which in turn has to be assigned dynamically to the first task of the BPM process.
Can someone help? I am using the below Code to start, is it possible to send input parameters during this action <The highlighted line of code>?
ProcessDefinitionManager processDefinitionManager = BPMFactory.getProcessDefinitionManager();
ProcessDefinition processDefinition = processDefinitionManager.getActiveProcessDefinition(VENDOR, DC_NAME, PROCESS_NAME);
ProcessStartManager processStartManager = BPMFactory.getProcessStartManager();
Set<ProcessStartEvent> processStartEvents = processStartManager.getProcessStartEvents(processDefinition.getId());
ProcessStartEvent processStartEvent = processStartEvents.iterator().next();
DataObject processStartDataObject = processStartManager.createDataObjectForStartEvent(processStartEvent);
processStartDataObject.setString(processStartDataObject.getType().getProperty(FIELD_CUSTOMER), VALUE_CUSTOMER);
URI processInstanceId = processStartManager.startProcess(processStartEvent, processStartDataObject);
What ever I put in the getProperty() method, it throws null pointer. I am not sure where the input parameters for the whole process needs to be defined.
Many thanks.