Fix [2836467] - Packout workflow not exporting all the transitions
https://sourceforge.net/tracker/?func=detail&aid=2836467&group_id=176962&atid=879332
This commit is contained in:
parent
fcba5f2548
commit
a6beb9d4a7
|
@ -254,11 +254,12 @@ public class WorkflowElementHandler extends AbstractElementHandler {
|
||||||
AttributesImpl atts = new AttributesImpl();
|
AttributesImpl atts = new AttributesImpl();
|
||||||
|
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
ResultSet rs = null;
|
||||||
pstmt = DB.prepareStatement(sql, getTrxName(ctx));
|
pstmt = DB.prepareStatement(sql, getTrxName(ctx));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
ResultSet rs = pstmt.executeQuery();
|
rs = pstmt.executeQuery();
|
||||||
|
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
X_AD_Workflow m_Workflow = new X_AD_Workflow(ctx,
|
X_AD_Workflow m_Workflow = new X_AD_Workflow(ctx,
|
||||||
|
@ -270,11 +271,12 @@ public class WorkflowElementHandler extends AbstractElementHandler {
|
||||||
+ AD_Workflow_ID;
|
+ AD_Workflow_ID;
|
||||||
|
|
||||||
PreparedStatement pstmt1 = null;
|
PreparedStatement pstmt1 = null;
|
||||||
|
ResultSet rs1 = null;
|
||||||
try {
|
try {
|
||||||
pstmt1 = DB.prepareStatement(sql1, getTrxName(ctx));
|
pstmt1 = DB.prepareStatement(sql1, getTrxName(ctx));
|
||||||
// Generated workflowNodeNext(s) and
|
// Generated workflowNodeNext(s) and
|
||||||
// workflowNodeNextCondition(s)
|
// workflowNodeNextCondition(s)
|
||||||
ResultSet rs1 = pstmt1.executeQuery();
|
rs1 = pstmt1.executeQuery();
|
||||||
while (rs1.next()) {
|
while (rs1.next()) {
|
||||||
|
|
||||||
int nodeId = rs1.getInt("AD_WF_Node_ID");
|
int nodeId = rs1.getInt("AD_WF_Node_ID");
|
||||||
|
@ -282,45 +284,57 @@ public class WorkflowElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
ad_wf_nodenext_id = 0;
|
ad_wf_nodenext_id = 0;
|
||||||
|
|
||||||
sql = "SELECT ad_wf_nodenext_id from ad_wf_nodenext WHERE ad_wf_node_id = ?";
|
String sqlnn = "SELECT AD_WF_NodeNext_ID FROM AD_WF_NodeNext WHERE AD_WF_Node_ID = ?";
|
||||||
ad_wf_nodenext_id = DB.getSQLValue(null, sql, nodeId);
|
PreparedStatement pstmtnn = null;
|
||||||
|
ResultSet rsnn = null;
|
||||||
|
try {
|
||||||
|
pstmtnn = DB.prepareStatement(sqlnn, getTrxName(ctx));
|
||||||
|
pstmtnn.setInt(1, nodeId);
|
||||||
|
rsnn = pstmtnn.executeQuery();
|
||||||
|
while (rsnn.next()) {
|
||||||
|
ad_wf_nodenext_id = rsnn.getInt("AD_WF_NodeNext_ID");
|
||||||
if (ad_wf_nodenext_id > 0) {
|
if (ad_wf_nodenext_id > 0) {
|
||||||
createNodeNext(ctx, document, ad_wf_nodenext_id);
|
createNodeNext(ctx, document, ad_wf_nodenext_id);
|
||||||
|
|
||||||
ad_wf_nodenextcondition_id = 0;
|
ad_wf_nodenextcondition_id = 0;
|
||||||
|
|
||||||
sql = "SELECT ad_wf_nextcondition_id from ad_wf_nextcondition WHERE ad_wf_nodenext_id = ?";
|
String sqlnnc = "SELECT AD_WF_NextCondition_ID FROM AD_WF_NextCondition WHERE AD_WF_NodeNext_ID = ?";
|
||||||
ad_wf_nodenextcondition_id = DB.getSQLValue(null,
|
PreparedStatement pstmtnnc = null;
|
||||||
sql, nodeId);
|
ResultSet rsnnc = null;
|
||||||
log
|
|
||||||
.info("ad_wf_nodenextcondition_id: "
|
|
||||||
+ String
|
|
||||||
.valueOf(ad_wf_nodenextcondition_id));
|
|
||||||
if (ad_wf_nodenextcondition_id > 0) {
|
|
||||||
createNodeNextCondition(ctx, document,
|
|
||||||
ad_wf_nodenextcondition_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
rs1.close();
|
|
||||||
pstmt1.close();
|
|
||||||
pstmt1 = null;
|
|
||||||
} finally {
|
|
||||||
try {
|
try {
|
||||||
if (pstmt1 != null)
|
pstmtnnc = DB.prepareStatement(sqlnnc, getTrxName(ctx));
|
||||||
pstmt1.close();
|
pstmtnnc.setInt(1, ad_wf_nodenext_id);
|
||||||
} catch (Exception e) {
|
rsnnc = pstmtnnc.executeQuery();
|
||||||
|
while (rsnnc.next()) {
|
||||||
|
ad_wf_nodenextcondition_id = rsnnc.getInt("AD_WF_NextCondition_ID");
|
||||||
|
log.info("ad_wf_nodenextcondition_id: " + String.valueOf(ad_wf_nodenextcondition_id));
|
||||||
|
if (ad_wf_nodenextcondition_id > 0) {
|
||||||
|
createNodeNextCondition(ctx, document, ad_wf_nodenextcondition_id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
DB.close(rsnnc, pstmtnnc);
|
||||||
|
rsnnc = null;
|
||||||
|
pstmtnnc = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
DB.close(rsnn, pstmtnn);
|
||||||
|
rsnn = null;
|
||||||
|
pstmtnn = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
DB.close(rs1, pstmt1);
|
||||||
|
rs1 = null;
|
||||||
pstmt1 = null;
|
pstmt1 = null;
|
||||||
|
|
||||||
document.endElement("", "", "workflow");
|
document.endElement("", "", "workflow");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rs.close();
|
|
||||||
pstmt.close();
|
|
||||||
pstmt = null;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.log(Level.SEVERE, "Workflow", e);
|
log.log(Level.SEVERE, "Workflow", e);
|
||||||
if (e instanceof SAXException)
|
if (e instanceof SAXException)
|
||||||
|
@ -330,11 +344,8 @@ public class WorkflowElementHandler extends AbstractElementHandler {
|
||||||
else
|
else
|
||||||
throw new RuntimeException("Failed to export workflow.", e);
|
throw new RuntimeException("Failed to export workflow.", e);
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
DB.close(rs, pstmt);
|
||||||
if (pstmt != null)
|
rs = null;
|
||||||
pstmt.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
pstmt = null;
|
pstmt = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue