I’m developing a plugin that will connect with axon server (not a spring boot application) , when I run the plugin I always got this error :
" Unable to resolve parameter 0 (CamundaActionEvent) in handler public void com.example.camundaplugin.aggregate.CamundaActionAggregate.on(com.example.camundaplugin.event.CamundaActionEvent)"
this is my Aggregate :
package com.example.camundaplugin.aggregate;
import com.example.camundaplugin.command.CamundaActionEventCmd;
import com.example.camundaplugin.event.CamundaActionEvent;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.axonframework.commandhandling.CommandHandler;
import org.axonframework.eventsourcing.EventSourcingHandler;
import org.axonframework.modelling.command.AggregateIdentifier;
import org.axonframework.modelling.command.AggregateLifecycle;
import org.axonframework.spring.stereotype.Aggregate;
import java.util.HashMap;
import java.util.UUID;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Aggregate
public class CamundaActionAggregate {
@AggregateIdentifier
private UUID id;
private String eventType;
private String initializer;
private HashMap<String, String> variables;
@CommandHandler
public CamundaActionAggregate(CamundaActionEventCmd cmd){
AggregateLifecycle.apply(new CamundaActionEvent(cmd.getId(), cmd.getEventType(), cmd.getInitializer(), cmd.getVariables()));
System.out.println("help world!");
}
@EventSourcingHandler
public void on(CamundaActionEvent event){
this.id = event.getId();
this.eventType = event.getEventType();
this.initializer = event.getInitializer();
this.variables = event.getVariables();
}
}
and this is the CamundaActionEvent class :
package com.example.camundaplugin.event;
import lombok.Data;
import java.util.HashMap;
import java.util.UUID;
@Data
public class CamundaActionEvent {
private final UUID id;
private final String eventType;
private final String initializer;
private final HashMap<String, String> variables;
}
Any idea !