Unable to add Custom Object Type using setCustomPostVariableTypes


Reference Code

I want to store object of this class in flowable context,

public class DeployerClientConfiguration extends SerializableType {

    public static final String TYPE_NAME = "deployerClientConfigurationDetails";

    private String uaaUrl;
    private String clientId;
    private String clientSecret;

    public String getTypeName() {
        return TYPE_NAME;

And this is how I’m adding the custom variable type,

    public EngineConfigurationConfigurer<SpringProcessEngineConfiguration> configurer() {
        return engineConfiguration -> {
            engineConfiguration.setCustomPostVariableTypes(Arrays.asList(new DeployerClientConfiguration()));

And through DelegateExcution I’m setting the variable,
execution.setVariable(moduleName, deployerClientConfiguration);

And I still get the same error,
"couldn't find a variable type that is able to serialize DeployerClientConfiguration"

Any suggestions?


You’re extending SerializableType, which still has following implementation: flowable-engine/SerializableType.java at main · flowable/flowable-engine · GitHub

You will need to override the isAbleToStore method to do what you want.