Replies: 12 comments
-
The problem with workflow task designer is that it's not very clear what is produced on each step. Outcomes has visual indication but there's no way to figure out what inside For example, what will be the output of |
Beta Was this translation helpful? Give feedback.
-
This seems important in figuring out the output/properties set by |
Beta Was this translation helpful? Give feedback.
-
So it should be available via |
Beta Was this translation helpful? Give feedback.
-
I'm curently working on this, if your activity is directly after a content event e.g. As i remember e.g. through a javascript expression |
Beta Was this translation helpful? Give feedback.
-
I wish there's a Content shape viewer. Working with content with the workflow is quite cumbersome because you need to figure out the JSON structure. It's a trial and error process. |
Beta Was this translation helpful? Give feedback.
-
The workflow is missing the ability to perform query. I will try to implement this. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Content Query Task This is a activity task that allows you to perform query, pass parameters and set the result into specific This is the source code public class ContentQueryTask : TaskActivity
{
protected readonly IStringLocalizer S;
private readonly IWorkflowExpressionEvaluator _expressionEvaluator;
private readonly OrchardCore.IOrchardHelper _helper;
public ContentQueryTask(
IStringLocalizer<ContentQueryTask> localizer,
IWorkflowExpressionEvaluator expressionEvaluator,
OrchardCore.IOrchardHelper helper)
{
S = localizer;
_expressionEvaluator = expressionEvaluator;
_helper = helper;
}
public override string Name => nameof(ContentQueryTask);
public override LocalizedString DisplayText => S["Content Query Task"];
public override LocalizedString Category => S["Content"];
public override IEnumerable<Outcome> GetPossibleOutcomes(WorkflowExecutionContext workflowContext, ActivityContext activityContext)
{
return Outcomes(S["Done"]);
}
public override async Task<ActivityExecutionResult> ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext)
{
var queryName = string.Empty;
if (!string.IsNullOrWhiteSpace(QueryName.Expression))
queryName = await _expressionEvaluator.EvaluateAsync(QueryName, workflowContext);
var propertyName = "ContentQuery";
if (!string.IsNullOrWhiteSpace(PropertyName.Expression))
propertyName = await _expressionEvaluator.EvaluateAsync(PropertyName, workflowContext);
var paramaters = "";
if (!string.IsNullOrWhiteSpace(Parameters.Expression))
paramaters = await _expressionEvaluator.EvaluateAsync(Parameters, workflowContext);
IDictionary<string, object> @params = new Dictionary<string, object>();
if (!string.IsNullOrWhiteSpace(paramaters))
@params = JObject.Parse(paramaters).ToDictionary();
var result = await _helper.ContentQueryAsync(queryName, @params);
workflowContext.Properties[propertyName] = result;
return Outcomes("Done");
}
public WorkflowExpression<string> QueryName
{
get => GetProperty(() => new WorkflowExpression<string>(""));
set => SetProperty(value);
}
public WorkflowExpression<string> PropertyName
{
get => GetProperty(() => new WorkflowExpression<string>(""));
set => SetProperty(value);
}
public WorkflowExpression<string> Parameters
{
get => GetProperty(() => new WorkflowExpression<string>(""));
set => SetProperty(value);
}
}
public class ContentQueryViewModel
{
public string QueryNameExpression { get; set; }
public string PropertyNameExpression { get; set; }
public string ParametersExpression { get; set; }
}
public class ContentQueryTaskDisplay: ActivityDisplayDriver<ContentQueryTask, ContentQueryViewModel>
{
protected override void EditActivity(ContentQueryTask activity, ContentQueryViewModel model)
{
model.QueryNameExpression = activity.QueryName.Expression;
model.PropertyNameExpression = activity.PropertyName.Expression;
model.ParametersExpression = activity.Parameters.Expression;
}
protected override void UpdateActivity(ContentQueryViewModel model, ContentQueryTask activity)
{
activity.QueryName = new WorkflowExpression<string>(model.QueryNameExpression);
activity.PropertyName = new WorkflowExpression<string>(model.PropertyNameExpression);
activity.Parameters = new WorkflowExpression<string>(model.ParametersExpression);
}
} |
Beta Was this translation helpful? Give feedback.
-
Content Query Task part 2 You can see here how |
Beta Was this translation helpful? Give feedback.
-
See over here @dodyg #5862 it should add a |
Beta Was this translation helpful? Give feedback.
-
I want to access the highlighted field but i am unable to . I am only able to acceess CorrelationId,Input,output and properties. Can any1 please help me out with this? |
Beta Was this translation helpful? Give feedback.
-
@yash1529 you may have more answers by creating a new discussion, nobody will see this here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to do some work that requires workflow so I am going to keep notes here.
Beta Was this translation helpful? Give feedback.
All reactions