Module reahl.workflowmodel

Deferred actions

DeferredAction

class reahl.workflowmodel.DeferredAction(**kwargs)

A DeferredAction implements something the system should do some time in the future. A DeferredAction will be done once a number of Requirements are fulfilled. The success_action method of a DeferredAction contains the code that needs to be executed when all Requirements are fulfilled. If all Requirements are not fulfilled by the given deadline (a DateTime), the deadline_action is executed instead, before the DeferredAction is deleted.

Parameters
  • requirements – A list of Requirement instances to be satisfied before .success_action can be executed.

  • deadline – The DateTime by which deadline_action will be executed if all requirements are not fulfulled by that time.

success_action()

Override this method to supply the code that needs to execute upon all instances of Requirement are fulfilled.

deadline_action()

Override this method to supply the code that needs to execute once the DateTime limit has been reached, and not all Requirement have been fulfilled

Requirement

class reahl.workflowmodel.Requirement(**kwargs)

Something that needs to be fulfilled before a DeferrredAction can be completed. Programmers are required to create subclasses of Requirement that call self.set_fulfulled() somewhere in a method of the subclass in order to indicate that the Requirement is fulfilled.

Tasks and Queues

WorkflowInterface

class reahl.workflowmodel.WorkflowInterface

An object that @exposes a number of Events that user interface Widgets can use to access the functionality of this module.

Obtain an instance of WorkflowInterface by merely instantiating it.

@exposed events:

  • take_task = Requests that the given task be reserved for the account currently logged in.

  • defer_task = Indicates that the current user will tend to the given task later.

  • go_to_task = Indicates that the current user is attending to a task previously deferred.

  • release_task = Releases the current task back into the que for other users to tend to.

Queue

class reahl.workflowmodel.Queue(**kwargs)

A first-in, first-out queue that is monitored by users for Tasks that the system indicated need to be done.

Task

class reahl.workflowmodel.Task(**kwargs)

A Task that the system needs a user to do. Programmers should create subclasses of Task implementing specific Tasks in a given problem domain.

Parameters
  • queue – The Queue to which this Task is allocated.

  • title – A title for this task.

Inbox

class reahl.workflowmodel.Inbox(queues)

The inbox of a user monitors several Task Queues.