Skip to content

Commit e3e86be

Browse files
authored
Merge pull request #657 from NitorCreations/651-bug-when-requesting-workflow-instance-from-archive-with-includes-contains-actions
651 bug when requesting workflow instance from archive with includes contains actions
2 parents 9044c16 + 72d2ad2 commit e3e86be

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

nflow-engine/src/main/java/io/nflow/engine/internal/dao/WorkflowInstanceDao.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ private void fillActions(WorkflowInstance instance, boolean includeStateVariable
809809
long maxActions = getMaxActions(requestedMaxActions);
810810
String tableName = ACTION.tableFor(instance);
811811
String sql = sqlVariants
812-
.limit("select nflow_workflow_action.* from " + tableName + " where workflow_id = ? order by id desc", maxActions);
812+
.limit("select * from " + tableName + " where workflow_id = ? order by id desc", maxActions);
813813
List<WorkflowInstanceAction.Builder> actionBuilders = jdbc.query(sql, workflowInstanceActionRowMapper,
814814
instance.id);
815815
if (includeStateVariables) {

nflow-engine/src/test/java/io/nflow/engine/internal/dao/MaintenanceDaoTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
import io.nflow.engine.model.ModelObject;
3131
import io.nflow.engine.service.WorkflowInstanceInclude;
32+
import io.nflow.engine.workflow.instance.QueryWorkflowInstances;
3233
import io.nflow.engine.workflow.instance.WorkflowInstance;
3334
import io.nflow.engine.workflow.instance.WorkflowInstanceAction;
3435

@@ -177,6 +178,9 @@ public void archiveWorkflowsWithActionsWorks() {
177178

178179
assertEquals(actionIds.size(), getArchiveActionCount());
179180
assertEquals(actionCountAfter, actionCountBefore - actionIds.size());
181+
182+
assertWorkflowActionsThroughQuery(archivable1, 1);
183+
assertWorkflowActionsThroughQuery(archivable2, 3);
180184
}
181185

182186
@Test
@@ -476,6 +480,15 @@ private void assertArchivedWorkflowsDoNotExist(List<Long> workflowIds) {
476480
}
477481
}
478482

483+
private void assertWorkflowActionsThroughQuery(Long workflowId, int expectedActions) {
484+
List<WorkflowInstance> archivedWorkflow = workflowInstanceDao.queryWorkflowInstances(new QueryWorkflowInstances.Builder()
485+
.setQueryArchive(true)
486+
.setIncludeActions(true)
487+
.addIds(workflowId)
488+
.build());
489+
assertEquals(archivedWorkflow.get(0).actions.size(), expectedActions);
490+
}
491+
479492
private void assertActiveActionsRemoved(List<Long> actionIds) {
480493
for (long actionId : actionIds) {
481494
int found = rowCount("select 1 from nflow_workflow_action where id = ?", actionId);

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@
211211
<artifactId>maven-surefire-plugin</artifactId>
212212
<version>${maven-surefire.version}</version>
213213
<configuration>
214-
<argLine>@{jacocoArgLine}</argLine>
215214
<includes>
216215
<include>**/*Test.java</include>
217216
</includes>
@@ -222,7 +221,7 @@
222221
<threadCount>1</threadCount>
223222
<forkCount>${surefire.forkcount}</forkCount>
224223
<!-- workaround for buggy cxf implementation on top of the "new" java async http client -->
225-
<argLine>-Dorg.apache.cxf.transport.http.forceURLConnection=true</argLine>
224+
<argLine>@{jacocoArgLine} -Dorg.apache.cxf.transport.http.forceURLConnection=true</argLine>
226225
</configuration>
227226
</plugin>
228227
<plugin>

0 commit comments

Comments
 (0)