What is a span in APM? - apm

From the docs: https://www.elastic.co/guide/en/apm/get-started/7.12/transaction-spans.html
Spans contain information about the execution of a specific code path. They measure from the start to the end of an activity, and they can have a parent/child relationship with other spans.
But what code paths and what activity?

You have to integrate an APM agent (it's a piece of code) into your code - that's what it's being monitored by APM.

Related

Multiple agents arrival based on Variable and database column

In my source block I want to be the amount of agents based on two different factors namely the amount of beds and visitors per bed. The visitors per bed is just a variable (e.g. visitors=3) and the amount of beds is loaded from the database table which is an excel file (see first image). Now I want to code this in the code block as shown in the example in image 2, but I do not know the correct code and do not know if it is even possible.
Simplest solution is just to do the pre-calcs in the input file and have in the dbase.
The more complex solution is to set the Source arrivals as:
Now, you read your dbase code at the start of the model using SQL (i.e. the query constructor). Make the necessary computations and create a Dynamic Event for each arrival when you want it to happen, relative to the model start. Each dynamic event then calls the source.inject(1) method.
Better still is to not use Source at all but a simple Enter block. The dynamic event creates the agent with all relevant properties from your dbase and pushes it into the Enter block using enter.take(myNewAgent)
But as I said: this is not trivial

Considering differences in the same materials - Stations

I am trying to simulate a manufacturing assembly process, where material items are processed following an unique line. In the quality control stations, when a failure is detected, the object is sent to the repair area (by a truckpallet) and, when it is repaired, the same resource takes it and puts it at the start of the line. Until this point, I already programmed it.
The problem is the following: when it is a repaired object, is has to follow the same conveyor but with no stops in the stations. The object must enter a station and leave it, with no delays (as the works related with the stations have already been made).
I thought the best would be to consider the difference (repaired vs. not repaired) in the Agent, but then I can't work with it in the Main agent... I have also tried alternative solutions, for example defining variables in each station 1 and consider that in the stations delays and in the following station:
triangular( 109.1*delay_bec, delaytime_bec*delay_bec, 307.6*delay_bec)
Actions - in finished process:
if(delay_bec==0){
delay_headers=0;
delay_bec=1;}
But nothing worked... Any help?
I thought the best would be to consider the difference (repaired vs. not repaired) in the Agent, but then I can't work with it in the Main agent...
This is actually the correct approach. You need to create a custom agent type, give in a boolean variable isRepaired (or similar) and then in the delay you can dynamically adjust the duration using that characteristic:
agent.isRepaired ? 0. : 100
This will delay normal agents by 100 time units and repaired agents not at all.
Obviously, you must make sure that the agents flowing through the flow blocks are of your custom agent type (see the help how to do that)

My goal is that all resources of a resourcePool perform an action at a specific time. How do I create this iteration?

I am simulating a hospital stay with anylogic, on multiple levels. Each level has its own staff, represented by different ResourcePool (doctor, nurses, OSS) I created the flowchart of the actions concerning the patient. Now I would like, at a specific time (lunch and dinner), the OSS do tour the patients.
How do I set up that all OSS of a ResourcePool go to the rooms?
I would like to create a very small parallel flowchart, with sieze, moveTo, delay and release.
TNX
Easiest way is to use the "Downtime" element to prescribe your resources to do some action, see image below:
Under the "task type" selection, you can send them to a separate flow chart using a "ResourceTaskStart" element and they will do what you put downstream of that (moveto, delay...). Make sure to finish that with a ResourceTaskEnd block.
PS: The "Downtime" block can easily be triggered via a schedule. Make sure to read the help on that block (and the ResourceTaskStart/End blocks) and study the example models that use those.

Eclipse BPMN2 Modeller - linking from one BPMN file to another?

I'm working on a project that uses an extremely complex BPMN file, so I've been tasked with seeing if splitting it into multiple BPMNs can be done i.e. have it go from one BPMN file into another. We are using Eclipse's BPMN2 Modeler, are there any ways of doing this outside of implementing a Sub-Process? And is there a way for it to happen as a user carries out tasks rather than right at the start, for instance when the user reaches a certain point in the sequence it jumps to another BPMN, otherwise it does not?
You could use message events to signal to different lanes/flows of your original BPMN.
This would enable you to split the flow into sub-BPMN diagrams which can accept message events to start the sub-flow, and emit message events when they're complete to continue the wider process.
Subprocesses is the best way to split chunks of processes into separate units. Based on your question: "for instance when the user reaches a certain point in the sequence it jumps to another BPMN" that is when you place a sub process activity.
I wonder why you are discarding that approach.

How to connect separate processes under the same project (jBPM)

My team is new to developing these things and I came into a project that is defining an over-arching workflow using separate processes that are all defined under the same project. So it appears that right now the processes defined are all discrete units, and the plan was to connect these units together using inputs and outputs.
Based on the documentation it looks like the best-practicey way of doing this would be to define the entire, over-arching workflow using sub-process tasks.
So I wonder:
Is the implementation we've started workable?
or
Should I only have one process unit per one workflow, which defines sub-processes if the workflow is too complicated and has discrete parts?
It's fine to separate out certain parts of the process into its own process, and then call those from some sort of parent process. The task you should use in the parent process is called reusable sub-process, or call activity. It's absolutely fine to have multiple processes in the same project.