02-17-2017 01:44 AM
the API of
formService.submitStartFormData
only support Map<String,String>, but If I have a service task after the start form event, which need accept a boolean value or complex java bean. How can I pass process variable just like
runtimeService
startProcessInstanceById(String processDefinitionId, String businessKey, Map<String,Object> variables)
Same problem but not solved
02-19-2017 07:10 AM
Ok, Just because you use a start event (all processes MUST use some kind of start event), doesn't mean you have to start the process using a form.
There are many ways to start a process, if you want to inject variables other than Strings then you need to use the appropriate runtimeService.startProcessInstanceByID() or startProcessInstanceByKey().
Thanks,
Greg
02-17-2017 02:50 AM
Hi,
why don't you use the startProcessInstanceById method? You could also pass your form variables there.
02-17-2017 02:57 PM
02-19-2017 07:00 AM
Hi Greg,
Because I used start form event, when user submit a form request then start a new process instance. I think that is why formService provides the function 'submitStartFormData'.
My start event:
<startEvent id="start" name="Start" activiti:initiator="applyUserId">
<extensionElements>
<activiti:formProperty id="f_name" value="${f_name}" name="Name" type="string" expression="#{contact.name}" required="true"/>
</extensionElements>
</startEvent>
I need pass complex java bean 'contact' into process as process variables. Then use formService.submitStartFormData to start the process, the form variable should be a map, key is 'f_name', value is 'jeff'.
After the process instance started, I could get contact from process, the contact.name should equal 'jeff'.
02-19-2017 07:10 AM
Ok, Just because you use a start event (all processes MUST use some kind of start event), doesn't mean you have to start the process using a form.
There are many ways to start a process, if you want to inject variables other than Strings then you need to use the appropriate runtimeService.startProcessInstanceByID() or startProcessInstanceByKey().
Thanks,
Greg
Explore our Alfresco products with the links below. Use labels to filter content by product module.