Page 1 of 1

Workflow form input fields don't display process variable values - is this a known limitation?

PostPosted:Wed Oct 08, 2025 3:41 pm
by marius_i
Hi all!

Environment: OpenKM Community Edition (Docker), jBPM 3.2, Workflow Forms DTD 2.4

I set a process variable in my workflow, but the form input field linked with data="variableName" appears empty. The variable IS correctly stored (visible in Process Variables), but doesn't display in the form.

processdefinition.xml:
Code: Select all
<start-state name="start">
    <transition to="user_task">
        <script>
            executionContext.setVariable("testField", "This is a test value");
        </script>
    </transition>
</start-state>

<task-node name="user_task">
    <task name="TestTask" blocking="true">
        <assignment actor-id="okmAdmin"/>
        <controller>
            <variable name="testField" access="read,write"/>
        </controller>
    </task>
    <transition to="end"/>
</task-node>
forms.xml:
Code: Select all
<workflow-form task="TestTask">
    <input name="testField" label="Test Field" data="testField" type="text"/>
    <button name="submit" label="Submit"/>
</workflow-form>
Result

✅ Variable "testField" = "This is a test value" (confirmed in Process Variables)
❌ Form input field appears empty when task opens

Is this a known limitation where form fields can save TO variables but cannot load FROM variables?
Or is there a specific syntax/configuration needed to display existing variable values in form input fields?
My goal is to to pre-populate workflow form input fields with values from process variables that were set earlier in the workflow.

Any guidance would be greatly appreciated. Thank you!

Marius

Re: Workflow form input fields don't display process variable values - is this a known limitation?

PostPosted:Fri Oct 10, 2025 5:23 pm
by jllort
You must mapping variables of the same type.
You should create a variable of type input and save in the context:
Code: Select all
// some missing imports here
Input input = new Input();
input.setName("testField");
input.setValue(This is a test value);
executionContext.setVariable("testField", input);

Re: Workflow form input fields don't display process variable values - is this a known limitation?

PostPosted:Thu Oct 16, 2025 8:50 pm
by marius_i
@jllort,
Hi, thank you very much for your response, it worked!

Best regards,
Marius