Skip to content

Commit a318e4b

Browse files
committed
Fix. Action or TimerAction
1 parent 5cb6da0 commit a318e4b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/io/eigr/spawn/internal/handlers/ActorServiceHandler.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,16 @@ private Optional<Value> callAction(String system, String actor, String commandNa
123123
this.cache.put(actorKey, actorRef);
124124
}
125125

126-
final Entity.EntityMethod entityMethod = entity.getActions().get(commandName);
126+
Entity.EntityMethod entityMethod;
127+
128+
if (entity.getActions().containsKey(commandName)) {
129+
entityMethod = entity.getActions().get(commandName);
130+
} else if (entity.getTimerActions().containsKey(commandName)) {
131+
entityMethod = entity.getTimerActions().get(commandName);
132+
} else {
133+
throw new ActorInvokeException(String.format("The Actor does not have the desired action: %s", commandName));
134+
}
135+
127136
final Method actorMethod = entityMethod.getMethod();
128137
Class inputType = entityMethod.getInputType();
129138

0 commit comments

Comments
 (0)