* Insert a new activity info into database.
*/
private void insertActivity()
throws SQLException {
Connection con = null;
UniversalPrepStmt prepStmt = null;
try {
con = ds.getConnection();
prepStmt = new UniversalPrepStmt
(ds, con, "INSERT INTO activity (DBId, "
+ "ProcessMgr, ProcessMgrVersion, ProcessName, ProcessDBId, "
+ "Name, Description, BlockActivity, "
+ "Implementation, Performer, Priority, Executor, StartMode, "
+ "FinishMode, State, StateTime, JoinMode, SplitMode, "
+ "ThreadInfo, Subflow, SuspendAccum, PendingException, "
+ "WaitOnProc, WaitOnChan, Flags) "
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
+ "?, ?, ?, ?, ?, ?, ?, ?)");
int offset = 1;
prepStmt.setLong(offset++,
((Long)ctx.getPrimaryKey()).longValue());
prepStmt.setString (offset++, processMgr);
prepStmt.setString (offset++, processMgrVers);
prepStmt.setString (offset++, processName);
prepStmt.setLong(offset++, processPk.longValue());
prepStmt.setString (offset++, paName);
prepStmt.setString (offset++, paDescription);
prepStmt.setLong (offset++, paBlockActivity);
prepStmt.setBinary (offset++, paActImpl);
prepStmt.setString (offset++, paPerformer);
prepStmt.setInt(offset++, paPriority.toInt ());
prepStmt.setInt (offset++, paExecStat);
prepStmt.setString (offset++, paStartMode.toString());
prepStmt.setString (offset++, paFinishMode.toString());
prepStmt.setString (offset++, paTypedState.toString ());
prepStmt.setTimestamp
(offset++, new Timestamp (paLastStateTime.getTime()));
prepStmt.setString (offset++, paJoinMode.toString ());
prepStmt.setString (offset++, paSplitMode.toString ());
prepStmt.setBinary (offset++, paThreadInfo);
prepStmt.setLong
(offset++, paSubflow == null ? null : new Long(paSubflow));
prepStmt.setLong(offset++, new Long (0)); // SuspendAccum
prepStmt.setString(offset++, null); // PendingException
prepStmt.setLong(offset++, null); // WaitOnProc
prepStmt.setString(offset++, null); // WaitOnChan
prepStmt.setInt(offset++, paFlags); // Flags
// now execute
prepStmt.executeUpdate();
WfProcessEJB.updateDeadlines
(ds, con, processPk, (Long)ctx.getPrimaryKey(),
paDeadlines, false);
} catch (IOException ioe) {
logger.error (ioe.getMessage(), ioe);