Skip to content

Commit a3249dc

Browse files
author
nianiB9
committed
combine embed example into trigger workflow
1 parent 0df921f commit a3249dc

File tree

4 files changed

+25
-43
lines changed

4 files changed

+25
-43
lines changed

examples/Maestro/eg001TriggerWorkflow.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ if [ -z "$workflow_created" ]; then
1919
exit 0
2020
fi
2121

22+
#Check that the instance URL exists
23+
instance_url=$(cat config/INSTANCE_URL)
24+
if [ -z "$instance_url" ]; then
25+
echo "No instance URL found. Please run the trigger workflow script first."
26+
exit 1
27+
fi
28+
2229
# Step 1: Obtain your OAuth token
2330
# Note: Substitute these values with your own
2431
ACCESS_TOKEN=$(cat config/ds_access_token.txt)
@@ -167,6 +174,24 @@ echo ""
167174
echo "Use this URL to complete the workflow steps:"
168175
echo $decoded_instance_url
169176

177+
sleep 5
178+
179+
#ds-snippet-start:Maestro1Step6
180+
# [Optional] Launch local server and embed workflow instance using the instance URL
181+
decoded_instance_url=$(echo "$instance_url" | sed 's/\\u0026/\&/g')
182+
183+
184+
host_url="http://localhost:8080"
185+
if which xdg-open &> /dev/null ; then
186+
xdg-open $host_url
187+
elif which open &> /dev/null ; then
188+
open $host_url
189+
elif which start &> /dev/null ; then
190+
start $host_url
191+
fi
192+
php ./examples/Maestro/lib/startServerForEmbeddedWorkflow.php "$decoded_instance_url"
193+
#ds-snippet-end:Maestro1Step6
194+
170195
# Remove the temporary files
171196
rm "$request_data"
172197
rm "$response"

examples/Maestro/eg002EmbedWorkflow.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

examples/Maestro/lib/startServerForEmbeddedWorkflow.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@
3434
</style>
3535
</head>
3636
<body>
37-
#ds-snippet-start:Maestro2Step3
3837
<div>
3938
<iframe src=$triggerUrl width=800 height=600>
4039
</iframe>
4140
</div>
42-
#ds-snippet-end:Maestro2Step3
4341
</body>
4442
</html>
4543

launcher.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -968,21 +968,15 @@ function startMaestro() {
968968
PS3='Select the action : '
969969
select CHOICE in \
970970
"Trigger_Workflow" \
971-
"Embed_Workflow" \
972971
"Home"; do
973972
case "$CHOICE" in
974-
975973
Home)
976974
choices
977975
;;
978976
Trigger_Workflow)
979977
bash examples/Maestro/eg001TriggerWorkflow.sh
980978
startMaestro
981979
;;
982-
Embed_Workflow)
983-
bash examples/Maestro/eg002EmbedWorkflow.sh
984-
startMaestro
985-
;;
986980
*)
987981
echo "Default action..."
988982
startMaestro

0 commit comments

Comments
 (0)