Package org.keycloak.models.workflow
Class EventBasedWorkflowProvider
java.lang.Object
org.keycloak.models.workflow.EventBasedWorkflowProvider
- All Implemented Interfaces:
WorkflowProvider
,Provider
- Direct Known Subclasses:
AbstractUserWorkflowProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
activateOnEvent
(WorkflowEvent event) Indicates whether the workflow supports being activated for a resource based on the event or not.void
close()
boolean
deactivateOnEvent
(WorkflowEvent event) Indicates whether the workflow supports being deactivated for a resource based on the event or not.protected boolean
evaluate
(WorkflowEvent event) Finds all resources that are eligible for the first action of a workflow.protected ComponentModel
getModel()
protected KeycloakSession
protected boolean
isActivationEvent
(WorkflowEvent event) protected boolean
isResetEvent
(WorkflowEvent event) boolean
resetOnEvent
(WorkflowEvent event) Indicates whether the workflow supports being reset (i.e.protected WorkflowConditionProvider
resolveCondition
(String providerId) boolean
supports
(ResourceType type) Checks if the provider supports resources of the specified type.
-
Constructor Details
-
EventBasedWorkflowProvider
-
-
Method Details
-
getEligibleResourcesForInitialStep
Description copied from interface:WorkflowProvider
Finds all resources that are eligible for the first action of a workflow.- Specified by:
getEligibleResourcesForInitialStep
in interfaceWorkflowProvider
- Returns:
- A list of eligible resource IDs.
-
supports
Description copied from interface:WorkflowProvider
Checks if the provider supports resources of the specified type.- Specified by:
supports
in interfaceWorkflowProvider
- Parameters:
type
- the resource type.- Returns:
true
if the provider supports the specified type;false
otherwise.
-
activateOnEvent
Description copied from interface:WorkflowProvider
Indicates whether the workflow supports being activated for a resource based on the event or not. Iftrue
, the workflow will be activated for the resource. For scheduled workflows, this means the first action will be scheduled. For immediate workflows, this means all actions will be executed right away. At the very least, implementations should validate the event's resource type and operation to ensure the workflow will only be activated on expected operations being performed on the expected type.- Specified by:
activateOnEvent
in interfaceWorkflowProvider
- Parameters:
event
- aWorkflowEvent
containing details of the event that was triggered such as operation (CREATE, LOGIN, etc.), the resource type, and the resource id.- Returns:
true
if the workflow can be activated based on the received event;false
otherwise.
-
isActivationEvent
-
deactivateOnEvent
Description copied from interface:WorkflowProvider
Indicates whether the workflow supports being deactivated for a resource based on the event or not. Iftrue
, the workflow will be deactivated for the resource, meaning any existing scheduled actions will be removed and no further actions will be executed. At the very least, implementations should validate the event's resource type and operation to ensure the workflow will only be deactivated on expected operations being performed on the expected type.- Specified by:
deactivateOnEvent
in interfaceWorkflowProvider
- Parameters:
event
- aWorkflowEvent
containing details of the event that was triggered such as operation (CREATE, LOGIN, etc.), the resource type, and the resource id.- Returns:
true
if the workflow can be deactivated based on the received event;false
otherwise.
-
resetOnEvent
Description copied from interface:WorkflowProvider
Indicates whether the workflow supports being reset (i.e. go back to the first action) based on the event received or not. By default, this method returns false as most workflows won't support this kind of flow, but specific workflows such as one based on a resource's last updated time, or last used time, can signal that they expect the process to start over once the timestamp they are based on is updated. At the very least, implementations should validate the event's resource type and operation to ensure the workflow will only be reset on expected operations being performed on the expected type.- Specified by:
resetOnEvent
in interfaceWorkflowProvider
- Parameters:
event
- aWorkflowEvent
containing details of the event that was triggered such as operation (CREATE, LOGIN, etc.), the resource type, and the resource id.- Returns:
true
if the workflow supports resetting the flow based on the received event;false
otherwise.
-
isResetEvent
-
close
public void close() -
evaluate
-
resolveCondition
-
getModel
-
getSession
-