I want to pass project_Cost (input parameter) in this Elsa WorkFlow Builder APi
public void Build(IWorkflowBuilder builder , int project_Cost)
{
}
Currently, it's giving an error because Build method doesn't have a second user-defined input parameter
how to pass this parameter, is there any other method there in Elsa WokFlow to pass custom user-defined input parameter ?
So, if I invoke https://localhost:44302/ProjectStatus?project_Cost=15000
then Elsa WorkFlow activates and passes 15000 as an input parameter value
The builder API is designed to define workflow blueprints, and it doesn't make sense to pass parameters to it. For your use case you can take advantage of Http endpoints activity and there's a sample on the repo that I guess is close to what you need.
Something like the following:
public void Build(IWorkflowBuilder builder)
{
builder
// Configure a Receive HTTP Request trigger that executes on incoming HTTP GET requests.
.HttpEndpoint(activity => activity.WithPath("/ProjectStatus").WithMethod(HttpMethods.Get))
// Store the parameter as a workflow variable
.SetVariable(context => ((HttpRequestModel)(context.Input))?.QueryString["project_Cost"]))
// Then whatever you need to do with the parameter
}