Skip to content
Snippets Groups Projects
Commit d572b9c6 authored by Jakob Junck's avatar Jakob Junck
Browse files

Selecting OCELs seems to work. Trying to do so with one of permitted types...

Selecting OCELs seems to work. Trying to do so with one of permitted types results in an server sided error: Http failure response for http://127.0.0.1:40000/importing/loadEventLogFromFile: 500 Internal Server Error
list index out of range
parent c8013d12
No related branches found
No related tags found
No related merge requests found
<log>
<event-types>
<event-type name="create-order">
<attributes>
<attribute name="total-items" type="integer"/>
</attributes>
</event-type>
</event-types>
<object-types>
<object-type name="order">
<attributes>
<attribute name="item" type="integer"/>
</attributes>
</object-type>
</object-types>
<events>
<event id="e1" type="create-order" time="2023-10-16T15:30:00Z">
<attributes>
<attribute name="total-items">1</attribute>
</attributes>
<objects>
<relationship object-id="o1" relationship="order"/>
</objects>
</event>
</events>
<objects>
<object id="o1" type="order">
<attributes>
<attribute name="item" time="1970-01-01T00:00:00Z">1</attribute>
</attributes>
</object>
</objects>
</log>
\ No newline at end of file
...@@ -221,8 +221,8 @@ ...@@ -221,8 +221,8 @@
#fileUploadOCEL #fileUploadOCEL
type="file" type="file"
class="d-none" class="d-none"
(change)="handleSelectedEventLogFile($event, false)" (change)="handleSelectedOCELFile($event, false)"
accept=".xes" accept=".xml, .xmlocel, .json, .jsonocel, .sqlite, .sqlite3"
/> />
<input <input
......
...@@ -30,6 +30,7 @@ export class HeaderBarComponent implements OnDestroy { ...@@ -30,6 +30,7 @@ export class HeaderBarComponent implements OnDestroy {
@ViewChild('fileUploadProcessTree') fileUploadProcessTree: ElementRef; @ViewChild('fileUploadProcessTree') fileUploadProcessTree: ElementRef;
@ViewChild('fileUploadProject') fileUploadProject: ElementRef; @ViewChild('fileUploadProject') fileUploadProject: ElementRef;
@ViewChild('fileUploadEventLogRetry') fileUploadEventLogRetry: ElementRef; @ViewChild('fileUploadEventLogRetry') fileUploadEventLogRetry: ElementRef;
@ViewChild('fileUploadOCELRetry') fileUploadOCELRetry: ElementRef;
@ViewChild('eventLogSelectionRetryModal') @ViewChild('eventLogSelectionRetryModal')
eventLogSelectionRetryModal: ElementRef; eventLogSelectionRetryModal: ElementRef;
...@@ -80,6 +81,32 @@ export class HeaderBarComponent implements OnDestroy { ...@@ -80,6 +81,32 @@ export class HeaderBarComponent implements OnDestroy {
this.fileUploadOCEL.nativeElement.click(); this.fileUploadOCEL.nativeElement.click();
} }
handleSelectedOCELFile(e, isRetry = false): void {
console.log("Debug: We are importing an OCEL file.")
const fileList: FileList = e.target.files;
if (fileList.length > 0) {
console.log("Debug: fileList.length > 0. Sending", fileList[0], fileList[0]["path"])
let backendCall;
if (!environment.electron) {
console.log('Debug: Electron is not the detected environment, using uploadEventLog.');
backendCall = this.backendService.uploadEventLog(fileList[0]);
} else {
console.log('Debug: Electron environment detected, using loadEventLogFromFilePath.');
backendCall = this.backendService.loadEventLogFromFilePath(fileList[0]['path']);
}
this.loadingOverlayService.showLoader(
'Importing OCEL. For large logs this can take up to several minutes'
);
backendCall.subscribe(() => {
this.loadingOverlayService.hideLoader();
});
}
// reset form
if (isRetry) this.fileUploadEventLogRetry.nativeElement.value = '';
else this.fileUploadEventLog.nativeElement.value = '';
}
handleSelectedEventLogFile(e, isRetry = false): void { handleSelectedEventLogFile(e, isRetry = false): void {
const fileList: FileList = e.target.files; const fileList: FileList = e.target.files;
if (fileList.length > 0) { if (fileList.length > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment