BPMN: multiple timer start event leading to single event - bpmn

What's the proper way to model a multiple timer start event that would lead to single/similar event?
For example: a BPMN for an evaluation process in a company, there's annual evaluation for regular employees (1st timer start event) and there's an evaluation a month upon hiring for newly hired employees (2nd timer start event). Both timer would then lead to the same following event because the process for evaluation, regardless of type of employee, is the same (for this example).
This is what i had in mind, but i'm not sure if this is proper or right at all.

I think an issue with your process design is that one and only one process instance will be created each month and each year.
If my understanding is correct you want to create one instance each year for each employee and one each month for new comers.
What I suggest is to have two process definitions (one for annual and one for monthly evaluation) both using a call activity to instantiate a shared evaluation process.
The Annual evaluation process can use a parallel multi-instantiated call activity to create one evaluation process instance per employee.
The Monthly review process need to be manually started (or be part of an HR process) for each employee and have a loop design to trigger the evaluation process twelve times. I use a timer event to pause for a month between each iteration.
I designed the process with Bonita BPM 7.1.5 Community edition. So if you want you can get the process definition.

Related

Invalidate span when there's a change in a planning entity

So I hit the wall pretty hard on my current implementation.
I have two planning entities: a machine and a task.
The task has a custom shadow variable which calculates the task start time.
It was all working well, however I needed to add a span when the task cannot start at the calculated time, because there are no employees available ( there's a fixed number of employees per machine )
To implement this last feature, after calculating the start time, if the task couldn't be started at that time it searches for the next available time where there are enough employees for this task to start. It is done by looping through the ordered planned tasks of all machines, and calculating if at the end of that task it has enough employees for this task.
The problem with this is: this span time does not go away if the task it spanned until the end of changes position.
I'll leave an image trying to explain this:
Is there a better way to add these spans? Or if I'm in the right direction, is there a way to make sure optaplanner invalidates the start times and recalculates them when such a move occurs?
Thank you in advance!
Update: I've managed to trigger the update for every entity after one changes, however this gets real slow real fast, but i do not see any other way around this, as if an entity changes it may cause lack of employees on another machine's entity, anyone has something else in mind for this issue?

How to minimize max value in Google OR-Tools?

I am developing a model to solve a MILP problem using Google OR-Tools and Python. I have a problem with t tasks. Every task i needs w_i weeks to be completed and p_i_t workers on that specific week. There is a total time in weeks to complete all tasks. I need to optimize (min) the max value of workers needed in a particular week (variables to define: starting week for every particular task, or similar).
There is also a constraint: once a task starts, it should be finished. All tasks could run in parallel if needed.
Is it possible to model this problem using Google OR-Tools?. I have been trying to add a max Python function inside solver.Minimize but it is not working. How do I implement it correctly in Google OR tools?

How to stop simulation run after specific time NOT tick

all.
Regardless of what my model does, I want to stop the simulation after running for a specific time (real clock time). For example, stop after 5 or 10 or 15 minutes. I tried stopping it after 5 minutes using the RunEnvironment.getInstance()endAt(double tick) as follows:
RunEnvironment.getInstance()endAt(5000)
It stops at 4 minutes, 44 seconds. I came across this answer, but it seems not what I am looking for (I may be wrong). Is there a better way to achieve this? I am very new to RePast and somehow confused about the tick concept.
Thank you.
Here's a quote from a recent paper re. the tick concept that might help.
Events in Repast simulations are driven by a discrete-event scheduler. These events themselves are scheduled to occur at a particular tick. Ticks do not necessarily represent clock-time but rather the priority of its associated event. Ticks determine the order in which events occur with respect to each other. For example, if event A is scheduled at tick 3 and event B at tick 6, event A will occur before event B. Assuming nothing is scheduled at the intervening ticks, A will be immediately followed by B. There is no inherent notion of B occurring after a duration of 3 ticks. Of course, ticks can and are often given some temporal significance through the model implementation. A traffic simulation, for example, may move the traffic forward the equivalent of 30 seconds for each tick.
If you want to schedule a stop after some amount of walltime (e.g., 5 minutes) has elapsed, you could schedule an action that gets the time at its first invocation and then subsequently checks if the correct amount of time has elapsed. At that point, you could call RunEnvironment.getInstance().endRun(). How to do the time arithmetic is a Java question, so if you google for "Java time elapsed" or something like that you should get an answer.
As far as scheduling the action, you need to create a class that implements IAction (https://repast.github.io/docs/api/repast_simphony/repast/simphony/engine/schedule/IAction.html) and schedule that at whatever interval seems appropriate.

Changing Opening Hours without affecting historic data

I've been tasked to create a data visualisation dashboard that relies on me drilling into the existing database.
One report is 'revenue per available covers' - part of the calculation determining how many hours were booked against how many hours were available.
The problem is the 'hours available', currently this is stored in a schedule table that has a 1-1 link with the venue - and if admin want to update this there is a simple CRUD panel with the pre-linked field ready to complete.
I have realised that if I rely on this table at any point in the future when the schedule changes the calculations change for any historic data.
Any ideas on how to keep a 'historic' schedule with as minimum impact as possible to the database?
What you have is a (potentially) slowly-changing dimension. Basically, there are two approaches:
For each transactional record, include the hours that you are interested in.
Store the schedule with time frames, which capture the schedule at a particular point in time.
In SQL Server, I would normally go for the second option, using effDate and endDate columns to capture the period when the schedule is active.
I would suggest that you start with a deeper explanation of the concept, such as the Wikipedia page.

BPMN 2.0 Repeat Activity on a Fixed Date

I have a question related on example:
We have an activity X which has to be executed every 10th day of the month and produce a report as output. How do I build a BPMN model to reflect this?
The answer here really depends on what BPM tool you are using and the defined capabilities of that tool. Generally, you would create a process with a timed start event such that the process only initiates every 10th day of the month. Then, activity X would execute, it builds a report, and finally outputs that report as the process output.
If a start event that can recognize the 10th day of the month is not available, I would create that same process, but instead give it a message start event. Then, I would create a separate process that runs daily. In this process, I would simply check if the current date is the 10th day of the month. If so, fire a message to kick off that first process. If not, end.