public object Execute(object system) { PurchaseOrder purchaseOrder = null; PetStore ps = (PetStore)system; long id = ps.nextPurchaseOrderId(); if (!PurchaseOrder.checkCreate(id, ps.getAccount(accountLogin), this.shippingInfo, this.billingInfo, this.items, PrevalenceEngine.Now)) { throw new ArgumentException("Invalid purchase order parameters."); } purchaseOrder = new PurchaseOrder(id, ps.getAccount(accountLogin), shippingInfo, billingInfo, items, PrevalenceEngine.Now); ps.addPurchaseOrder(purchaseOrder); return(purchaseOrder); }