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

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #54907  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
 #54908  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);

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.