Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ParentResult API #25

Open
gurmitteotia opened this issue Oct 26, 2018 · 0 comments
Open

Support ParentResult API #25

gurmitteotia opened this issue Oct 26, 2018 · 0 comments

Comments

@gurmitteotia
Copy link
Owner

It will be be useful if user can write following sytax

[WorkflowDescription("1.0")]
public class OrderWorkflow : Workflow
{
  public OrderWorkflow()
  {
    ScheduleLambda("ReserveOrder");
    ScheduleLambda("ChargeCustomer").AfterLambda("ReserveOrder")
       .WithInput(e=>new {Cost = e.ParentResult().OrderValue});
  }
}

At the moment user has to do

[WorkflowDescription("1.0")]
public class OrderWorkflow : Workflow
{
  public OrderWorkflow()
  {
    ScheduleLambda("ReserveOrder");
    ScheduleLambda("ChargeCustomer").AfterLambda("ReserveOrder")
       .WithInput(e=>new {Cost = e.ParentLambda().Result().OrderValue});
  }
}

Implementation Note:

  • ParentResult() will throw exception if there are more than one eligible parents
  • ParentResult() will throw exception when there are no parents
  • ParentResult() will throw exception and the parent has successfully completed.

Eligible parents are- activity, lambda function and child workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Guflow
  
To Do
Development

No branches or pull requests

1 participant