But that’s the problem. I can’t call the predicates in the code I load via the src_text
property via an ask()
call as I stated in this thread:
That’s what prompted me to try turning the code I load in the src_text
property into a module. I know the pengine_execute_single_user_action() predicate is definitely there as you can see in the `src_text property here:
Error: procedure `'7cd30558-35dc-4ba6-9d64-348ba0837c11':pengine_execute_single_user_action(A,B)' does not exist
Object received:{
"arg1": "procedure",
"arg2": "'7cd30558-35dc-4ba6-9d64-348ba0837c11':pengine_execute_single_user_action('$VAR'(0),'$VAR'(1))",
"code": "existence_error",
"data": "procedure `'7cd30558-35dc-4ba6-9d64-348ba0837c11':pengine_execute_single_user_action(A,B)' does not exist",
"event": "error",
"id": "7cd30558-35dc-4ba6-9d64-348ba0837c11",
"pengine": {
"options": {
"server": "http://localhost:3030/pengine",
"application": "tsll",
"destroy": false,
"src_text": "% ===================== EXECUTE A USER COMMAND =======================\n% ----->>>>> execute_user_action_list\n%\n%\tThis predicate executes a list of actions and then accumulates the\n%\t\tevents generated in the per-volley temporary database predicate\n%\t\tin order to build a full response to the caller.\n\n% All actions executed\nexecute_user_action_list_1([]) :- !.\n\n% Execute the next action.\nexecute_user_action_list_1([Action | Action_T]) :-\n\tnonvar(Action),\n\t% Execute the next action.\n\tcall(Action),\n\t!,\n\texecute_user_action_list_1(Action_T).\n\n% This predicate is here to skip failed actions so that\n% other actions can be tried.\n% TODO: Revisit the soundness of the above strategy.\nexecute_user_action_list_1([_ | Action_T]) :-\n\t!,\n\t% Skip the action.\n\texecute_user_action_list_1(Action_T).\n\nexecute_user_action_list(ActionList, Response) :-\n\tnonvar(ActionList),\n\t% Clear out the database predicate clauses that accumulate\n\t%\tas events are added to the database during the current\n\t%\tvolley.\n\tu_retractall(temp(_)),\n\t% Execute the given list of actions. The events generated\n\t%\twill accumulate in the temp predicate.\n\texecute_user_action_list_1(ActionList),\n\t% Build our response for this volley.\n\tcreate_response(Response),\n\t!.\n\n% ----->>>>> execute_single_user_action\n%\tHelper function to execute just one user action.\nexecute_single_user_action(Action, Response) :-\n\tnonvar(Action),\n\texecute_user_action_list([Action], Response).\n\n% ----->>>>> pengine_execute_single_user_action\n\n%\tHelper function to execute just one user action.\n**pengine_execute_single_user_action**(Action, Response) :-\n\tnonvar(Action),\n\texecute_user_action_list([Action], Response),\n\t!.\n\t% item_to_dict(Response, JsonTerm).\n",
"format": "json"
},
"id": "7cd30558-35dc-4ba6-9d64-348ba0837c11",
"request": {}
}
}
But as I show in that other thread, I get an existence error when I try to call it from an ask()
call, with or without having a module declaration at the top of the src_text
code.