From 76c0ec7f58a5d3442715031277d0101661feefba Mon Sep 17 00:00:00 2001 From: Nick Gorbikoff Date: Tue, 19 Dec 2017 14:29:26 -0600 Subject: [PATCH 1/5] Adding failure vs fail & success vs pass note to 2.1 update --- ...2-trailblazer-2-1-what-you-need-to-know.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/blog/2017-12-trailblazer-2-1-what-you-need-to-know.md b/blog/2017-12-trailblazer-2-1-what-you-need-to-know.md index cb00e8c0..ea8cbace 100644 --- a/blog/2017-12-trailblazer-2-1-what-you-need-to-know.md +++ b/blog/2017-12-trailblazer-2-1-what-you-need-to-know.md @@ -71,8 +71,25 @@ rewire The coolest feature. -## 4. Extended Macro API +## 5. Extended Macro API ## 6. Application Workflows +## 7. Failure & Success vs Fail & Pass + +Steps `failure` and `success` are renamed to `fail` and `pass`. Now operation with multiple steps is a bit more streamlines visually. + class Memo::Create < Trailblazer::Operation + step :create_mode + success :send_email + failure :handle_error + end + +Becomes + + class Memo::Create < Trailblazer::Operation + step :create_mode + pass :send_email + fail :handle_error + end ## 10. New Gems + From dc264882e23f7c9fe23edf00392c927657fd52cd Mon Sep 17 00:00:00 2001 From: Nick Gorbikoff Date: Tue, 19 Dec 2017 14:32:56 -0600 Subject: [PATCH 2/5] Stupid typo --- blog/2017-12-trailblazer-2-1-what-you-need-to-know.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blog/2017-12-trailblazer-2-1-what-you-need-to-know.md b/blog/2017-12-trailblazer-2-1-what-you-need-to-know.md index 23268b16..9bdb098d 100644 --- a/blog/2017-12-trailblazer-2-1-what-you-need-to-know.md +++ b/blog/2017-12-trailblazer-2-1-what-you-need-to-know.md @@ -23,7 +23,7 @@ Your steps use the existing API, and everything here is as it used to be before. class Memo::Create < Trailblazer::Operation step :create_model - + def create_model(options, params:, **) # .. end @@ -88,7 +88,7 @@ The coolest feature. ## 7. Failure & Success vs Fail & Pass -Steps `failure` and `success` are renamed to `fail` and `pass`. Now operation with multiple steps is a bit more streamlines visually. +Steps `failure` and `success` are renamed to `fail` and `pass`. Now operation with multiple steps is a bit more streamlined visually. class Memo::Create < Trailblazer::Operation step :create_mode success :send_email From 011c3f0cb8fcfb9cbc5cad7e5f7bc72c10b33e2e Mon Sep 17 00:00:00 2001 From: Nick Sutterer Date: Tue, 19 Dec 2017 22:10:41 +0100 Subject: [PATCH 3/5] add api.html. --- .../2.1/flow.md => 2.1/trailblazer/api.md | 14 +++++++++- _includes/sidebar-2-1.html | 27 ++++++++++--------- 2 files changed, 27 insertions(+), 14 deletions(-) rename gems/operation/2.1/flow.md => 2.1/trailblazer/api.md (64%) diff --git a/gems/operation/2.1/flow.md b/2.1/trailblazer/api.md similarity index 64% rename from gems/operation/2.1/flow.md rename to 2.1/trailblazer/api.md index e446cefb..e5f12bf2 100644 --- a/gems/operation/2.1/flow.md +++ b/2.1/trailblazer/api.md @@ -1,11 +1,23 @@ --- layout: operation-2-1 -title: Trailblazer 2.1 API +title: Operation 2.1 API gems: - ["trailblazer-operation", "trailblazer/trailblazer-operation", "2.1"] code: ../trailblazer/test/docs,trace_test.rb,master --- +## Overview + +An operation or an activity provides two APIs: The wiring API focuses on defining the tasks and their connections. It is so versatile that it [deserves its own document](wiring.html). The other part is about actually _implementing_ those tasks (or "boxes") and is called the _operation API_, and this document describes it. + +## Control Flow + +As already discussed briefly, designing connections and tasks happens through the [wiring API](wiring.html). The goal of the separation is that tasks can focus on one thing: implementing the actual business logic without having to worry about the control flow. To do so, they simply emit (or `return`) special objects called _signals_, which are then translated into a connection. After this, the circuit engine will move on to the next task that is targeted by the connection. + +## Task API + +## Step API + ## Result ### Primary Binary State diff --git a/_includes/sidebar-2-1.html b/_includes/sidebar-2-1.html index 8949041d..51f1e416 100644 --- a/_includes/sidebar-2-1.html +++ b/_includes/sidebar-2-1.html @@ -1,14 +1,14 @@