Skip to content

Commit

Permalink
error detail breadcrumb updated with the error detail title (kiegroup#21
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nmirasch authored and cristianonicolai committed Mar 1, 2018
1 parent 0a8d580 commit 69f2dd1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public void onStartup(final PlaceRequest place) {
this.place = place;
}

public static String getErrorDetailTitle(final ExecutionErrorSummary summary) {
return summary.getProcessId() + " - " + summary.getProcessInstanceId() + " (" + summary.getDeploymentId() + ")";
}

public void onExecutionErrorSelectedEvent(@Observes ExecutionErrorSelectedEvent event) {
this.serverTemplateId = event.getServerTemplateId();
this.deploymentId = event.getDeploymentId();
Expand Down Expand Up @@ -104,10 +108,6 @@ public void refreshExecutionErrorDataRemote(final String serverTemplateId,
errorId);
}

private String getErrorDetailTitle(ExecutionErrorSummary summary) {
return summary.getProcessId() + " - " + summary.getProcessInstanceId() + " (" + summary.getDeploymentId() + ")";
}

@Inject
public void setExecutorService(final Caller<ExecutorService> executorServices) {
this.executorServices = executorServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.jbpm.workbench.common.client.menu.RefreshMenuBuilder;
import org.jbpm.workbench.df.client.filter.FilterSettings;
import org.jbpm.workbench.df.client.filter.FilterSettingsBuilderHelper;
import org.jbpm.workbench.es.client.editors.errordetails.ExecutionErrorDetailsPresenter;
import org.jbpm.workbench.es.client.i18n.Constants;
import org.jbpm.workbench.es.model.ExecutionErrorSummary;
import org.jbpm.workbench.es.client.editors.events.ExecutionErrorSelectedEvent;
Expand Down Expand Up @@ -246,7 +247,7 @@ public Menus getMenus() {
}

public void selectExecutionError(final ExecutionErrorSummary summary) {
setupDetailBreadcrumb(constants.ExecutionErrorBreadcrumb(summary.getErrorId()));
setupDetailBreadcrumb(constants.ExecutionErrorBreadcrumb(ExecutionErrorDetailsPresenter.getErrorDetailTitle(summary)));
placeManager.goTo(PerspectiveIds.EXECUTION_ERROR_DETAILS_SCREEN);
executionErrorSelectedEvent.fire(new ExecutionErrorSelectedEvent(getSelectedServerTemplate(),
summary.getDeploymentId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.google.gwtmockito.GwtMockitoTestRunner;
import org.jboss.errai.common.client.api.Caller;
import org.jbpm.workbench.es.model.ErrorSummary;
import org.jbpm.workbench.es.model.ExecutionErrorSummary;
import org.jbpm.workbench.es.client.editors.events.ExecutionErrorSelectedEvent;
import org.jbpm.workbench.es.service.ExecutorService;
Expand Down Expand Up @@ -98,4 +99,17 @@ private void assertRefresErrorDetails(){
" (" + testError.getDeploymentId() + ")",
captor.getValue().getTitle());
}

@Test
public void testErrorDetailTitleGeneration() {

ExecutionErrorSummary testError = createTestError(errorId,
deploymentId);
String title = ExecutionErrorDetailsPresenter.getErrorDetailTitle(testError);

assertEquals(testError.getProcessId() +
" - " + testError.getProcessInstanceId() +
" (" + testError.getDeploymentId() + ")",
title);
}
}

0 comments on commit 69f2dd1

Please sign in to comment.