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
Solved! Go to Solution.
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
Hi,
why don't you use the startProcessInstanceById method? You could also pass your form variables there.
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'.
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
Hi Greg,
Thanks for the quick reply
I still think believe the interface should add one more parameter
from
ProcessInstance submitStartFormData(String processDefinitionId, String businessKey, Map<String, String> properties);
to
ProcessInstance submitStartFormData(String processDefinitionId, String businessKey, Map<String, String> properties, Map<String, Object>variables
);
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.