if (newQuantity == null || newQuantity.compareTo(BigDecimal.ZERO) < 0) {
newQuantity = BigDecimal.ZERO;
}
newQuantity = newQuantity.add(BigDecimal.ONE);
ModelService updateProductAssoc = dctx.getModelService("updateProductAssoc");
Map<String, Object> updateCtx = updateProductAssoc.makeValid(context, ModelService.IN_PARAM, true, null);
updateCtx.putAll(updateProductAssoc.makeValid(existingProductAssoc, ModelService.IN_PARAM));
updateCtx.put("quantity", newQuantity);
dispatcher.runSync("updateProductAssoc", updateCtx);
} else {
Map<String, Object> createCtx = FastMap.newInstance();