flowable/flowable-engine · error · org.activiti.engine.ActivitiException

Error while executing transformation from object

Error message

Error while executing transformation from object: ${anObject} using transformer ${this}

What it means

AbstractTransformer.transform wraps the subclass-provided primTransform in try/catch and rethrows any exception as an ActivitiException that includes the input object and the transformer's toString. It is a uniform error envelope for the transformation pipeline.

Solutions

  1. Inspect the chained cause (e.getCause()) for the real failure inside primTransform.
  2. Verify the input object type matches what the transformer's primTransform expects.
  3. Add pre-validation or type dispatch before calling transform().

Example fix

// before
Object result = transformer.transform(rawObject);
// after
if (rawObject instanceof ExpectedType) {
    Object result = transformer.transform(rawObject);
} else {
    throw new IllegalArgumentException("transformer expects ExpectedType, got " + rawObject.getClass());
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (input == null || !ExpectedType.class.isInstance(input)) {
    throw new IllegalArgumentException("Transformer input type mismatch: " + (input == null ? "null" : input.getClass().getName()));
}

Try / catch

try {
    result = transformer.transform(obj);
} catch (ActivitiException e) {
    Throwable root = e;
    while (root.getCause() != null) root = root.getCause(); // real error is inside primTransform
    log.error("transform failed for {}", obj, root);
}

Prevention

When it happens

Trigger: Any primTransform implementation throwing (e.g. incompatible input object type, parse failure, misconfigured transformer), which transform() converts into this message.

Common situations: Feeding an object of the wrong type into a transformer chain; transformers written for a legacy input format; NPEs inside custom primTransform implementations.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/transformer/AbstractTransformer.java:30

 */
package org.activiti.engine.impl.transformer;

import org.activiti.engine.ActivitiException;

/**
 * A Transformer is responsible of transforming an object into a different object
 * 
 * @author Esteban Robles Luna
 */
public abstract class AbstractTransformer implements Transformer {

    @Override
    public Object transform(Object anObject) {
        try {
            return this.primTransform(anObject);
        } catch (Exception e) {

            throw new ActivitiException("Error while executing transformation from object: " + anObject + " using transformer " + this, e);
        }
    }

    /**
     * Transforms anObject into a different object
     * 
     * @param anObject
     *            the object to be transformed
     * @return the transformed object
     */
    protected abstract Object primTransform(Object anObject) throws Exception;
}

View on GitHub (pinned to d6d39ce1c6)