Skip to content
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 @@ -25,20 +25,20 @@ public Long countIncident(
String url = camundaUrl + "/engine-rest/incident/count";

String param = "";
param += addQueryParameter(param, "incidentId", incidentId);
param += addQueryParameter(param, "incidentType", incidentType);
param += addQueryParameter(param, "incidentMessage", incidentMessage);
param += addQueryParameter(param, "processDefinitionId", processDefinitionId);
param += addQueryParameter(param, "processDefinitionKeyIn", processDefinitionKeyIn);
param += addQueryParameter(param, "processInstanceId", processInstanceId);
param += addQueryParameter(param, "executionId", executionId);
param += addQueryParameter(param, "activityId", activityId);
param += addQueryParameter(param, "causeIncidentId", causeIncidentId);
param += addQueryParameter(param, "rootCauseIncidentId", rootCauseIncidentId);
param += addQueryParameter(param, "configuration", configuration);
param += addQueryParameter(param, "tenantIdIn", tenantIdIn);
param += addQueryParameter(param, "jobDefinitionIdIn", jobDefinitionIdIn);
param += addQueryParameter(param, "name", name);
param += addQueryParameter(param, "incidentId", incidentId, true);
param += addQueryParameter(param, "incidentType", incidentType, true);
param += addQueryParameter(param, "incidentMessage", incidentMessage, true);
param += addQueryParameter(param, "processDefinitionId", processDefinitionId, false);
param += addQueryParameter(param, "processDefinitionKeyIn", processDefinitionKeyIn, false);
param += addQueryParameter(param, "processInstanceId", processInstanceId, true);
param += addQueryParameter(param, "executionId", executionId, true);
param += addQueryParameter(param, "activityId", activityId, true);
param += addQueryParameter(param, "causeIncidentId", causeIncidentId, true);
param += addQueryParameter(param, "rootCauseIncidentId", rootCauseIncidentId, true);
param += addQueryParameter(param, "configuration", configuration, true);
param += addQueryParameter(param, "tenantIdIn", tenantIdIn, true);
param += addQueryParameter(param, "jobDefinitionIdIn", jobDefinitionIdIn, true);
param += addQueryParameter(param, "name", name, true);

url += param;

Expand All @@ -54,19 +54,19 @@ public Collection<Incident> findIncident(
String url = camundaUrl + "/engine-rest/incident";

String param = "";
param += addQueryParameter(param, "incidentId", incidentId);
param += addQueryParameter(param, "incidentType", incidentType);
param += addQueryParameter(param, "incidentMessage", incidentMessage);
param += addQueryParameter(param, "processDefinitionId", processDefinitionId);
param += addQueryParameter(param, "processDefinitionKeyIn", processDefinitionKeyIn);
param += addQueryParameter(param, "processInstanceId", processInstanceId);
param += addQueryParameter(param, "executionId", executionId);
param += addQueryParameter(param, "activityId", activityId);
param += addQueryParameter(param, "causeIncidentId", causeIncidentId);
param += addQueryParameter(param, "rootCauseIncidentId", rootCauseIncidentId);
param += addQueryParameter(param, "configuration", configuration);
param += addQueryParameter(param, "tenantIdIn", tenantIdIn);
param += addQueryParameter(param, "jobDefinitionIdIn", jobDefinitionIdIn);
param += addQueryParameter(param, "incidentId", incidentId, true);
param += addQueryParameter(param, "incidentType", incidentType, true);
param += addQueryParameter(param, "incidentMessage", incidentMessage, true);
param += addQueryParameter(param, "processDefinitionId", processDefinitionId, false);
param += addQueryParameter(param, "processDefinitionKeyIn", processDefinitionKeyIn, false);
param += addQueryParameter(param, "processInstanceId", processInstanceId, true);
param += addQueryParameter(param, "executionId", executionId, true);
param += addQueryParameter(param, "activityId", activityId, true);
param += addQueryParameter(param, "causeIncidentId", causeIncidentId, true);
param += addQueryParameter(param, "rootCauseIncidentId", rootCauseIncidentId, true);
param += addQueryParameter(param, "configuration", configuration, true);
param += addQueryParameter(param, "tenantIdIn", tenantIdIn, true);
param += addQueryParameter(param, "jobDefinitionIdIn", jobDefinitionIdIn, true);

url += param;

Expand All @@ -78,7 +78,7 @@ public List<Incident> findIncidentByInstanceId(String processInstanceId, CIBUser
String url = camundaUrl + "/engine-rest/incident";

String param = "";
param += addQueryParameter(param, "processInstanceId", Optional.of(processInstanceId));
param += addQueryParameter(param, "processInstanceId", Optional.of(processInstanceId), true);

url += param;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,16 +317,16 @@ protected static RuntimeException wrapException(HttpStatusCodeException cause, C
return wrapperException;
}

protected String addQueryParameter(String param, String name, Optional<String> value) {
protected String addQueryParameter(String param, String name, Optional<String> value, boolean encode) {
if (value.isPresent()) {
try {
String val = URLEncoder.encode(value.get(), "UTF-8");
String val = encode ? URLEncoder.encode(value.get(), "UTF-8") : value.get();
return (param.isEmpty() ? "?" : "&") + name + "=" + val;
} catch (UnsupportedEncodingException e) {
throw new SystemException(e);
}
}

return "";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public TaskCount findTasksCount(
String url = camundaUrl + "/engine-rest/task/count";

String param = "";
param += addQueryParameter(param, "name", name);
param += addQueryParameter(param, "nameLike", nameLike);
param += addQueryParameter(param, "taskDefinitionKey", taskDefinitionKey);
param += addQueryParameter(param, "taskDefinitionKeyIn", taskDefinitionKeyIn);
param += addQueryParameter(param, "name", name, true);
param += addQueryParameter(param, "nameLike", nameLike, true);
param += addQueryParameter(param, "taskDefinitionKey", taskDefinitionKey, true);
param += addQueryParameter(param, "taskDefinitionKeyIn", taskDefinitionKeyIn, true);

url += param;

Expand Down Expand Up @@ -198,7 +198,7 @@ public Collection<IdentityLink> findIdentityLink(String taskId, Optional<String>
String url = camundaUrl + "/engine-rest/task/" + taskId + "/identity-links";

String param = "";
param += addQueryParameter(param, "type", type);
param += addQueryParameter(param, "type", type, true);

url += param;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,46 +172,46 @@ private String createFindUserCaseInsensitiveUrl(Optional<String> id, Optional<St
if (firstNameLike.isPresent()) { // javier, JAVIER, Javier
try {
String fnDecoded = URLDecoder.decode(firstNameLike.get(), "UTF-8");
param += addQueryParameter(param, "firstNameLike", Optional.of(fnDecoded.replace("*", wcard)));
param += addQueryParameter(param, "firstNameLike", Optional.of(fnDecoded.replace("*", wcard)), true);
} catch (UnsupportedEncodingException e) {
throw new SystemException(e);
}
}
if (lastNameLike.isPresent()) { // medina, MEDINA, Medina
try {
String lnDecoded = URLDecoder.decode(lastNameLike.get(), "UTF-8");
param += addQueryParameter(param, "lastNameLike", Optional.of(lnDecoded.replace("*", wcard)));
param += addQueryParameter(param, "lastNameLike", Optional.of(lnDecoded.replace("*", wcard)), true);
} catch (UnsupportedEncodingException e) {
throw new SystemException(e);
}
}
if (emailLike.isPresent()) {
try {
String eDecoded = URLDecoder.decode(emailLike.get(), "UTF-8");
param += addQueryParameter(param, "emailLike", Optional.of(eDecoded.replace("*", wcard)));
param += addQueryParameter(param, "emailLike", Optional.of(eDecoded.replace("*", wcard)), true);
} catch (UnsupportedEncodingException e) {
throw new SystemException(e);
}
}
if (id.isPresent()) {
try {
String eDecoded = URLDecoder.decode(id.get(), "UTF-8");
param += addQueryParameter(param, "id", Optional.of(eDecoded));
param += addQueryParameter(param, "id", Optional.of(eDecoded), true);
} catch (UnsupportedEncodingException e) {
throw new SystemException(e);
}
}

param += addQueryParameter(param, "firstName", firstName);
param += addQueryParameter(param, "lastName", lastName);
param += addQueryParameter(param, "email", email);
param += addQueryParameter(param, "memberOfGroup", memberOfGroup);
param += addQueryParameter(param, "memberOfTenant", memberOfTenant);
param += addQueryParameter(param, "idIn", idIn);
param += addQueryParameter(param, "firstResult", firstResult);
param += addQueryParameter(param, "maxResults", maxResults);
param += addQueryParameter(param, "sortBy", sortBy);
param += addQueryParameter(param, "sortOrder", sortOrder);
param += addQueryParameter(param, "firstName", firstName, true);
param += addQueryParameter(param, "lastName", lastName, true);
param += addQueryParameter(param, "email", email, true);
param += addQueryParameter(param, "memberOfGroup", memberOfGroup, true);
param += addQueryParameter(param, "memberOfTenant", memberOfTenant, true);
param += addQueryParameter(param, "idIn", idIn, true);
param += addQueryParameter(param, "firstResult", firstResult, true);
param += addQueryParameter(param, "maxResults", maxResults, true);
param += addQueryParameter(param, "sortBy", sortBy, true);
param += addQueryParameter(param, "sortOrder", sortOrder, true);

url += param;

Expand Down Expand Up @@ -305,21 +305,21 @@ public Collection<UserGroup> findGroups(Optional<String> id, Optional<String> na
if (nameLike.isPresent()) {
try {
String eDecoded = URLDecoder.decode(nameLike.get(), "UTF-8");
param += addQueryParameter(param, "nameLike", Optional.of(eDecoded.replace("*", wcard)));
param += addQueryParameter(param, "nameLike", Optional.of(eDecoded.replace("*", wcard)), true);
} catch (UnsupportedEncodingException e) {
throw new SystemException(e);
}
}

param += addQueryParameter(param, "id", id);
param += addQueryParameter(param, "name", name);
param += addQueryParameter(param, "type", type);
param += addQueryParameter(param, "member", member);
param += addQueryParameter(param, "memberOfTenant", memberOfTenant);
param += addQueryParameter(param, "sortBy", sortBy);
param += addQueryParameter(param, "sortOrder", sortOrder);
param += addQueryParameter(param, "firstResult", firstResult);
param += addQueryParameter(param, "maxResults", maxResults);
param += addQueryParameter(param, "id", id, true);
param += addQueryParameter(param, "name", name, true);
param += addQueryParameter(param, "type", type, true);
param += addQueryParameter(param, "member", member, true);
param += addQueryParameter(param, "memberOfTenant", memberOfTenant, true);
param += addQueryParameter(param, "sortBy", sortBy, true);
param += addQueryParameter(param, "sortOrder", sortOrder, true);
param += addQueryParameter(param, "firstResult", firstResult, true);
param += addQueryParameter(param, "maxResults", maxResults, true);

url += param;

Expand Down Expand Up @@ -366,16 +366,16 @@ public Collection<Authorization> findAuthorization(Optional<String> id, Optional
String url = camundaUrl + "/engine-rest/authorization";

String param = "";
param += addQueryParameter(param, "id", id);
param += addQueryParameter(param, "type", type);
param += addQueryParameter(param, "userIdIn", userIdIn);
param += addQueryParameter(param, "groupIdIn", groupIdIn);
param += addQueryParameter(param, "resourceType", resourceType);
param += addQueryParameter(param, "resourceId", resourceId);
param += addQueryParameter(param, "sortBy", sortBy);
param += addQueryParameter(param, "sortOrder", sortOrder);
param += addQueryParameter(param, "firstResult", firstResult);
param += addQueryParameter(param, "maxResults", maxResults);
param += addQueryParameter(param, "id", id, true);
param += addQueryParameter(param, "type", type, true);
param += addQueryParameter(param, "userIdIn", userIdIn, true);
param += addQueryParameter(param, "groupIdIn", groupIdIn, true);
param += addQueryParameter(param, "resourceType", resourceType, true);
param += addQueryParameter(param, "resourceId", resourceId, true);
param += addQueryParameter(param, "sortBy", sortBy, true);
param += addQueryParameter(param, "sortOrder", sortOrder, true);
param += addQueryParameter(param, "firstResult", firstResult, true);
param += addQueryParameter(param, "maxResults", maxResults, true);

url += param;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public Collection<EventSubscription> getEventSubscriptions(Optional<String> proc
Optional<String> eventType, Optional<String> eventName, CIBUser user) {
String url = camundaUrl + "/engine-rest/event-subscription";
String param = "";
param += addQueryParameter(param, "processInstanceId", processInstanceId);
param += addQueryParameter(param, "eventType", eventType);
param += addQueryParameter(param, "eventName", eventName);
param += addQueryParameter(param, "processInstanceId", processInstanceId, true);
param += addQueryParameter(param, "eventType", eventType, true);
param += addQueryParameter(param, "eventName", eventName, true);
url += param;
return Arrays.asList(((ResponseEntity<EventSubscription[]>) doGet(url, EventSubscription[].class, user, false)).getBody());
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/process/BpmnViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ export default {
var shape = elementRegistry.get(item.id)
if (shape) {
var htmlTemplate = this.getBadgeOverlayHtml(item.instances, 'bg-info')
this.setHtmlOnDiagram(overlays, item.id, htmlTemplate, { bottom: 15, left: -7 })
if (item.failedJobs > 0) {
htmlTemplate += '<span class="badge bg-danger rounded-pill text-white border border-dark px-2 py-1">'
htmlTemplate += item.failedJobs + '</span>'
var htmlTemplate = this.getBadgeOverlayHtml(item.failedJobs, 'bg-danger')
this.setHtmlOnDiagram(overlays, item.id, htmlTemplate, { top: -7, right: 15 })
}
this.setHtmlOnDiagram(overlays, item.id, htmlTemplate, { bottom: 15, left: -7 })
shape.nInstances = item.instances
}
})
Expand Down
19 changes: 13 additions & 6 deletions frontend/src/components/process/Process.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
</div>
</div>
</div>
<div v-else-if="activeTab === 'incidents'" ref="rContent" class="overflow-auto bg-white position-absolute w-100" style="top: 60px; left: 0; bottom: 0">
<IncidentsTable v-if="!loading" :incidents="incidents" :activity-instance="activityInstance" :activity-instance-history="process.activitiesHistory" :get-failing-activity="getFailingActivity"></IncidentsTable>
</div>
<!--
<div v-if="activeTab === 'statistics'">
<div ref="rContent" class="overflow-auto container-fluid bg-white position-absolute" style="top: 60px; left: 0; bottom: 0" @scroll="handleScrollProcesses">
Expand Down Expand Up @@ -95,6 +98,7 @@ import { ProcessService } from '@/services.js'
import { permissionsMixin } from '@/permissions.js'
import BpmnViewer from '@/components/process/BpmnViewer.vue'
import InstancesTable from '@/components/process/InstancesTable.vue'
import IncidentsTable from '@/components/process/tables/IncidentsTable.vue'
import MultisortModal from '@/components/process/MultisortModal.vue'
// import FlowTable from '@/components/common-components/FlowTable.vue'
import resizerMixin from '@/components/process/mixins/resizerMixin.js'
Expand All @@ -108,10 +112,10 @@ export default {
name: 'Process',
components: { InstancesTable, BpmnViewer, MultisortModal,
//FlowTable,
SuccessAlert, ConfirmDialog, BWaitingBox },
SuccessAlert, ConfirmDialog, BWaitingBox, IncidentsTable },
inject: ['loadProcesses'],
mixins: [permissionsMixin, resizerMixin, copyToClipboardMixin],
props: { instances: Array, process: Object, firstResult: Number, maxResults: Number,
props: { instances: Array, process: Object, firstResult: Number, maxResults: Number, incidents: Array,
activityInstance: Object, activityInstanceHistory: Array, activityId: String, loading: Boolean,
processKey: String,
versionIndex: { type: String, default: '' }
Expand All @@ -123,6 +127,7 @@ export default {
topBarHeight: 0,
tabs: [
{ id: 'instances', active: true },
{ id: 'incidents', active: false }
],
activeTab: 'instances',
events: {},
Expand All @@ -137,9 +142,6 @@ export default {
ProcessService.fetchDiagram(this.process.id).then(response => {
this.$refs.diagram.showDiagram(response.bpmn20Xml, null, null)
})
},
activeTab: function() {

}
},
mounted: function() {
Expand Down Expand Up @@ -235,7 +237,12 @@ export default {
this.$emit('show-more')
}
},
onInput: debounce(800, function(evt) { this.$emit('filter-instances', evt) })
onInput: debounce(800, function(evt) { this.$emit('filter-instances', evt) }),
getFailingActivity: function(activityId) {
let element = this.$refs.diagram.viewer.get('elementRegistry').get(activityId)
if (element) return element.businessObject.name
return ''
}
}
}
</script>
11 changes: 8 additions & 3 deletions frontend/src/components/process/ProcessDefinitionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
:activity-instance="activityInstance"
:first-result="firstResult"
:max-results="maxResults"
@show-more="showMore()"
:activity-instance-history="activityInstanceHistory"
:incidents="incidents"
@show-more="showMore()"
@activity-id="filterByActivityId($event)"
@instance-deleted="clearInstance()"
@instance-selected="setSelectedInstance($event)"
Expand All @@ -50,7 +51,7 @@
<script>
import { nextTick } from 'vue'
import moment from 'moment'
import { TaskService, ProcessService, HistoryService } from '@/services.js'
import { TaskService, ProcessService, HistoryService, IncidentService } from '@/services.js'
import Process from '@/components/process/Process.vue'
import ProcessDetailsSidebar from '@/components/process/ProcessDetailsSidebar.vue'
import ProcessVariablesTable from '@/components/process/ProcessVariablesTable.vue'
Expand Down Expand Up @@ -197,7 +198,7 @@ export default {
v.completedInstances = '-'
})

if (selectedProcess != null) {
if (selectedProcess) {
ProcessService.findProcessById(selectedProcess.id, true).then(process => {
for (let v of this.processDefinitions) {
if (v.id === process.id) {
Expand All @@ -219,6 +220,7 @@ export default {
this.firstResult = 0
this.process = process
this.loadInstances()
this.loadIncidents()
if (!this.process.statistics) this.loadStatistics()
if (!this.process.activitiesHistory) this.loadProcessActivitiesHistory()
}
Expand Down Expand Up @@ -371,6 +373,9 @@ export default {
var csvBlob = new Blob([csvContent], { type: 'text/csv' })
var filename = 'Management_Instances_' + moment().format('YYYYMMDD_HHmm') + '.csv'
this.$refs.importPopper.triggerDownload(csvBlob, filename)
},
async loadIncidents() {
this.incidents = await IncidentService.findIncidents(this.process.id)
}
}
}
Expand Down
Loading