in taverna-provenanceconnector/src/main/java/org/apache/taverna/provenance/lineageservice/ProvenanceQuery.java [1940:2001]
public DataflowInvocation getDataflowInvocation(
ProcessorEnactment processorEnactment) {
String query = "SELECT " + DataflowInvocationTable.dataflowInvocationId
+ "," + DataflowInvocationTable.inputsDataBinding + ","
+ DataflowInvocationTable.invocationEnded + ","
+ DataflowInvocationTable.invocationStarted + ","
+ DataflowInvocationTable.outputsDataBinding + ","
+ DataflowInvocationTable.parentProcessorEnactmentId + ","
+ DataflowInvocationTable.workflowId + ","
+ DataflowInvocationTable.workflowRunId + ","
+ DataflowInvocationTable.completed + " FROM "
+ DataflowInvocationTable.DataflowInvocation + " WHERE "
+ DataflowInvocationTable.parentProcessorEnactmentId + "=?";
DataflowInvocation dataflowInvocation = null;
try (Connection connection = getConnection();
PreparedStatement statement = connection
.prepareStatement(query)) {
statement.setString(1, processorEnactment.getProcessEnactmentId());
ResultSet rs = statement.executeQuery();
if (!rs.next()) {
logger.warn("Could not find DataflowInvocation for processorEnactmentId="
+ processorEnactment.getProcessEnactmentId());
return null;
}
dataflowInvocation = new DataflowInvocation();
dataflowInvocation.setDataflowInvocationId(rs
.getString(DataflowInvocationTable.dataflowInvocationId
.name()));
dataflowInvocation
.setInputsDataBindingId(rs
.getString(DataflowInvocationTable.inputsDataBinding
.name()));
dataflowInvocation.setInvocationEnded(rs
.getTimestamp(DataflowInvocationTable.invocationEnded
.name()));
dataflowInvocation.setInvocationStarted(rs
.getTimestamp(DataflowInvocationTable.invocationStarted
.name()));
dataflowInvocation.setOutputsDataBindingId(rs
.getString(DataflowInvocationTable.outputsDataBinding
.name()));
dataflowInvocation
.setParentProcessorEnactmentId(rs
.getString(DataflowInvocationTable.parentProcessorEnactmentId
.name()));
dataflowInvocation.setWorkflowId(rs
.getString(DataflowInvocationTable.workflowId.name()));
dataflowInvocation.setWorkflowRunId(rs
.getString(DataflowInvocationTable.workflowRunId.name()));
dataflowInvocation.setCompleted(rs
.getBoolean(DataflowInvocationTable.completed.name()));
if (rs.next()) {
logger.error("Found more than one DataflowInvocation for processorEnactmentId="
+ processorEnactment.getProcessEnactmentId());
return null;
}
} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
logger.warn("Could not execute query " + query, e);
}
return dataflowInvocation;
}