Sladerix opened a new issue #5176:
URL: https://github.com/apache/openwhisk/issues/5176


   Hi everyone.. i trying to understand the right way to to thing with actions, 
trigger, rules and serverless in general.
   My idea is:
   When a triggers fires, a sequence of actions must start -> generate a random 
color, turn on a led with that color, save to a DB the record using an input 
ID, timestamp and the color generated at the first step.
   
   I need to fire the trigger using the OW API.
   
   so i did like so:
   ![IMG_0493 
3](https://user-images.githubusercontent.com/6717214/141679615-868b2365-493e-4d79-8c43-5b0a26eb41ef.jpg)
   
   the problem is that the parameters you pass to the trigger at the beginning 
is used ONLY from the first action (_generateColor_), then them are lost, same 
thing apply for the output of the actions.. the output of _generateColor_ is 
needed for _turnOnLED_ and _saveColor_, but the last will not receive the data 
because there another action in between, and also will not receive the 
parameters used to fire the trigger (needed to save the record to the DB)
   
![IMG_0493](https://user-images.githubusercontent.com/6717214/141679779-e6ccebb5-7a06-473f-818c-b9e3115e198d.jpg)
   
   Last but not least... keeping in mind that the trigger will be fired using 
the API, you should expect sometype of response.. instead you got only an 
activationid relative to the trigger. This means:
   Imagine the above sequence works. saveColor returns a value (in this case 
called "record-id"), when you fire to trigger you expect this as output, but 
instead you have to:
   
   1. Get  the activationId of the trigger
   2. Make another api request to get the activations of the single actions 
used bye the sequence
   3. Make another api request to get the result of the right action of the 
found at step 2 (so you have to do it for all, in this case are only 3, but if 
were 50?)
   
   
   At this point i think i'm doing something wrong, this is not the right way 
to design actions? how should they be done? my inderstandin of serverless is 
wrong?.. i don't know but this thing is bit confusing for me. 
   
   Thanks in advance


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to