Renders previously submitted form(s) using data stored within a history event.
The data stored in the event upon a form submission includes the raw submitted form data, the form name, the form type, and the form definition type (CSFORMDEFINITIONEX or FORMDEFINITIONEX).
For example:
{
"formData": {
"formName": "HISTORYWORKERTEST",
"typeName": "FORM_HISTORYWORKERTEST",
"formDefinitionType": "FORMDEFINITIONEX",
"data": {
"PAGE2.PAGE2FIELD1": "PAGE2_FIELD1_VALUE",
"PAGE1.PAGE1FIELD2": "PAGE1_FIELD1_VALUE",
"PAGE2.FILE1": "file/668F5A3A-E4EB-4210-B3CB-59987D38695A/TestDynamicBPMNTwo.bpmn20.xml",
"FORMACTION.NEXT": "Next",
"FORMACTION.FINISH": "Submit"
}
}
}
This method accepts formData in two ways. Either directly via the formData parameter:
{
"eventArgs": [{
"formData": {...As Above...}
}]
}
Or indirectly by identifying a specific history event from which to extract the formData from:
{
"eventArgs": [{
"labela": "TEST",
"labelb": "HISTORY",
"labelc": "FORMDATA",
"pos": 2,
"renderMode": "readonlynoctrl"
}]
}
Parameters
Name | Type | Description |
---|---|---|
apiServerHostURL | URL (str enc.), required | Publicly accessible URL for the API Server, eg http://mysite/apiserver |
eventArgs | Array, required | An array of either formData or label/position objects |
formData | formData | See above example of the formData structure. |
-or to extract the formData from a history event- | ||
labela | String, required | History label a |
labelb | String, optional | History label b |
labelc | String, optional | History label c |
labeld | String, optional | History label d |
labele | String, optional | History label e |
pos | Integer, optional | Position of the event within the history that contains the formData structure to extract |
rendermode | Enum (string enc.), optional | Default: "readonlynoctrl". Either "readonly" or "readonlynoctrl" |
userContextVars | Map | Override/introduce user context variables that may be read by skeletons, eg |
formProperties | Map | Override form properties, eg |
Checkbox Label Position in iCM
If you are generating a read-only view of a form in iCM using
"eventArgs": [{
"formData": historyFormData,
"formProperties": {
"ISRENDEREDINICM": helper.isRenderedInIcm().toString()
}
}]
Example Requests
formData
{
"id": 1,
"method": "renderFormsFromHistoryEvent",
"params": {
"apiServerHostURL": "http://mysite/apiserver",
"eventArgs": [{
"formData": {
"formName": "HISTORYWORKERTEST",
"typeName": "FORM_HISTORYWORKERTEST",
"formDefinitionType": "FORMDEFINITIONEX",
"data": {
"FORMACTION.FINISH": "Submit",
"PAGE2.PAGE2FIELD1": "PAGE2_FIELD1_VALUE",
"PAGE2.FILE1": "file/668F5A3A-E4EB-4210-B3CB-59987D38695A/TestDynamicBPMNTwo.bpmn20.xml",
"FORMACTION.NEXT": "Next",
"PAGE1.PAGE1FIELD2": "PAGE1_FIELD1_VALUE"
}
}
}]
}
}
Label and Position
{
"id": 1,
"method": "renderFormsFromHistoryEvent",
"params": {
"apiServerHostURL": "http://mysite/apiserver",
"eventArgs": [{
"labela": "TEST",
"labelb": "HISTORY",
"labelc": "DATA",
"pos": 2,
"renderMode": "readonlynoctrl"
}]
}
}
Example Responses
formData
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"result": {
"renderedForms": [{
"headerContent": "",
"bodyContent": "[...SNIP...]",
"eventArg": {
"labela": null,
"labelb": null,
"labelc": null,
"labeld": null,
"labele": null,
"pos": 0,
"renderMode": "readonlynoctrl",
"formData": {
"typeName": "FORM_HISTORYWORKERTEST",
"formDefinitionType": "FORMDEFINITIONEX",
"formName": "HISTORYWORKERTEST"
}
}
}]
}
}
}
Label and Position
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"result": {
"renderedForms": [{
"headerContent": "",
"bodyContent": "[...SNIP...]",
"eventArg": {
"labela": "TEST",
"labelb": "HISTORY",
"labelc": "DATA",
"labeld": null,
"labele": null,
"pos": 2,
"renderMode": "readonlynoctrl",
"formData": null
}
}]
}
}
}