Sirus Web Creating elements programmatically [message #1843510] |
Tue, 03 August 2021 05:34  |
Eclipse User |
|
|
|
Hello,
I want to create elements in the Sirius Web environment via code while the Sirius Web Server is running.
I already found that you can save an xml file and change the configuration files to show a custom model but this files are only updated after the server is restarted.
Is there a way to push a new model to the sirius web environment where a refresh of the browser is enough to show the changes?
|
|
|
|
|
Re: Sirus Web Creating elements programmatically [message #1843579 is a reply to message #1843526] |
Mon, 09 August 2021 07:51   |
Eclipse User |
|
|
|
Hello,
I struggle with the query for the document upload (I have not used GraphQL before). I try to upload a file through the GraphiQL interface, but I get an error which I cannot resolve. Later I want to perform this query through java code.
The query looks like this right now
mutation uploadDocument($input: UploadDocumentInput!){ uploadDocument(input: $input) {
__typename
... on ErrorPayload {message}}}
Query Variables
{ "input": {
"id": "8016b11c-f8f6-11eb-9a03-0242ac130003",
"file": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><eed:AHPCC xmi:version=\"2.0\" xmlns:xmi=\"http://www.omg.org/XMI\" xmlns:eed=\"http://www.example.org/eed\"><application name=\"app1\"/></eed:AHPCC>",
"editingContextId": "f633f3db-65f3-4299-a989-938a47209045"
}
}
But I get the following error:
{
"errors": [
{
"message": "Exception while fetching data (/uploadDocument) : null",
"locations": [
{
"line": 14,
"column": 56
}
],
"path": [
"uploadDocument"
],
"extensions": {
"classification": "DataFetchingException"
}
}
],
"data": null
}
What is not correct in my query?
Also, I have not found a way to extract the current representation with the api as XMI. Is there no function for that? Is there another way I can do that?
[Updated on: Mon, 09 August 2021 08:32] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04232 seconds