Package org.imixs.workflow.engine
Class WorkflowScheduler
java.lang.Object
org.imixs.workflow.engine.WorkflowScheduler
- All Implemented Interfaces:
Scheduler
This EJB implements a Imixs Scheduler Interface and scans workitems for
scheduled activities.
The configuration of the scheduler is based on the Imixs Scheduler API.
- Version:
- 1.0
- Author:
- rsoika
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final int
static final int
static final int
static final int
static final int
protected jakarta.enterprise.inject.Instance<QuerySelector>
Fields inherited from interface org.imixs.workflow.engine.scheduler.Scheduler
ITEM_ERRORMESSAGE, ITEM_LOGMESSAGE, ITEM_SCHEDULER_CLASS, ITEM_SCHEDULER_DEFINITION, ITEM_SCHEDULER_ENABLED, ITEM_SCHEDULER_NAME, ITEM_SCHEDULER_STATUS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddWorkDays
(Calendar baseDate, int days) This method adds workdays (MONDAY - FRIDAY) to a given calendar object.protected void
processWorkListByEvent
(org.openbpmn.bpmn.BPMNModel model, ItemCollection taskEntity, ItemCollection eventEntity, ItemCollection configItemCollection) This method processes all workitems for a specific scheduled event element of a workflow model.run
(ItemCollection configItemCollection) This method process scheduled workitems.boolean
workItemInDue
(ItemCollection doc, ItemCollection docActivity) This method checks if a workitem (doc) is in due.
-
Field Details
-
NAME
- See Also:
-
OFFSET_SECONDS
public static final int OFFSET_SECONDS- See Also:
-
OFFSET_MINUTES
public static final int OFFSET_MINUTES- See Also:
-
OFFSET_HOURS
public static final int OFFSET_HOURS- See Also:
-
OFFSET_DAYS
public static final int OFFSET_DAYS- See Also:
-
OFFSET_WORKDAYS
public static final int OFFSET_WORKDAYS- See Also:
-
selectors
-
-
Constructor Details
-
WorkflowScheduler
public WorkflowScheduler()
-
-
Method Details
-
workItemInDue
This method checks if a workitem (doc) is in due. There are 4 different cases which will be compared: The case is determined by the keyScheduledBaseObject of the activity entity Basis : keyScheduledBaseObject "last process"=1, "last Modification"=2 "Creation"=3 "Field"=4 The logic is not the best one but it works. So we are open for any kind of improvements- Returns:
- true if workitem is is due
-
addWorkDays
This method adds workdays (MONDAY - FRIDAY) to a given calendar object. If the number of days is negative than this method subtracts the working days from the calendar object.- Parameters:
cal
-days
-- Returns:
- new calendar instance
-
run
This method process scheduled workitems. The method updates the property 'datLastRun' Because of bug: https://java.net/jira/browse/GLASSFISH-20673 we check the imixsDayOfWeek- Specified by:
run
in interfaceScheduler
- Parameters:
timer
-- Returns:
- updated scheduler configuration
- Throws:
AccessDeniedException
SchedulerException
-
processWorkListByEvent
protected void processWorkListByEvent(org.openbpmn.bpmn.BPMNModel model, ItemCollection taskEntity, ItemCollection eventEntity, ItemCollection configItemCollection) throws ModelException, QueryException This method processes all workitems for a specific scheduled event element of a workflow model. A scheduled event element can define a selector (txtscheduledview). If no selector is defined, the default selector is used:($taskid:"[TASKID]" AND $modelversion:"[MODELVERSION]")
- Parameters:
event
- - a event model element- Throws:
ModelException
QueryException
Exception
-