Transaction reportTransaction = storageManager.getTransaction();
sequenceReport.setInternalSequenceID(internalSequenceID);
CreateSeqBean createSeqFindBean = new CreateSeqBean ();
createSeqFindBean.setInternalSequenceID(internalSequenceID);
CreateSeqBean createSeqBean = createSeqMgr.findUnique(createSeqFindBean);
//if data not is available sequence has to be terminated or timedOut.
if (createSeqBean==null) {
//check weather this is an terminated sequence.
if (isSequenceTerminated(internalSequenceID,seqPropMgr)) {
fillTerminatedOutgoingSequenceInfo (sequenceReport,internalSequenceID,seqPropMgr);
return sequenceReport;
}
if (isSequenceTimedout(internalSequenceID,seqPropMgr)) {
fillTimedoutOutgoingSequenceInfo (sequenceReport,internalSequenceID,seqPropMgr);
return sequenceReport;
}
//sequence must hv been timed out before establiching. No other posibility I can think of.
//this does not get recorded since there is no key (which is normally the sequenceID) to store it.
//(properties with key as the internalSequenceID get deleted in timing out)
//so, setting the sequence status to INITIAL
sequenceReport.setSequenceStatus(SequenceReport.SEQUENCE_STATUS_INITIAL);
//returning the current sequence report.
return sequenceReport;
}
String outSequenceID = createSeqBean.getSequenceID();
if (outSequenceID==null) {
sequenceReport.setInternalSequenceID(internalSequenceID);
sequenceReport.setSequenceStatus(SequenceReport.SEQUENCE_STATUS_INITIAL);
sequenceReport.setSequenceDirection(SequenceReport.SEQUENCE_DIRECTION_OUT);