cancel
Showing results for 
Search instead for 
Did you mean: 

Set default authorities in start workflow form

Skyor
Champ on-the-rise
Champ on-the-rise

I develop workflow and i need to set default authorities in people picker (start-workflow form).

Example:
image

I think i should to set "default" value to association in model.xml file

<association name="scwf:assignees">
                    <title>Assignees</title>
                    <source>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </target>
                </association>
But i don't know, how to set array of authorities 
1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

There is no support for default values in an association. There technically cannot be one because in order to define a default, you would have to know the reference value (node reference), which can differ from system to system (i.e. between dev and prod), or specific elements may not even exist. In addition, any default values in the model will not be reflected in the form - rather they would be set in the backend when a form has been provided without a value.

The only thing that could be done - with some non-trivial customisation - is to develop a custom form control which takes a "control-param" from the form configuration that denotes default values (e.g. names of groups), and dynamically resolves those names via search functionality, automatically adding any of the groups that could successfully be resolved to the list of selected values.

View answer in original post

1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

There is no support for default values in an association. There technically cannot be one because in order to define a default, you would have to know the reference value (node reference), which can differ from system to system (i.e. between dev and prod), or specific elements may not even exist. In addition, any default values in the model will not be reflected in the form - rather they would be set in the backend when a form has been provided without a value.

The only thing that could be done - with some non-trivial customisation - is to develop a custom form control which takes a "control-param" from the form configuration that denotes default values (e.g. names of groups), and dynamically resolves those names via search functionality, automatically adding any of the groups that could successfully be resolved to the list of selected values.