danielgerlag / danielgerlag/workflow-core

Clarification on Activity usage and other best practices

Open
#1,065 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
5.9k
Forks
1.3k
Avg merge
1d 1h
Merged PRs (30d)
5

Description

Hi, i'm working on an order processing workflow and there are 2 particolar things

1) if some step dedect an invalid or incoerent data while processing, it needs to "trigger" an user intervention. I would like to do this by "pausing" the step returning ExecutionResult.WaitForActivity object.

The problem is that i need to make an ui panel where user can see all open actions of those kinds. Without reading them directly from database, it seems impossible to get a list of "pending activities" to le the user pick and process one of them, they seems to be thinked to be a sort of external processing queue and they're accessible only once at time.

I can also go throught User Task route, but it seems impossible to trigger it from within a step, moreover, to obtain a list of all the tasks i will need a list of all "non completed" workflows. I can obtain this with the GetWorkflowInstances of IWorkflowRepository, but it is marked as obsolete.

2) Some actions cannot be performed by the single workflow step, they need to be executed in batch. This is because i've to interact with some external API that allows for batch processing but have low limit request rate. I'm planning to schedule an external task to perform those actions, but i will be forced to pull them once at time using the GetPendingActivity. Is there any way to get a PendingActivity list (up to x activities)

By looking at the Activity code, i think that there is also a possible bug. When GetPendingActivity gets called, the ExternalTokenExpiry is set to DateTime.MaxValue. In this way, if for some reason the activity process goes bad, it will never be taken again.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.