-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Workflow module enhancement #16043
base: main
Are you sure you want to change the base?
Workflow module enhancement #16043
Conversation
I've already linked it in the first line of the PR description.😳 |
Not in a way explained in the docs :). You need to use something like |
oh, I see , thanks! |
With these changes underway in workflows would it be a good time to upgrade the diagramming ui (js plumb) to a modern ui library ?. Eg panning and zooming would be useful. |
Could you please create a separate issue about that, with specific suggestions? |
Yes currently it does get stuck here at UI editing, as currently every update to a workflow node triggers the saving of the entire process definition, i.e. every time a node is edited it generates a version, which makes no sense! Prepare to refer to elsa-core for design ideas |
No problem. I created an issue here #16107 |
I would suggest to create more focused PRs so we can approve them individually in case one would block the others. |
The reason why we focus on one PR is that if we want to disassemble it, we will need a lot of table structure migration. |
@hyzx86 do you plan to have this ready for review soon ? otherwise i would like to add a new pr for the workflow type display name and description. |
Sorry, I'm busy with other projects and don't have time to sort out this PR at the moment , I probably won't be continuing this PR anytime soon! Temporary closure |
This pull request has merge conflicts. Please resolve those before requesting a review. |
Some of the code is from my 1.8 implementation. My current implementation is not very good, if every time you save a node definition update it generates an audit message for the whole process, for this reason I have modified the
using OrchardCore.Entities;
using OrchardCore.Workflows.Models;
using System;
using System.Linq;
using YesSql.Indexes;
namespace OrchardCore.Workflows.Indexes
{
public class WorkflowTypeIndex : MapIndex
{
public long DocumentId { get; set; }
public string WorkflowTypeId { get; set; }
public string Name { get; set; }
public bool IsEnabled { get; set; }
public bool HasStart { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public string WorkflowTypeVersionId { get; set; }
public bool Latest { get; set; }
public DateTime CreatedUtc { get; set; }
public string CreatedBy { get; set; }
public DateTime ModifiedUtc { get; set; }
public string ModifiedBy { get; set; }
}
public class WorkflowTypeStartActivitiesIndex : MapIndex
{
public string WorkflowTypeId { get; set; }
public string WorkflowTypeVersionId { get; set; }
public string Name { get; set; }
public bool IsEnabled { get; set; }
public string StartActivityId { get; set; }
public string StartActivityName { get; set; }
}
public class WorkflowTypeIndexProvider : IndexProvider<WorkflowType>
{
public override void Describe(DescribeContext<WorkflowType> context)
{
context.For<WorkflowTypeIndex>()
.Map(workflowType =>
{
var workflowTypeAudit = workflowType.As<WorkflowTypeVersionAudit>();
var index = new WorkflowTypeIndex
{
WorkflowTypeId = workflowType.WorkflowTypeId,
Name = workflowType.Name,
IsEnabled = workflowType.IsEnabled,
HasStart = workflowType.Activities.Any(x => x.IsStart),
DisplayName = workflowTypeAudit.DisplayName,
Description = workflowTypeAudit.Description,
WorkflowTypeVersionId = workflowTypeAudit.WorkflowTypeVersionId,
Latest = workflowTypeAudit.Latest,
CreatedUtc = workflowTypeAudit.CreatedUtc,
ModifiedUtc = workflowTypeAudit.ModifiedUtc,
ModifiedBy = workflowTypeAudit.ModifiedBy,
CreatedBy = workflowTypeAudit.CreatedBy
};
return index;
}
);
context.For<WorkflowTypeStartActivitiesIndex>()
.Map(workflowType =>
{
var workflowTypeAudit = workflowType.As<WorkflowTypeVersionAudit>();
var startIndexies = workflowType.Activities.Where(x => x.IsStart).Select(x =>
new WorkflowTypeStartActivitiesIndex
{
WorkflowTypeVersionId = workflowTypeAudit.WorkflowTypeVersionId,
WorkflowTypeId = workflowType.WorkflowTypeId,
Name = workflowType.Name,
IsEnabled = workflowType.IsEnabled,
StartActivityId = x.ActivityId,
StartActivityName = x.Name
});
return startIndexies;
}
);
}
}
}
using System;
namespace OrchardCore.Workflows.Indexes
{
public class WorkflowTypeVersionAudit
{
public string WorkflowTypeVersionId { get; set; }
public bool Latest { get; set; }
public DateTime CreatedUtc { get; set; }
public string CreatedBy { get; set; }
public DateTime ModifiedUtc { get; set; }
public string ModifiedBy { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
}
} |
Thank you! |
@Piedone Have you been making any progress on this? If not maybe I'm able to help out! |
I haven't started it, so that would be great, thank you! To clarify, I only wanted Audit Trail support, i.e. #11608. Is this something you'd continue? |
I think audit trail support only makes sense when you can see what actually changed, i.e. also implement some kind of versioning. What do you think? |
Since Audit Trail can record versions, that should be more or less given. |
Fixes #15496
versionId
and audit information to workflow types.versionId
and audit information to workflow .Fixes : #14276
TitlePart
doesFixes: #12070
ExecutedOnUtc
field to workflow instances, which can be used for sortingFixes : #11608
CreatedUtc
,ModifiedUtc
,ModifiedBy
,CreatedBy