Set default authorities in start workflow form

cancel
Showing results for 
Search instead for 
Did you mean: 
Skyor
Active Member

Set default authorities in start workflow form

Jump to solution

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

Example:
изображение_2021-02-24_101053.png

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 Solution

Accepted Solutions
afaust
Master

Re: Set default authorities in start workflow form

Jump to solution

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 solution in original post

1 Reply
afaust
Master

Re: Set default authorities in start workflow form

Jump to solution

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.