flowable/flowable-engine · warning

No script provided for scriptTask

Error message

No script provided for scriptTask {}

What it means

A scriptTask element in the BPMN XML has an empty or missing script. The parser logs this warning (the deployment still proceeds) and the task will have no script to execute, failing at runtime if the behavior is invoked. This catches models where the script body was never entered or was lost.

Solutions

  1. Add the script text as the content of the scriptTask element in the BPMN XML
  2. Provide the script programmatically before deployment if the model is generated
  3. Remove the scriptTask or replace it with another task type if no script is needed

Example fix

// before
<scriptTask id="s1" scriptFormat="javascript"/>
// after
<scriptTask id="s1" scriptFormat="javascript"><![CDATA[return 1 + 1;]]></scriptTask>
Defensive patterns

Strategy: validation

Validate before calling

for (ScriptTask t : model.getFlowElementsOfType(ScriptTask.class)) {
    if (t.getScript() == null || t.getScript().trim().isEmpty()) {
        throw new IllegalArgumentException("scriptTask " + t.getId() + " has no script");
    }
}

Prevention

When it happens

Trigger: executeParse of a ScriptTask where StringUtils.isEmpty(scriptTask.getScript()) — i.e. the <scriptTask> has no inner script text, possibly with a language set but no body.

Common situations: Modeler export dropping script CDATA content; copying a scriptTask skeleton and forgetting to paste the script; template generation leaving the script placeholder empty.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/6e067a69f0644eb8. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/ScriptTaskParseHandler.java:40

import org.slf4j.LoggerFactory;

/**
 * @author Joram Barrez
 */
public class ScriptTaskParseHandler extends AbstractActivityBpmnParseHandler<ScriptTask> {

    private static final Logger LOGGER = LoggerFactory.getLogger(ScriptTaskParseHandler.class);

    @Override
    public Class<? extends BaseElement> getHandledType() {
        return ScriptTask.class;
    }

    @Override
    protected void executeParse(BpmnParse bpmnParse, ScriptTask scriptTask) {

        if (StringUtils.isEmpty(scriptTask.getScript())) {
            LOGGER.warn("No script provided for scriptTask {}", scriptTask.getId());
        }

        ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, scriptTask, BpmnXMLConstants.ELEMENT_TASK_SCRIPT);

        activity.setAsync(scriptTask.isAsynchronous());
        activity.setExclusive(!scriptTask.isNotExclusive());

        activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createScriptTaskActivityBehavior(scriptTask));

    }

}

View on GitHub (pinned to d6d39ce1c6)