Skip to content

Commit adfce18

Browse files
committed
Add first example
1 parent 4ce26f0 commit adfce18

13 files changed

+66
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# webmethodsio-examples
22
Collection of examples for beginner Webmethods-io developers. It consists of common use cases and starting points for developers getting up to speed with Webmethods.io. Each example will contain instructions on how to recreate itself from a blank project.
33

4+
## Introduction
5+
6+
1. [Hello Email](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email)
47
______________________
58
These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.
69

104 KB
Loading

hello-email/emailtosubject.PNG

37.2 KB
Loading

hello-email/optionalemail.PNG

51.8 KB
Loading

hello-email/postman.PNG

21.7 KB
Loading

hello-email/readme.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Hello Email
2+
3+
This examples guides you on a simple webmethods hello world that uses no external SaaS services, but does assume you have access to an email client. The guide shows how to setup an rest api endpoint in webmethodsio (webhook) and output an email when the api is accessed, which can be easily accomplished with a simple GET request from Curl or Postman.
4+
5+
## Setup
6+
7+
1. Go ahead and get started creating a blank workflow. If you need a refresher on how to get to this point, this [guide](https://docs.webmethods.io/workflow-building-blocks/creating-first-workflow) can be a great introduction. Your starting point should resemble ![this](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/Creating_First_Workflow.png)
8+
9+
2. The Webhook is created by modifying the start icon, which is is the entrypoint to the new flow. Please select the gear on top of the start icon to access settings. Once settings is selected in the start icon, a 'trigger' dialog will appear that allows Webhook to be selected.![trigger](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/trigger.PNG)
10+
11+
3. Leave Webhook Authentication and Webhook Payload unchecked for now and hit next. Feel free to modify these if desired, they are easy to return to and iterate as well. At the very least, Authentication should be added immedately after 'Hello world' is working. Note the webhook url and save this for later. ![webhook](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/webhook.jpg)
12+
13+
(Optional) You can curl the webhook url at this point as a type of preliminary test. The url will state that it exists but will return an error message as the entire flow has not been completed and saved yet.
14+
15+
```bash
16+
curl https://<cloudname>.int-aws-us.webmethods.io/runflow/run/xxxxxxx
17+
```
18+
which will return this if the url is correct.
19+
20+
```
21+
{"error":"Parameters missing. Please provide all required parameters in actions before running workflow","code":126}
22+
```
23+
24+
And if the url is incorrect, you will receive:
25+
26+
```
27+
{"message":"Workflow not found.","code":103}
28+
```
29+
30+
4. Select done once presented with the final dialog. You should now see the start arrow dialog replaced with a webhook icon. ![webhookconfigured](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/webhookconfigured.PNG)
31+
32+
5. Now lets have the flow do something once the webhook receives a request. Search in the search dialog for 'email' and find the 'Send an Email' notification. ![sendemailrightdialog](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/sendemailrightdialog.PNG)
33+
34+
6. Select the 'Send an Email' and drag it between the start and end icons. Connect the arrows from start to the email icon and then to the end icon. This inserts the 'Send an Email' step in the flow. (optional) If you are obsessive compulsive like me, spend an extra five minutes making sure the arrow lines between start, email and end are completely straight. ![straightemail](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/straightemail.PNG)
35+
36+
7. Next, select the gear icon at the top of the email icon. You should land in a dialog that enables you to name the email step. Change the name if you like (or leave it the same) and select Next. ![sendemail](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/sendemail.PNG)
37+
38+
8. Initially, you can fill in the 'To', 'Subject' and 'Body' required fills with any text you like. ![emailtosubject](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/emailtosubject.PNG)
39+
(Optional) Fill the subject and body with information from the webhook to create a more interesting demo email. ![optionalemail](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/optionalemail.PNG)
40+
41+
9. Select next and then you will be provided with a dialog that allows an overview of the email payload and the capability to test the connect. Go ahead and hit test, wait a minute and see if the email arrives in your inbox. If everything is satisfactory go ahead and select 'Done'. ![testinitialemail](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/testinitialemail.PNG)
42+
43+
10. Assuming the steps so far are satisfactory, go ahead and select 'Test' in the top right to trigger a test of the entire workflow. This should deliver a dummy email to you inbox. Once this happens go ahead and press 'Save' to save and enable the workflow. ![testemail](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/testemail.PNG)
44+
45+
11. Test workflow
46+
47+
### Curl command example
48+
49+
```
50+
curl https://<cloudname>.int-aws-us.webmethods.io/runflow/run/xxxxxxx
51+
```
52+
53+
If all goes well, you will see something similiar
54+
55+
```
56+
{"message":"Workflow enqueued successfully.","code":123,"bill_uid":"123123123123123","flow_uid":"1231231234","tenant_uid":"123123123"}
57+
```
58+
59+
### Postman example
60+
61+
Just put your url into the 'Get' dialog box and hit send. If all goes well you will see a 'Workflow enqueud successfully' response and receive an email shortly after.
62+
63+
![postman](https://github.com/SoftwareAG/webmethodsio-examples/blob/master/hello-email/postman.PNG)

hello-email/sendemail.PNG

13.8 KB
Loading

hello-email/sendemailrightdialog.PNG

11 KB
Loading

hello-email/straightemail.PNG

15.9 KB
Loading

hello-email/testemail.PNG

32 KB
Loading

hello-email/testinitialemail.PNG

39.4 KB
Loading

hello-email/webhook.jpg

25 KB
Loading

hello-email/webhookconfigured.PNG

20.3 KB
Loading

0 commit comments

Comments
 (0)