KB-1627 Publishing a process model fails with "Neither variable(s) nor rule(s) found" error

Symptoms

When publishing a process model containing a Process Start Form or a User Input Task, the publication fails with an error similar to the following:

This process model could not be published due to the following errors. Please correct them before continuing.
There was an error in an expression in Process Model Properties at Process Start Form : Neither variable(s) nor rule(s) found: <VARIABLE_NAME>

Alternatively, for a process model using a script task, the process model fails to publish with the following error:

This process model could not be published due to the following errors. Please correct them before continuing
There was an error in an expression in Script Task at Output Expression: Neither variables(s) nor rule(s) found: <VARIABLE_NAME>

Cause

This error is caused by an uncaught syntax error in the definition of the SAIL used by the Process Start Form, User Input Task, or script task. The error may not prevent the interface or any called expression rule from rendering correctly in the Interface or Expression Designer. For example, the error can be triggered by:

  1. A missing or extra comma in a function call, list, or layout definition similar to the sample code below:
    contains(
    index(
    local!variable,
    "id",
    {}
    )fv!item.id
    )
  2. An incorrectly defined dictionary, similar to the sample code below:
    {keyName: keyName: value}

Action

Inspect the code of any underlying interfaces and/or expression rules for the uncaught syntax error(s) and correct all instances. The following correspond to the same numbered examples above:

  1. To resolve this syntax error, add an extra comma between the index() statement and variable reference:
    contains(
    index(
    local!variable,
    "id",
    {}
    ),
    fv!item.id
    )
  2. To resolve this syntax error, remove the duplicate key name:
    {keyName: value}

After correcting all syntax errors, the process model should save and publish successfully.

Workaround

Add a process variable of arbitrary type with the same name listed in the error message.

Affected Versions

This article applies to all versions of Appian.

Last reviewed: July 2022

Related
Recommended