11using System . Collections . Generic ;
2+ using System . Threading ;
3+ using System . Threading . Tasks ;
24using OptimaJet . Workflow . Core . Model ;
35
46namespace OptimaJet . Workflow . Core . Runtime
@@ -18,6 +20,16 @@ public interface IWorkflowActionProvider
1820 /// <param name="actionParameter">Additional action parameter <see cref="ActionDefinitionReference.ActionParameter"/></param>
1921 void ExecuteAction ( string name , ProcessInstance processInstance , WorkflowRuntime runtime , string actionParameter ) ;
2022
23+ /// <summary>
24+ /// Execute action asynchronously
25+ /// </summary>
26+ /// <param name="name">Name of the action to execute</param>
27+ /// <param name="processInstance">Reference to ProcessInstance from which action is executed <see cref="ProcessInstance"/></param>
28+ /// <param name="runtime">Reference to WorkflowRuntime object which managed specified process instance <see cref="WorkflowRuntime"/></param>
29+ /// <param name="actionParameter">Additional action parameter <see cref="ActionDefinitionReference.ActionParameter"/></param>
30+ /// <param name="token">Cancellation token</param>
31+ Task ExecuteActionAsync ( string name , ProcessInstance processInstance , WorkflowRuntime runtime , string actionParameter , CancellationToken token ) ;
32+
2133 /// <summary>
2234 /// Check condition
2335 /// </summary>
@@ -29,6 +41,30 @@ public interface IWorkflowActionProvider
2941 bool ExecuteCondition ( string name , ProcessInstance processInstance , WorkflowRuntime runtime ,
3042 string actionParameter ) ;
3143
44+ /// <summary>
45+ /// Check condition asynchronously
46+ /// </summary>
47+ /// <param name="name">Name of the condition to check</param>
48+ /// <param name="processInstance">Reference to ProcessInstance from which condition is checked <see cref="ProcessInstance"/></param>
49+ /// <param name="runtime">Reference to WorkflowRuntime object which managed specified process instance <see cref="WorkflowRuntime"/></param>
50+ /// <param name="actionParameter">Additional action parameter <see cref="ActionDefinitionReference.ActionParameter"/></param>
51+ /// <param name="token">Cancellation token</param>
52+ /// <returns>Condition result</returns>
53+ Task < bool > ExecuteConditionAsync ( string name , ProcessInstance processInstance , WorkflowRuntime runtime , string actionParameter , CancellationToken token ) ;
54+
55+
56+ /// <summary>
57+ /// Checks whether the action should be called asynchronously
58+ /// </summary>
59+ /// <param name="name">Name of the action</param>
60+ bool IsActionAsync ( string name ) ;
61+
62+ /// <summary>
63+ /// Checks whether the condition should be called asynchronously
64+ /// </summary>
65+ /// <param name="name">Name of the condition</param>
66+ bool IsConditionAsync ( string name ) ;
67+
3268 /// <summary>
3369 /// Return all user actions names
3470 /// </summary>
@@ -40,5 +76,7 @@ bool ExecuteCondition(string name, ProcessInstance processInstance, WorkflowRunt
4076 /// </summary>
4177 /// <returns>List of conditions names</returns>
4278 List < string > GetConditions ( ) ;
79+
80+
4381 }
4482}
0 commit comments