Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API: Sending data to input port of plugin not working #230

Open
deinhofer opened this issue Mar 7, 2018 · 1 comment
Open

REST API: Sending data to input port of plugin not working #230

deinhofer opened this issue Mar 7, 2018 · 1 comment
Labels
bug hint Document behaviour, workarounds, hints Priority 2 The issue is important but not mandatory

Comments

@deinhofer
Copy link
Contributor

When sending data to an input port of a plugin, sending does not work if the input port is not connected from another output port.

How to reproduce

  1. Create a model with a WebSocket plugin (id: WebSocket.1) and deploy it to the ARE.
  2. Send data to the InA input port of the plugin via the Javascript REST function sendDataToInputPort (see picture below)
    grafik
  3. You will get an error message:
Couldnt set port <InA> of component <WebSocket.1> to value <Test> (Exception: eu.asterics.mw.are.exceptions.AREAsapiException: send data failed! model: eu.asterics.mw.model.deployment.impl.DefaultRuntimeModel@111783d, instance: instanceID WebSocket.1, 
componentType asterics.WebSocket, 
description This plugin uses a websocket connection to send and read data. The default websocket URI is ws://{hostname}:8082/ws/astericsData. You have to start the ARE with --webservice flag. You can test the connection with http://localhost:8082/
        , 
inputPorts [DefaultPort(InA, string)], 
outputPorts[DefaultPort(OutA, string)], 
, inputPort: null)

Workaround
If you connect a channel from another output port to the InA input port, the sending from the REST API also works. For the WebSocket plugin you can connect the OutA port to the InA port. (see pic below)

grafik

@deinhofer deinhofer added bug Priority 2 The issue is important but not mandatory labels Mar 7, 2018
@klues
Copy link
Contributor

klues commented Mar 8, 2018

yeah, i know this issue. At implementing the REST method I did not find a way to send something to an input port that is not connected (i.e. that no "data channel" exists"). But yes, if there is a possibility we should change it.

@deinhofer deinhofer added the hint Document behaviour, workarounds, hints label Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug hint Document behaviour, workarounds, hints Priority 2 The issue is important but not mandatory
Projects
None yet
Development

No branches or pull requests

2 participants