Information about API Answers
Information about API Answers
Answer at initialization time
uDraw(Graph) can be connected to an application program
using several options, refer to page
How to connect an Application
After connecting uDraw(Graph) to the application, an initial answer
is sent to the application to signal preparedness for receiving
An application must not start sending commands to uDraw(Graph) before
receiving the initial "ok" as the first answer from the API.
Answers to confirm API commands
sent to the API are confirmed by sending the answer
back to the application after successfully executing the command.
All commands that do not return "ok" are listed below.
If an error occurred while executing the command, uDraw(Graph) will
send the answer
instead of "ok".
Usually, this exception should not happen when the application
meets all rules and restrictions of the API.
The application can find the reason for the error in the string
parameter of answer "communication_error(...)".
These are the API commands that do not return the "ok" answer:
the following commands answer
Answers to notify events
answers used to confirm a command
sent to the API, some answers may occur at any time.
These are notifications for events that are triggered by the user.
A uDraw(Graph) application must be prepared to receive these
answers at any time, even in the time interval between sending
a command and receiving the corresponding confirmation answer.
The API sends the following events:
Due to the strange effects of asynchronous communication caused by
message delays, an event must also be expected by the application
after sending a command to the API and before receiving the
corresponding confirmation answer!
uDraw(Graph) guarantees that event answers are not propagated during
execution of an API command, but if the event occurs during transfer
time of the command (i.e. after it has been sent by the application and
before it has been received by the API), then the event answer may
interfere and will arrive at the application side in the time
interval after sending the command and before receiving the
corresponding confirmation answer.
So never expect that the confirmation answer will come back directly
after sending an API command.
Your application must accept event answers at any time!
Answers in Multi-Graph Mode
When uDraw(Graph) has left the default single-graph mode to enter
the behavior for confirming commands and sending event
notifications will slightly change.
In multi-graph mode, all answers from uDraw(Graph) will always
have a preluding answer
to specify the context (graph) where the following answer happened.
So in multi-graph mode, an application will
always get two answers
instead of one:
The first one is the context and the second one is the event
or confirmation answer.
Answers in Multi-Window Mode
mode where the user (or the application) has opened additional
views (base windows) to the graph, the application is unable to
access each individual view.
To solve this restriction, you can use the
by using command-line option
Here, the behavior of
sending two answers
with each confirmation or event is the same, but instead
the preluding answer
is used where the application can find an additional window ID.
Further, the commands
return the confirmation answer
instead of the usual
that is sent by these commands when the multi-window mode is not active.