I have the following FSM
public class ActorOnFsm {
public static enum State {
FirstState,
SecondState,
ThirdState,
FourthState
}
public static final class ServiceData {
}
public class ActorFSM extends AbstractFSM<State, ServiceData> {
{
startWith(FirstState, new ServiceData());
when(FirstState,
matchEvent(SomeMessage.class,
ServiceData.class,
(powerOn, noData) ->
goTo(SecondState)
.replying(SecondState))
);
when(SecondState,
matchEvent(SomeOtherMessage.class,
ServiceData.class,
(powerOn, noData) ->
goTo(ThirdState)
.replying(ThirdState))
);
when(FirstState,
matchEvent(soemErrorMessage.class,
ServiceData.class,
(powerOn, noData) ->
goTo(FourthState)
.replying(FourthState))
);
initialize();
}
}
}
I initialize the actor like this
final Props props = Props.create(ActorOnFsm.class); final ActorRef underTest = system.actorOf(props);
This gives an error " unknown actor creator [ActorOnFsm]
on the line
final Props props = Props.create(ActorOnFsm.class);
Wht is the correct way to initialize this actor?
I also tried changing the class to extend AbstractLogging but same result
I also tried creating an empty constructor but same result
Tried sending the state and data in the props but still get the same error
final Props props = Props.create(DeployerOnFsm.class, state, data);