Skip to content

Add unit test for ProcessVariablePlaceholderResolver + getTaskVariables #8

Description

@schmunk42

The task input-schema resolver now substitutes {{ processVariable }} placeholders in a task form schema with the instance's runtime variables, so dynamic x-collection filters (e.g. /api/user?rolle=aussendienst_{{ kreisnummer }}) reach the client already resolved (…aussendienst_115).

New code (added while integrating in a consuming app, verified end-to-end there):

  • Schema/ProcessVariablePlaceholderResolver — pure recursive substitutor. Replaces only bare-identifier tokens ({{ name }}) that exist in the variable map; leaves dotted client-side tokens ({{ x.value }}, Jedison x-watch/x-template) and unknown identifiers untouched.
  • Client/FlowableClient::getTaskVariables() — flattens GET runtime/tasks/{id}/variables to a name => value map.
  • Schema/TaskFormInputSchemaResolver — resolves placeholders against getTaskVariables() before enveloping (guarded by a cheap {{ check).

This repo has no test suite/CI yet (see CLAUDE.md), so no unit test was added here. Once minimal PHPUnit infra exists, add:

  • ProcessVariablePlaceholderResolver::resolve(): bare token resolved from map; dotted {{ x.value }} left intact; unknown identifier left intact; empty variable map is a no-op; bool/null/scalar stringification; non-scalar → empty.
  • getTaskVariables(): list → map flattening; 404 → empty array.

Context: dmstr/flowable-bundle used by the za7 FOGU API (kreis-scoped Außendienst-MA picker).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions