* wouldn't be secure.
*/
public void doInsert(RunData data, Context context)
throws Exception
{
DoutboxEvent entry = new DoutboxEvent();
data.getParameters().setProperties(entry);
String myCode=data.getParameters().getString("doutboxeventcode");
int myStatus= data.getParameters().getInt("status");
boolean bSave=true;
if (myStatus==30){
bSave= sendEmail(data, context, entry);
if (bSave) entry.setStatus(50);
}
if (bSave){
entry.setDoutboxEventCode(getTempCode());
entry.setIssuedDate(parseDate(data.getParameters().getString("issueddate")));
entry.setClosedDate(parseDate(data.getParameters().getString("closeddate")));
entry.setCreatedBy(data.getUser().getUserName());
entry.setCreated(new Date());
entry.setModifiedBy(data.getUser().getUserName());
entry.setModified(new Date());
Connection conn = Transaction.begin(DoutboxEventPeer.DATABASE_NAME);
boolean success = false;
try {
entry.save(conn);
entry.setDoutboxEventCode(getRowCode("OE", entry.getDoutboxEventId()));
entry.save(conn);
Transaction.commit(conn);
success = true;
} finally {
if (!success) Transaction.safeRollback(conn);