Class CodeActionUtils
OptimaJet.Workflow.Core.CodeActions.CodeActionUtils
Provides lookup helpers for scheme-local and runtime-global compiled code actions and creates identifiers used by generated code.
Namespace: OptimaJet.Workflow.Core.CodeActions
public static class CodeActionUtilsMethods
public static Task<(CodeActionsInvoker invoker, bool isGlobal)> GetCodeActionsInvokerForActionAsync(string actionName, WorkflowRuntime runtime, ProcessDefinition processDefinition) #Finds the scheme-local or runtime-global invoker that defines the named CodeActionType.Action. When both sources define the action, their relative positions in WorkflowRuntimeSettings.ExecutionSearchOrder determine which invoker is returned.
Parameters
Name
Type
Description
actionNameStringThe name of the action to locate.
runtimeWorkflowRuntimeThe runtime that supplies the search order and global code actions and loads the root process scheme when
processDefinition is a subprocess scheme.processDefinitionProcessDefinitionThe current process scheme. Its compiled code actions are the local source; for a subprocess scheme, the root process scheme is the local source.
Returns
Type
Description
Task<CodeActionsInvoker, Boolean>A tuple whose
invoker is the first matching local or global invoker, or null when neither source defines the action. isGlobal is true when the invoker was selected from WorkflowRuntime.GlobalActionsInvoker; it is false for a local invoker and when no invoker is found.Remarks
This method searches only the local and global compiled sources. It does not query WorkflowRuntime.ActionProvider.
public static Task<(CodeActionsInvoker invoker, bool isGlobal)> GetCodeActionsInvokerForConditionAsync(string conditionName, WorkflowRuntime runtime, ProcessDefinition processDefinition) #Finds the scheme-local or runtime-global invoker that defines the named CodeActionType.Condition. When both sources define the condition, their relative positions in WorkflowRuntimeSettings.ExecutionSearchOrder determine which invoker is returned.
Parameters
Name
Type
Description
conditionNameStringThe condition name to locate.
runtimeWorkflowRuntimeThe runtime that supplies the search order and global code actions and loads the root process scheme when
processDefinition is a subprocess scheme.processDefinitionProcessDefinitionThe current process scheme. Its compiled conditions are the local source; for a subprocess scheme, the root process scheme is the local source.
Returns
Type
Description
Task<CodeActionsInvoker, Boolean>A tuple whose
invoker is the first matching local or global invoker, or null when neither source defines the condition. isGlobal is true when the invoker was selected from WorkflowRuntime.GlobalActionsInvoker; it is false for a local invoker and when no invoker is found.Remarks
This method searches only the local and global compiled sources. It does not query WorkflowRuntime.ActionProvider.
public static Task<(CodeActionsInvoker invoker, bool isGlobal)> GetCodeActionsInvokerForRuleGetAsync(string ruleGetName, WorkflowRuntime runtime, ProcessDefinition processDefinition) #Finds the scheme-local or runtime-global invoker that defines the named CodeActionType.RuleGet. When both sources define the rule, their relative positions in WorkflowRuntimeSettings.ExecutionSearchOrder determine which invoker is returned.
Parameters
Name
Type
Description
ruleGetNameStringThe name of the rule that returns workflow participant identities.
runtimeWorkflowRuntimeThe runtime that supplies the search order and global code actions and loads the root process scheme when
processDefinition is a subprocess scheme.processDefinitionProcessDefinitionThe current process scheme. Its compiled rules are the local source; for a subprocess scheme, the root process scheme is the local source.
Returns
Type
Description
Task<CodeActionsInvoker, Boolean>A tuple whose
invoker is the first matching local or global invoker, or null when neither source defines the rule. isGlobal is true when the invoker was selected from WorkflowRuntime.GlobalActionsInvoker; it is false for a local invoker and when no invoker is found.Remarks
This method searches only the local and global compiled sources. It does not query WorkflowRuntime.RuleProvider.
public static Task<(CodeActionsInvoker invoker, bool isGlobal)> GetCodeActionsInvokerForRuleCheckAsync(string ruleCheckName, WorkflowRuntime runtime, ProcessDefinition processDefinition) #Finds the scheme-local or runtime-global invoker that defines the named CodeActionType.RuleCheck. When both sources define the rule, their relative positions in WorkflowRuntimeSettings.ExecutionSearchOrder determine which invoker is returned.
Parameters
Name
Type
Description
ruleCheckNameStringThe name of the rule that checks a workflow participant identity.
runtimeWorkflowRuntimeThe runtime that supplies the search order and global code actions and loads the root process scheme when
processDefinition is a subprocess scheme.processDefinitionProcessDefinitionThe current process scheme. Its compiled rules are the local source; for a subprocess scheme, the root process scheme is the local source.
Returns
Type
Description
Task<CodeActionsInvoker, Boolean>A tuple whose
invoker is the first matching local or global invoker, or null when neither source defines the rule. isGlobal is true when the invoker was selected from WorkflowRuntime.GlobalActionsInvoker; it is false for a local invoker and when no invoker is found.Remarks
This method searches only the local and global compiled sources. It does not query WorkflowRuntime.RuleProvider.
public static string GetClassName(CodeActionDefinition codeActionDefinition) #Creates the C# class name used to compile the specified CodeActionDefinition.
Parameters
Name
Type
Description
codeActionDefinitionCodeActionDefinitionThe definition whose logical name and type are included in the class name.
Returns
Type
Description
StringThe identifier-compatible
{Name}_{Type}_Class name.public static string GetNamespaceName(string namespacePostfix) #Creates the C# namespace used to compile code actions for the specified postfix.
Parameters
Name
Type
Description
namespacePostfixStringThe value appended to CodeActionUtils.NamespaceForCodeActions after an underscore.
Returns
Type
Description
StringThe identifier-compatible
{NamespaceForCodeActions}_{namespacePostfix} namespace name.public static string GetMethodName(CodeActionDefinition codeActionDefinition) #Creates the compiled C# method name for
codeActionDefinition, selecting the synchronous or asynchronous form from CodeActionDefinition.IsAsync.Parameters
Name
Type
Description
codeActionDefinitionCodeActionDefinitionThe definition whose logical name and type are included in the method name.
Returns
Type
Description
StringThe identifier-compatible
{Name}_{Type} name, with an Async suffix when CodeActionDefinition.IsAsync is true.public static string GetMethodName(string name, CodeActionType type) #Creates the synchronous compiled C# method name for the specified logical name and code-action type.
Parameters
Name
Type
Description
nameStringThe logical name of the action, condition, or rule.
Returns
Type
Description
StringThe identifier-compatible
{Name}_{Type} name.public static string GetAsyncMethodName(string name, CodeActionType type) #Creates the asynchronous compiled C# method name for the specified logical name and code-action type.
Parameters
Name
Type
Description
nameStringThe logical name of the action, condition, or rule.
Returns
Type
Description
StringThe identifier-compatible
{Name}_{Type}Async name.Fields
public static string NamespaceForCodeActions #Specifies the namespace prefix used for generated code-action types.
Remarks
CodeActionUtils.GetNamespaceName(string) joins this value and its postfix with an underscore, then converts the result to an identifier-compatible name.