Skip to content
Snippets Groups Projects
Commit aadf595d authored by abir.chebbi's avatar abir.chebbi
Browse files
parents d72fdb9e 4867e0b8
No related branches found
No related tags found
No related merge requests found
...@@ -64,27 +64,21 @@ The following image represent the application workflow. Each step in the flowcha ...@@ -64,27 +64,21 @@ The following image represent the application workflow. Each step in the flowcha
* Click on Create state machine to start the process of creating your workflow template. * Click on Create state machine to start the process of creating your workflow template.
* Choose **Blank** to create a workflow from scratch. * Choose **Blank** to create a workflow from scratch.
Inside the workflow studio, navigate to the left-hand panel and select **Flow** control. Inside the workflow studio, navigate to the left-hand panel and select **Flow** control.
* Choose **Map**, which allows for parallel processing. To read the images from S3 bucket and compute the NDVI mean. Configure the 'Map' state: Choose **Map**, which allows for parallel processing. Note that based on your workflow, you might not need to use Map if there's no parallel processing required.
* Assign a suitable name #### Step 5: Configure a state to compute NDVI mean
* Select the processing mode as 'Distributed,' facilitating the creation of separate child workflows for each image. Drag and drop AWS Lambda from the Actions panel to add a task to invoke your Lambda function.
* Choose the item source as 'Amazon S3,' then select 'S3 object list' as the S3 item source. Navigate to the S3 bucket 'ndvi-satellite-images,' where the NDVI images are stored. Configure the task with the name of the Lambda function that computes the mean. Set the Payload option to use the state's input as the payload for the Lambda function.
* Navigate to the output panel and select 'Add original input to output using ResultPath'. #### Step 6: Add Choice Flow
Drag and drop the Choice state onto your workflow to create a branching logic.
* Drag and drop AWS Lambda from the Actions panel to add a task to compute the mean of NDVI. Configure: Configure the Choice state by adding rules:
* Assign a name to the state. * Click Add new rule.
* Within the 'API Parameters' section, select 'Enter function name' to trigger the previously created lambda function responsible for computing the mean. Input the ARN (Amazon Resource Name) of the function accordingly. * Set a condition by choosing the variable $.type.
* For the operator, select is exactly and set the value to a String constant of "CSV" for the first condition.
* Drag and drop the 'Choice' state from the Flow panel. * Repeat the process for the second rule and set the value to "PNG".
* Configure the Choice state by adding rules: #### Step 7: Configure Lambda Tasks for the Condition
* Set Rule #1. Under each condition you've set in the Choice state, you will add the respective Lambda tasks:
* Define a condition based on the variable $.type. For CSV, drag another Lambda function onto the workflow and configure it to invoke the function that processes the data and outputs it to a CSV file.
* Select 'is equal to' as the operator and set the value to a String constant of "CSV". For PNG, do the same for the Lambda function that processes the data and outputs it to a PNG file.
#### Step 8: Save and Test
* Within the 'CSV' condition set in the Choice state, include the Lambda function which generates output data in CSV format. Once all the states are configured correctly, Save the state machine.
* Additionally, under the 'default' condition, include the Lambda function which generates output data in PNG format. Test your state machine by starting an execution and monitoring the results to ensure that it behaves as expected.
* Once all the states are configured correctly, Create the state machine.
* Test your state machine by starting an execution and monitoring the results to ensure that it behaves as expected.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment