Form properties as Process Variables

Hello,

I have an StartEvent with one form property:
image


That I am trying to read in an Script Task:
image

I thought form properties were saved as process variables behind the scenes but I am getting null values when trying to get them.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef" exporter="Flowable Open Source Modeler" exporterVersion="6.7.2">
  <process id="issuepropform" name="issuepropform" isExecutable="true">
    <startEvent id="initform" flowable:formFieldValidation="true">
      <extensionElements>
        <flowable:formProperty id="new_property_1" name="new_property_1" type="string" variable="new_property_1" default="new_property_1_value"></flowable:formProperty>
      </extensionElements>
    </startEvent>
    <scriptTask id="sid-08D6C4D1-4CD3-4615-BDC9-8AD5CE9E699A" scriptFormat="JavaScript" flowable:autoStoreVariables="false">
      <script><![CDATA[var prop = execution.getVariable("new_property_1");
print("prop value: "+prop);]]></script>
    </scriptTask>
    <sequenceFlow id="sid-C81FA345-E557-4A98-8CA6-02188D522B25" sourceRef="initform" targetRef="sid-08D6C4D1-4CD3-4615-BDC9-8AD5CE9E699A"></sequenceFlow>
    <endEvent id="sid-E910F978-3019-4787-8B97-3EE8648E3175"></endEvent>
    <sequenceFlow id="sid-71DF85E4-BB60-4689-9374-02B44DAE4FC1" sourceRef="sid-08D6C4D1-4CD3-4615-BDC9-8AD5CE9E699A" targetRef="sid-E910F978-3019-4787-8B97-3EE8648E3175"></sequenceFlow>
  </process>
</definitions>

Is there a way to retrieve start form properties (new_property_1) on next tasks ? Thanks,

Hi,

can u see your variable in Flowable Admin module for a process instance?

I had a similar problem and it turns out that the variable wasn’t created…

Also, check a field ID on the form - values entered on a form field should be stored in that ID (that is a name od created variable).

So if u have filed ID, for example, XXX, then in the script try to print out a variable named XXX.

Kind regards,
V.

Hey @jcasg,

The Form Properties are properties that are used by the Flowable Task application to render a form based on them. This form is then used to collect the data and start the process using this variables.

Within the process you can only use variables that you have passed to the process when starting it.

Cheers,
Filip