Hi Tanay,
First of all I would suggest to not create form from scratch as it might be tricky. Apart from that what you can do is to just create a standard step with the Form and in this form just create a single field which is hidden.
In this field you can write beanshell that will customize the form object. That gives you benefit that form itself is created by Sailpoint and the only thing you do is to dynamically build it inside.
Here see some examples:
- Form example
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Form PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Form name="Sample Workflow Form" type="Workflow">
<Attributes>
<Map>
<entry key="pageTitle" value="Sample Workflow Form"/>
<entry key="subtitle" value="Sample Workflow Form"/>
<entry key="title" value="Sample Workflow Form"/>
</Map>
</Attributes>
<Description></Description>
<Section name="Section 1">
<Field name="configField" type="string">
<Attributes>
<Map>
<entry key="hidden" value="true"/>
</Map>
</Attributes>
<Script>
<Source>
<![CDATA[
for(Form.Section baseSection : form.getSections()) {
baseSection.load();
Field field = new Field();
field.setName("someFieldName");
field.setType("string");
baseSection.add(field);
form.load();
}
]]>
</Source>
</Script>
</Field>
</Section>
<Button action="next" label="Next"/>
<Button action="back" label="Back"/>
</Form>
- Workflow example with form
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Workflow PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Workflow explicitTransitions="true" name="Sample Workflow">
<Step icon="Start" name="Start" posX="28" posY="10">
<Transition to="Sample Form Step"/>
</Step>
<Step icon="Stop" name="Stop" posX="256" posY="10"/>
<Step icon="Default" name="Sample Form Step" posX="98" posY="10">
<Approval name="Sample Workflow Form" owner="ref:launcher" return="" send="">
<Form name="Sample Workflow Form">
<Attributes>
<Map>
<entry key="pageTitle" value="Sample Workflow Form"/>
<entry key="subtitle" value="Sample Workflow Form"/>
<entry key="title" value="Sample Workflow Form"/>
</Map>
</Attributes>
<FormRef name="Sample Workflow Form"/>
</Form>
</Approval>
<Transition to="Stop"/>
</Step>
</Workflow>