cancel
Showing results for 
Search instead for 
Did you mean: 

REST API, Workflow process definition start form model / task form model entries ordering

baaka
Champ in-the-making
Champ in-the-making

Is it possible to retrieve: workflow process definition start form model / task form model entries, in same order as defined in content model properties, via Public Rest API?

e.g. of custom content type:

<type name="sc:test">
      <title>Test Model</title>
      <parent>bpm:startTask</parent>

      <properties>
         <property name="sc:firstName">
            <title>First Name</title>
            <type>d:text</type>
         </property>
         <property name="sc:lastName">
            <title>Last Name</title>
            <type>d:text</type>
         </property>
         <property name="sc:birthDate">
            <title>Birth Date</title>
            <type>d:date</type>
         </property>
         ...........................
         ...........................
         ...........................

      </properties>
      <mandatory-aspects>
         <aspect>bpm:assignee</aspect>
      </mandatory-aspects>

</type>

After calling: GET /process-definitions/{processDefinitionId}/start-form-model, ordering of the result entries are not same as they are defined in above described model (1. firstName, 2.lastName, 3.birthDate ...).

2 REPLIES 2

vidhipanchal
Star Contributor
Star Contributor

Hi, 

You can set field visibility and field ordering in 'Share-config-custom.xml' as follows : 

<config evaluator="string-compare" condition="activiti$nameofProcess">
   <forms>
      <form>
         <field-visibility>
            <show id="sc:firstName" />

            <show id="sc:lastName" />

            <show id="sc:birthDate" />
         </field-visibility>
         <appearance>
            <field id="sc:firstName" />

            <field id="sc:lastName" />

            <field id="sc:birthDate" />

         </appearance>
      </form>
   </forms>
</config>

The above config is for workflow start task, condition contains the process id with prefix 'activiti$'.

Thanks,

Vidhi

Contcentric

Regards,
Vidhi

baaka
Champ in-the-making
Champ in-the-making

Hello,

Thanks for your reply. I do not use share, I want to know if same thing was achievable from public Rest API, it would be nice if forms GET methods have some sorting functionality.