First form of a workflow use of initiator
Hi guys, I am starting a workflow with a form with a selection of users. I would like the default value to be the initiator of the workflow. Do you have any idea on how to do that ?
Thanks !
F.
Frederic Zur Nedden
Posted 1 year ago·Last reply 4 months ago
6 comments
George Cheung
·7 months agoAccording to this ideation: https://ideas.collibra.com/ideas/DCC-I-3269
It may be possible to display the current user in a start form using form properties instead of form reference.
Tanmay Mandaliya
·4 months agoHi, I tried the method mentioned in this ideation, but it is not working for me. Have you successfully implemented it? If yes, please give me the syntax as well. Thank you.
George Cheung
·4 months agoThe method mentioned in the ideation is using the old form style (called form properties) - in the old form style, it was possible to populate the proposedValues on those forms using the core api. The new form style is called form references and does not have the ability to process proposedValues using the core api at the moment. In order to get this to work - the form style must be in form properties - if your form can not be successfully converted from form reference back to form properties - then it wont suit your needs.
In the old form properties, you can see the xml of the bpmn as:
<startEvent id="startnoneevent1" name="Start event" flowable:initiator="initiator"> <extensionElements> <flowable:formProperty id="selectUser" name="Select User" type="user" default="${userApi.getCurrentUser().get().getUserName()}" required="true"></flowable:formProperty> </extensionElements> </startEvent>Tanmay Mandaliya
·4 months agoHi, Thank you for detailed information. I tried on new form style (Form Properties) but it was not working. Unfortunately, I can not move to old form style.
Victor Morisset
·1 year ago@user_Fred Unfortunately, this is not possible, as the workflow has not started yet, so there's nothing dynamic you can do in the start form.
You can only achieve that if your form is attached to user task right after the start form. This way, you can do the pre-processing in a script task before the user task to pre-populate the user variable with the "initiator" of the workflow.
Frederic Zur Nedden
OP1 year agook thanks for the info !
F.