Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

651 bug when requesting workflow instance from archive with includes contains actions #657

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ private void fillActions(WorkflowInstance instance, boolean includeStateVariable
long maxActions = getMaxActions(requestedMaxActions);
String tableName = ACTION.tableFor(instance);
String sql = sqlVariants
.limit("select nflow_workflow_action.* from " + tableName + " where workflow_id = ? order by id desc", maxActions);
.limit("select * from " + tableName + " where workflow_id = ? order by id desc", maxActions);
List<WorkflowInstanceAction.Builder> actionBuilders = jdbc.query(sql, workflowInstanceActionRowMapper,
instance.id);
if (includeStateVariables) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import io.nflow.engine.model.ModelObject;
import io.nflow.engine.service.WorkflowInstanceInclude;
import io.nflow.engine.workflow.instance.QueryWorkflowInstances;
import io.nflow.engine.workflow.instance.WorkflowInstance;
import io.nflow.engine.workflow.instance.WorkflowInstanceAction;

Expand Down Expand Up @@ -177,6 +178,9 @@ public void archiveWorkflowsWithActionsWorks() {

assertEquals(actionIds.size(), getArchiveActionCount());
assertEquals(actionCountAfter, actionCountBefore - actionIds.size());

assertWorkflowActionsThroughQuery(archivable1, 1);
assertWorkflowActionsThroughQuery(archivable2, 3);
}

@Test
Expand Down Expand Up @@ -476,6 +480,15 @@ private void assertArchivedWorkflowsDoNotExist(List<Long> workflowIds) {
}
}

private void assertWorkflowActionsThroughQuery(Long workflowId, int expectedActions) {
List<WorkflowInstance> archivedWorkflow = workflowInstanceDao.queryWorkflowInstances(new QueryWorkflowInstances.Builder()
.setQueryArchive(true)
.setIncludeActions(true)
.addIds(workflowId)
.build());
assertEquals(archivedWorkflow.get(0).actions.size(), expectedActions);
}

private void assertActiveActionsRemoved(List<Long> actionIds) {
for (long actionId : actionIds) {
int found = rowCount("select 1 from nflow_workflow_action where id = ?", actionId);
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire.version}</version>
<configuration>
<argLine>@{jacocoArgLine}</argLine>
<includes>
<include>**/*Test.java</include>
</includes>
Expand All @@ -222,7 +221,7 @@
<threadCount>1</threadCount>
<forkCount>${surefire.forkcount}</forkCount>
<!-- workaround for buggy cxf implementation on top of the "new" java async http client -->
<argLine>-Dorg.apache.cxf.transport.http.forceURLConnection=true</argLine>
<argLine>@{jacocoArgLine} -Dorg.apache.cxf.transport.http.forceURLConnection=true</argLine>
</configuration>
</plugin>
<plugin>
Expand Down