dev-ui.zeebe.zeebe-instances.js Maven / Gradle / Ivy
import { LitElement, html } from 'lit';
import { JsonRpc } from 'jsonrpc';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
import './components/zeebe-table.js';
export class ZeebeInstances extends LitElement {
static properties = {
_items: {state: true},
navigation: {},
};
connectedCallback() {
super.connectedCallback();
this.jsonRpc = new JsonRpc(this.context.extension);
this._fetchData();
this._observer = this.jsonRpc.notifications().onNext(response => {
this._fetchData();
if (response.result.event === 'PROCESS_INSTANCE') {
this._fetchData();
}
});
}
disconnectedCallback() {
this._observer.cancel();
super.disconnectedCallback()
}
_fetchData() {
this.jsonRpc.instances()
.then(itemResponse => {
this._items = itemResponse.result.map((item) => ({
...item,
searchTerms: `${item.id} ${item.record.value.bpmnProcessId} ${item.record.value.processDefinitionKey}`
}));
});
}
render() {
return html`
`;
}
_instanceKeyRenderer(item) {
return html`
this.navigation({ nav: "instance", id: item.id })}>${item.id}
`;
}
}
customElements.define('zeebe-instances', ZeebeInstances);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy