* @param toAccount
* @param amount
* @throws GoalNotFoundException
*/
private static void transferMoney(Browser browser, String fromAccount, String toAccount, BigInteger amount) throws GoalNotFoundException {
Agent agent = new Agent(browser);
// collect follow rel actions from describedBy URL
// for json-ld, would that be the context?
// could we construct schema.org actions for this?
agent.identifyGoal("http://localhost:8080/banking/ns/transfer", browser.getCurrentContext());
// enable client to submit forms
// TODO: look into schema.org actions to see if they say something about required data for an action.
agent.addSubmitFormAction(new SubmitFormAction("bankAccountForm", Args.of("accountNumber", fromAccount)));
agent.addSubmitFormAction(new SubmitFormAction("moneyTransferForm", Args.of("amount", amount, "to", toAccount)));
Browsable result = agent.browseForGoal();
System.out.println("\n--- result ---");
System.out.println(result.toString());
System.out.println("--------------\n");
}