try {
RecurringTrader recurringTrader = RecurringTrader.getRecurringTrader(pm);
Trader trader = Trader.getTrader(pm);
pm.getExtent(Currency.class);
Currency currency = (Currency)pm.getObjectById(currencyID);
pm.getExtent(LegalEntity.class);
LegalEntity customer = (LegalEntity) pm.getObjectById(customerID);
RecurringOrder order = recurringTrader.createRecurringOrder(trader.getMandator(), customer, orderIDPrefix, currency);