Skip to content

Commit

Permalink
Add "Outcomes" topic and integrate it into navigation
Browse files Browse the repository at this point in the history
Created a new "Outcomes" topic focusing on workflow logic in Elsa and integrated it into the Concepts section. Updated related files to include links and references to the new topic for better accessibility and visibility.
  • Loading branch information
sfmskywalker committed Sep 21, 2024
1 parent 950a579 commit 2ccad9d
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 14 deletions.
1 change: 1 addition & 0 deletions writerside/elsa.tree
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<toc-element topic="Elsa-Console.topic"/>
</toc-element>
<toc-element topic="Concepts.topic">
<toc-element topic="Outcomes.topic"/>
<toc-element topic="Correlation-ID.topic"/>
</toc-element>
<toc-element topic="Guides.topic">
Expand Down
25 changes: 11 additions & 14 deletions writerside/topics/Concepts.topic
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,22 @@
<!-- Add up to 2 topics that you want to promote. Use the "type" attribute to select an icon. -->
<spotlight>
<a href="Correlation-ID.topic" type="data" summary="A Correlation ID is a flexible identifier used to associate related workflow instances or link workflows with domain entities, enabling traceability and monitoring across systems."/>
<a href="Outcomes.topic" type="cross-check"/>
</spotlight>

<!-- Add several topics that are most important for this section. -->
<!-- <primary>-->
<!-- <title>Get started</title>-->
<!-- <a href=""/>-->
<!-- <a href="" summary="With a custom card summary"/>-->
<!-- <a href="">Custom card title</a>-->
<!-- <a href="" summary="With a custom card summary">Custom card title</a>-->
<!-- </primary>-->
<primary>
<title>Primary Concepts</title>
<a href="Correlation-ID.topic"/>
<a href="Outcomes.topic"/>
</primary>

<!-- Add several topics that are less important or are relevant only for advanced/experienced users. -->
<!-- <secondary>-->
<!-- <title>Explore advanced features</title>-->
<!-- <a href=""/>-->
<!-- <a href="" summary="With a custom card summary"/>-->
<!-- <a href="">Custom card title</a>-->
<!-- <a href="" summary="With a custom card summary">Custom card title</a>-->
<!-- </secondary>-->
<secondary>
<title>Explore advanced features</title>
<a href="Correlation-ID.topic"/>
<a href="Outcomes.topic"/>
</secondary>

<!-- Optionally add additional cards and links to topics that are not in this section but may be relevant. -->
<!-- <misc>-->
Expand Down
61 changes: 61 additions & 0 deletions writerside/topics/Outcomes.topic
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="Outcomes" id="Outcomes">

<p>
In Elsa, activities are connected to form a flowchart that defines the logic of the workflow. Each activity can have multiple potential results, which are referred to as <i>outcomes</i>. These outcomes serve as "ports" that dictate the next step in the workflow based on the result of the activity. This powerful mechanism simplifies workflows by eliminating the need for separate decision activities to evaluate an activity's result.
</p>

<chapter title="What is an Outcome?" id="what-is-an-outcome">
<p>
An outcome in Elsa is a possible result of an activity's execution. Once an activity completes, the workflow can continue down different paths depending on which outcome was produced. For instance, an approval activity might have two outcomes: "Approved" and "Rejected." By connecting these outcomes directly to other activities in the workflow, users can control the flow without the need for intermediate decision activities.
</p>
</chapter>

<chapter title="How to Use an Outcome?" id="how-to-use-an-outcome">
<p>
Outcomes are exposed as "ports" or connectors from one activity to the next. When defining a workflow, you can simply connect an activity's outcome to the next relevant activity in the flowchart. This provides a visual and intuitive way of representing decision logic.
</p>
<p>
For example:
</p>
<list>
<li>A "Send Email" activity might have two outcomes: "Success" and "Failure."</li>
<li>Depending on the outcome, you could connect "Success" to a "Log Activity" and "Failure" to a "Retry" activity.</li>
</list>
</chapter>

<chapter title="Outcomes in Nested Workflows" id="outcomes-in-nested-workflows">
<p>
Workflows can be used as activities within other workflows, and they too can define their own outcomes. When creating a workflow that you plan to use as a nested activity inside another workflow, you can define its outcomes to represent different execution paths. This allows parent workflows to continue based on the outcome of the nested workflow, offering modularity and flexibility in complex scenarios.
</p>
</chapter>

<chapter title="Difference Between an Outcome and an Output" id="difference-between-outcome-and-output">
<p>
While both <i>outcomes</i> and <i>outputs</i> represent information produced by an activity, they serve different purposes:
</p>
<list>
<li><b>Outputs</b>: These are data or results generated by an activity that can be used later in the workflow. Outputs allow activities to pass values (such as a number, string, or object) to subsequent activities for processing or storage.</li>
<li><b>Outcomes</b>: These define the flow of the workflow itself, determining which path to follow based on how the activity completes. Instead of providing data, outcomes shape the control flow by specifying which activity should run next.</li>
</list>
<p>
For instance, a "Form Submission" activity might have an <i>output</i> containing form data (e.g., the values entered by the user), while its <i>outcome</i> might determine whether to send a confirmation email or display an error message depending on whether the form validation was successful or not.
</p>
</chapter>

<chapter title="Benefits of Using Outcomes" id="benefits-of-using-outcomes">
<list>
<li><b>Simplification of Flow Logic</b>: By using outcomes, workflows become more streamlined since there is no need for decision nodes to handle activity results.</li>
<li><b>Visual Clarity</b>: The flowchart clearly shows which path follows from each possible outcome, making it easier to understand at a glance.</li>
<li><b>Modularity</b>: Workflows and activities can be reused more easily when outcomes are well-defined, enabling a flexible and scalable workflow design.</li>
</list>
</chapter>

<p>
In summary, outcomes in Elsa Workflows provide a simple and effective way to direct the flow of your workflows based on how activities conclude. By distinguishing between outcomes and outputs, users can manage both the logical flow and the data flow in their workflows with clarity and ease.
</p>
</topic>

0 comments on commit 2ccad9d

Please sign in to comment.