ryanwinchester

ryanwinchester

Add_graft not adding to context

It’s looking to me like my Oban.Pro.Workflow.add_graft is not adding to context, but in the docs it does

def new_workflow do
    Workflow.new()
    |> Workflow.put_context(context)
    |> Workflow.add_graft(:foo, &graft_foo/1)
    |> Workflow.add_cascade(:bar, &bar/1, deps: [:foo])
    |> Oban.insert_all()
end

def graft_foo(_) do
    Workflow.new()
    |> Workflow.add(:foo_id, foo_worker)
    |> Workflow.apply_graft()
    |> Oban.insert_all()
end

def bar(context) do
  %{foo: _} = context

  # ...
end

foo will not be in the context…

Marked As Solved

sorentwo

sorentwo

Oban Core Team

Confirmed that this is an issue with v1.6.0 (proper). Will have a fix soon for v1.6.1. Thanks for the report, as always :slightly_smiling_face:

Also Liked

ryanwinchester

ryanwinchester

No, this one was my fault.

I didn’t realize you need to add it to deps for the context to be merged. I only had the step I was waiting on,

e.g. step 3 waits on 2 and step 2 waits on 1.
If I want context from 1 and 2 in step 3, even if I technically only need to wait on 2, I still need to add both as deps to step 3.

Last Post!

ryanwinchester

ryanwinchester

looks like the same ones missing from earlier

i’m skipping the tests for now. it works as intended manually testing the application

will dig in deeper at another time

Where Next?

Popular in Questions Top

Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49266 226
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement