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

cancel
Showing results for 
Search instead for 
Did you mean: 
baaka
Member II

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

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
vidhipanchal
Established Member

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

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
Member II

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

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.