Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute for a rule not belong to it #71

Closed
albertotn opened this issue Apr 5, 2016 · 2 comments
Closed

Execute for a rule not belong to it #71

albertotn opened this issue Apr 5, 2016 · 2 comments

Comments

@albertotn
Copy link

Just make a request to:

http://localhost:8080/gamification/gengine/execute

in POST method with following body:

{"resetGEPlayer":{"method":"POST","url":"http://localhost:8080/gamification/gengine/execute","body":"{\"gameId\": \"57025e32ccb9c66e350f4cbf\", \"playerId\":\"178\",\"actionId\":\"reset_game\", \"data\":{\"player_reset\":true}}","overrideMimeType":false,"headers":[["Content-Type","application/json"]]},"RecommendGameAction":{"method":"POST","url":"http://localhost:8080/gamification/gengine/execute","body":"{\"gameId\": \"56cc77737d847cb2a12ea89b\", \"playerId\":\"pinco\",\"actionId\":\"app_sent_recommandation\", \"data\":{}}","overrideMimeType":false,"headers":[["Content-Type","application/json"]]}}

REST method return 200 ok, but in console there is;

2016-04-05 12:53:14,929 INFO [GameWorkflow-pool-1-thread-5] - gameId:57025e32ccb9c66e350f4cbf, actionId: reset_game, playerId: 178, data: {player_reset=true}, factObjs: null
Exception in thread "pool-1-thread-5" java.lang.IllegalArgumentException: game 57025e32ccb9c66e350f4cbf not exist or action reset_game not belong to it
at eu.trentorise.game.managers.GameWorkflow.workflowExec(GameWorkflow.java:57)
at eu.trentorise.game.managers.QueueGameWorkflow$Execution.run(QueueGameWorkflow.java:73)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

this is right, I believe is more correct to return error, not http code 200

@mirkoperillo
Copy link
Member

Yes, that's right.

Change is not trivial, because exception is thrown on a thread different from controller one.
Modification impacts some core mechanism so it need time to be tested accurately.

This fix will be done later

@kazhamiakin
Copy link
Contributor

#101 should fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants