Time-Constrained, Event-Driven Coordination
of Composite Resources’ Consumption Flows
Zakaria Maamar
1 a
, Amel Benna
2 b
and Nabil Otsmane
3
1
College of Computing and IT, University of Doha for Science and Technology, Doha, Qatar
2
Department of Multimedia and Information Systems, CERIST, Algiers, Algeria
3
High School of Computer Science, Algiers, Algeria
Keywords:
Allen’s Time Algebra, Composite Resource, Consumption Flow, Event Driven, Time Constraint.
Abstract:
This paper discusses the composition of primitive resources in preparation for their run-time consumption by
business processes. This consumption is first, subject to time constraints impacting the availability of primitive
resources and second, dependent on events impacting the selection of primitive resources. To address prim-
itive resources’ disparate time-availabilities that could lead to conflicts, a coordination approach is designed,
developed, and tested using Allen’s time algebra and a simulated dataset. The approach produces composite
resources’ consumption flows on-the-fly after discovering time relations between primitive resources that en-
sure their availabilities and hence, assignment to business processes. Implementation results demonstrate the
technical doability of the approach along with identifying time-related obstacles that could prevent primitive
resources’ availabilities. Solutions addressing these obstacles are also reported in the implementation results.
1 INTRODUCTION
In (Maamar and Al Khafajiy, 2021) and (Maamar
et al., 2021), we discuss the concepts of resource,
consumption of resource, consumption property, con-
sumption cycle, and disruption, and exemplify all
these concepts with cloud computing. The discus-
sions demonstrated the importance of a coordinated
consumption of resources in a multi-job environment
since the continued availability of resources is not
always guaranteed (Dimick, 2014); some are scare
while others decline. Example of resource would
be virtual machine, example of consumption prop-
erty would be limited-but-extensible, example of dis-
ruption would be urgent upgrade of a virtual ma-
chine, and, last but not least, example of job would
be order delivery. Assumption made in (Maamar and
Al Khafajiy, 2021) and (Maamar et al., 2021) is that
a job would consume one resource at a time, which is
not always the case in real life. A job like order deliv-
ery, again, would consume processing power/CPU to
run programs, storage capacity/database to store data,
and bandwidth/router to communicate data. By drop-
ping this assumption in the sense that a job would now
a
https://orcid.org/0000-0003-4462-8337
b
https://orcid.org/0000-0002-9076-5001
consume many resources, this means specializing re-
source into primitive and composite.
By analogy with tasks and component Web ser-
vices that are put together to form business pro-
cesses (Weske, 2012) and composite Web ser-
vices (Langdon, 2003), respectively, a composite re-
source would line up a set of primitive, and even
composite, resources that would be consumed accord-
ing to specific events that would arise and specific
functional and non-functional characteristics that jobs
would have. However, lining up several primitive
resources would require considering their respective
availability times. For instance, a primitive resource is
available between 2pm and 4pm, only, while another
is available after 10min from the complete consump-
tion of a group of primitive resources. How to coordi-
nate the consumption of composite resources accord-
ing to their primitive resources’ availability times is a
concern that we address in this paper.
In conjunction with achieving a time-constrained,
event-driven coordination of composite resources, the
impact of primitive resources’ consumption proper-
ties on composite resources’ availability times could
hinder this coordination. Specialized into unlimited,
limited, limited-but-extensible, shareable, and non-
shareable as per our work in (Maamar et al., 2016),
consumption properties could for instance, impose
52
Maamar, Z., Benna, A. and Otsmane, N.
Time-Constrained, Event-Driven Coordination of Composite Resources’ Consumption Flows.
DOI: 10.5220/0011711900003464
In Proceedings of the 18th International Conference on Evaluation of Novel Approaches to Software Engineering (ENASE 2023), pages 52-63
ISBN: 978-989-758-647-7; ISSN: 2184-4895
Copyright
c
2023 by SCITEPRESS Science and Technology Publications, Lda. Under CC license (CC BY-NC-ND 4.0)
extending the availability times of some primitive re-
sources at the expense of others so that the consump-
tion of the composite resource as a whole completes
successfully. How to perform this extension without
initiating conflicts is another concern that we address
in this paper, as well.
To address both concerns, we resort to Allen’s
time algebra (Allen, 1983). The objective is to iden-
tify potential time-interval relations between the re-
spective availability times of primitive resources par-
ticipating in the same composite resource. Allen’s
algebra offers an exhaustive coverage of possible re-
lations between time intervals along with the possi-
bility of reasoning over these relations. Examples
of relations include equals, overlaps, starts, and dur-
ing. Our objective is to achieve a time-constrained,
event-driven coordination of composite resources that
would be sensitive to both availability times of and
consumption properties of primitive resources. Our
contributions are, but not limited to, (i) identifica-
tion of potential time-interval relations between prim-
itive resources’ availability times using Allen’s time
algebra, (ii) analysis of the impact of consump-
tion properties on primitive resources’ availability
times, (iii) on-the-fly definition of consumption flows
of composite resources based on their primitive re-
sources’ availability times and consumption proper-
ties, and (iv) demonstration of consumption flows
through a case study and system. The rest of this
paper is organized as follows. Section 2 is a sum-
mary of some related works. Section 3 defines the
concepts of resource and their consumption properties
and also refers to a running example used for illustra-
tion purposes. Section 4 provides a temporal analysis
of these consumption properties prior to detailing the
approach for coordinating the consumption of primi-
tive resources in Section 5. This approach’s technical
details and concluding remarks are reported in Sec-
tions 6 and 7, respectively.
2 RELATED WORK
In the research community, resource management in
business processes is commonly studied. In this sec-
tion, we discuss this management in terms of re-
source allocation and composition. In (Stefanini et al.,
2020), Stefanini et al. propose a process mining-
based approach to support resource planning of health
services. They combine techniques like time-driven
activity-based costing and process mining to identify
and analytically evaluate tasks, service times, and re-
source consumptions for specific medical conditions.
For the needs of process mining, the approach uses an
event log to estimate the expected resource consump-
tions of each medical intervention.
In (Maamar et al., 2022), Maamar et al. define
an approach for coordinating the consumption of re-
sources by business processes’ tasks. The approach
takes into account both resources’ properties like un-
limited and limited-but-extensible and tasks’ transac-
tional properties like pivot and compensatable. On
top of these properties, the approach adopts Allen’s
time algebra and uses historical details about past ex-
ecutions stored in an event log to coordinate resource
consumption. In (Arias et al., 2015), Arias et al. pro-
pose a process mining-based recommendation frame-
work to allocate resources to sub-processes instead
of individual tasks. The framework uses a set of
criteria related to resource’s capabilities, resource’s
workload, necessary expertise to perform tasks, and
event log that encompasses details about previous ex-
ecutions. Mixing these criteria allowed recommend-
ing the top-ranked resources to a sub-process based on
the best position algorithm (Akbarinia et al., 2011).
In (Park and Song, 2019), Park and Song
build upon the results of predictive process monitor-
ing to improve business processes especially resource
allocation. To optimize this allocation, the authors use
Long Short-Term Memory (LSTM) to predict the pro-
cessing time of each task and next task of an ongoing
process instance. These details (i.e., processing time
and next task) are exploited to allocate resources to
tasks thanks to a minimum cost and maximum flow
algorithm. In (Sindhgatta et al., 2016), the authors
propose a context-based approach for making deci-
sions about resource allocation to tasks. The approach
relies on historical data, process context, and perfor-
mance of past instances all stored in an event log to
predict the performance of under-execution process
instances. Resources allocated to these instances are
taken care by k-Nearest Neighbor technique.
In (Zhao et al., 2016), Zhao et al. analyze re-
source allocation to a business process’s tasks as a
multi-criteria decision making problem. The rec-
ommendation of resources to a BP’s tasks considers
both resource characteristics and task preference pat-
terns established based on past executions. To un-
cover these patterns, the authors adopt an entropy-
based clustering ensemble method. In addition, they
provide dynamic resource allocation for concurrently
running process instances. In a recent work (Zhao
et al., 2020), Zhao et al. address the problem of hu-
man resources allocation using team faultlines. First,
resources’ characteristics are described from demo-
graphic and past execution perspectives. Then, this
faultline is identified and measured using various
characteristics and multiple subgroups. Finally, a
Time-Constrained, Event-Driven Coordination of Composite Resources’ Consumption Flows
53
neural network is used to achieve the allocation.
The paragraphs above reveal that resource alloca-
tion problem in business processes is timely based on
the different techniques that aim at optimizing this al-
location. Our approach is in line with what the re-
search community’s efforts with focus on resource
composition according to these resources’ time avail-
abilities and consumption properties. To synchro-
nize these availabilities along with these properties,
Allen’s time algebra is used permitting to form what
we refer to as consumption flows.
3 BACKGROUND
This section defines the concept of resource, presents
a running example, and finally discusses consumption
properties of resources and Allen’s time Algebra.
Resource Definition. The concept of resource is
not new in the literature and has been adopted
in different domains like distributed artificial intel-
ligence (e.g., resource logic for multi-agent plan-
ning (de Weerdt and Clement, 2009)), service com-
puting (e.g., RDF for interoperability (Schreiber and
Raimond, 2014) and REST for building applica-
tions (Web, Intranet, and Web services) (Fielding,
2000)), cloud computing (abstracting hardware and
software (Mell and Grance, 2011)), and business pro-
cesses (persons/machines executing tasks (Fielding,
2000)). From a broad perspective, Baker et al. spe-
cialize resources into computational, consumed, and
produced, associating each type with a separate life-
cycle that would capture the resource’s behavioral
and operational characteristics (Baker et al., 2018).
In (Lucchim et al., 2008), Lucchim et al. consider re-
sources as “directly-accessible components handled
through a standard common interface”. The interface
could be a set of stateless operations like HTTP meth-
ods. Finally, Hofman adopts everything-as-a-resource
to build seamless interoperable platforms in the world
of IoT (Hofman, 2015). Each resource (e.g., truck and
smart object) has goals and capabilities and may have
an owner, user, and virtual representation.
Running Example. It is about John who is visiting
Melissa in Paris. One day they decide to meet in
a coffee shop, not far from Melissa’s office. John
can reach the coffee shop by either taxi or bus. We
adopt Web services consuming on-premise and in-
the-cloud resources to suggest a high-level descrip-
tion of the job completing John scenario (Fig. 1).
At the hotel, John browses some transportation Web
sites about Paris. One running Itinerary WS and
hence, consuming processing power, proposes routes
between places. While checking the weather fore-
cast using Weather WS, Itinerary WS requests details
about the origin and destination places using Loca-
tion WS that accesses a dedicated database. Should
Weather WS return bad weather, Itinerary WS would
instruct Taxi WS to book a taxi for John. Otherwise,
Itinerary WS would send the location of both John’s
hotel and the coffee shop to Bus WS, which advises
about the bus numbers that John should ride. Potential
traffic jams would make Bus WS interact with Traf-
fic WS, should the bus numbers need to be adjusted.
Bus WS
Location WS
Weather WS
Taxi WS
Traffic WS
weather?
Itinerary WS
Component (WS) level
Resource level
Programs CloudsDatabasesServers
Figure 1: Specification of the job handling John scenario.
From a consumption perspective, on-premise and
in-the-cloud resources would be associated with nec-
essary consumption properties as their owners see fit.
For instance, databases could be non-shareable for
concurrent Web services so that consistency is en-
forced, and servers hosting virtual machines could
be limited-but-extensible for long-running Web ser-
vices so that a balanced load over the servers is main-
tained. Besides the consumption properties, the re-
sources could have availability times that need to
be considered, too. For instance, backup databases
are activated concurrently everyday after midnight for
3 hours, and servers hosting virtual machines are sus-
pended sequentially once a week for 2 hours for main-
tenance. Both consumption properties and availabil-
ity times of resources would have an impact on com-
pleting the job above.
Consumption Properties of Primitive Resources. In
compliance with our previous work on social co-
ordination of business processes (Maamar et al.,
2016), the consumption properties of a primitive re-
source (P R ) could be unlimited (u), shareable (s),
limited (l), limited-but-extensible (lx), and non-
shareable (ns). First, a primitive resource is limited
when its consumption is bound to an agreed-upon
time period (capacity, too, like 20 liters, but not con-
sidered in this work). Second, a primitive resource
is limited-but-extensible when its consumption con-
tinues to happen after extending the (initial) agreed-
upon time period. Finally, a primitive resource is non-
ENASE 2023 - 18th International Conference on Evaluation of Novel Approaches to Software Engineering
54
shareable when its concurrent consumption needs to
be coordinated (e.g., one at a time). A primitive re-
source is by default unlimited and/or shareable. The
set of all consumption cycles (CC) of the 5 properties
are captured into Fig. 2. However, only 2 consump-
tion cycles are listed for illustration purposes.
1. Unlimited property: P R .cc
ul
: not-made-
available
start
made available
waitingtobebound
not-consumed
consumptionapproval
consumed
nolongeruse f ul
withdrawn.
2. Limited-but-extensible property: P R .cc
lx
:
not-made-available
start
made avail-
able
waitingtobebound
not-consumed
consumptionapproval
consumed
consumptionupdate
done
renewableapproval
made available. The
transition from done to made available allows a
resource to be regenerated for another cycle of
consumption.
Definition 1. A primitive resource P R is defined
by the tuple < id, name, period, cp, cc
cp
> where id
is the identifier of the primitive resource, name is
the name of the primitive resource, period is the
availability-time interval [b, e] of the primitive re-
source where b and e stand for begin-time and end-
time, cp is the consumption property of the primi-
tive resource as either u, s, l, lx, or ns, and cc
cp
is
the consumption cycle of the primitive resource ac-
cording to its consumption property and is defined
by the tuple < S, T, S
active
>, i.e., cc
cp
= s
i
trans
i
s
i+1
trans
i+1
s
i+2
. . . s
j1
trans
j1
s
j
where S is the set
of states {s
i
} where s
i
is either not-made-available,
consumed, locked, etc. (Fig. 2), T is the set of tran-
sitions {trans
i
} where trans
i
is either consumption-
approval, consumption-update, etc. (Fig. 2), and
S
active
S is the set of states that have been enabled
since the activation of the consumption cycle. At ini-
tialization time, S
active
= {not-made-available}.
Allen’s time algebra. Table 1 presents some po-
tential relations (in fact, there exist 13) between time
intervals, i.e., pairs of endpoints, allowing to support
multiple forms of temporal reasoning like what to do
when 2 time intervals start/end together, when a time
interval falls into another time interval, etc. (Allen,
1983). In Allen’s time algebra, each relation is la-
beled as either distinctive, exhaustive, or qualita-
tive. Typical applications of Allen’s time algebra in-
clude planning and scheduling, natural language pro-
cessing, temporal databases, workflows, to cite just
some (Janhunen and Sioutis, 2019).
Table 1: Some Allen’s time-interval relations.
x y
time
x
y
x precedes y x equals y
x
y
time
y
x
time
x overlaps y x during y
4 TEMPORAL ANALYSIS OF
CONSUMPTION PROPERTIES
When tracking the consumption of a primitive re-
source (P R
k
) by a job (J
i
) from a time-interval
perspective, this consumption, that could happen
many times, i.e., 1[con
in
=1,...
], would depend on the
primitive resource’s both consumption property and
availability-time interval and would allow to define
what we refer to as the job’s consumption-time inter-
vals (when the consumption has effectively occurred).
To track how a job consumes a primitive resource, we
proceed as follows:
1. Unlimited, limited, and limited-but-extensible
primitive resources, we associate them with
specific availability-time intervals, P R
k
[b, [,
P R
k
[b, e], P R
k
[b, e 0[+δ]], where b, e, and δ
stand for begin-time, end-time, and extra-time (re-
peated but not indefinitely), respectively.
2. Shareable and non-shareable primitive re-
sources, we either tolerate or not their con-
current consumption (con
in
, con
jn
, . . . ) by
separate jobs (J
i
, J
j
, . . . ) during the respective
availability-time intervals of these primi-
tive resources, e.g., J
P R
k
i
[b
con
in
, e
con
in
]
P R
k
[b, e] J
P R
k
j
[b
con
jn
, e
con
jn
] P R
k
[b, e] and
b
con
in
== b
con
jn
.
3. Unlimited primitive resources, we allow them to
accommodate any job’s multiple consumption re-
quests (con
i1
, con
i2
, . . . ) during their availability-
time intervals.
To illustrate the 3 cases above, Table 2 refers to 3 jobs,
J
1
, J
2
, and J
3
, and their respective consumption of
resources for instance, J
1
s con
11
, J
2
s con
21,22
, and
J
3
s con
31,32,33,34
. We now discuss the impact of lim-
ited and limited-but-extensible consumption proper-
ties on a primitive resource’s availability-time interval
using the same table.
1. Limited property means that a primitive re-
source’s availability-time interval that is set
Time-Constrained, Event-Driven Coordination of Composite Resources’ Consumption Flows
55
start
Locked
lock
consumption
approval
Unlocked
release
Not made
available
renewable approval
Made available
waiting
to be bound
Not consumed
consumption
update
consumption
rejection
Withdrawn
Done
consumption
completion
no-longer
useful
Initial state
End state
Entry-point state
Legend
consumption update
consumption
approval
Consumed
Figure 2: Primitive resource’s consumption cycle as a state diagram (Maamar et al., 2016).
Table 2: Availability-time interval versus Consumption-time interval.
b e
con 
11
con 
21
con 
31
con 
41
availability
time
consumption
time
con 
22
b e
con 
11
con 
21
con 
12
con 
31
con 
32
con 
33
con 
34
availability
time
consumption
time
extended
availability time
(a) limited P R (b) limited-but-extensible P R
at design-time, P R
k
[b, e], remains the same
at run-time despite the requests for additional
consumption that this primitive resource would
receive from the same jobs (after these jobs’
respective first consumption). A job requesting
to consume a limited primitive-resource is con-
firmed iff the job’s first consumption-time interval
falls into the primitive resource’s availability-time
interval (e.g., J
P R
k
2
[b
con
21
, e
con
21
] P R
k
[b, e] in
Table 2 (a) where b
con
21
> b and e
con
21
< e)
and, then, any additional consumption-
time intervals must fall into the primitive
resource’s same availability-time interval
(e.g., J
P R
k
2
[b
con
22
, e
con
22
] r
k
[b, e] in Table 2 (a)
where b
con
22
== e
con
21
and e
con
22
== e).
2. Limited-but-extensible property means that a
primitive resource’s availability-time interval that
is set at design-time, P R
k
[b, e], can be adjusted
at run-time, P R
k
[b, e 0[+δ]], so that the requests
for additional consumption that this primitive re-
source would receive from the same jobs (after
these jobs’ respective first consumption) are ac-
commodated. A job requesting to consume a
limited-but-extensible primitive-resource is con-
firmed iff the job’s first consumption-time inter-
val falls into the primitive resource’s availability-
time interval (e.g., J
R
k
3
[b
con
31
, e
con
31
] P R
k
[b, e]
in Table 2 (b) where b
con
31
> b and e
con
31
<
e) and, then, any additional consumption-
time intervals still fall into either the prim-
itive resource’s same availability-time interval
(e.g., J
P R
k
3
[b
con
32
, e
con
32
] P R
k
[b, e] in Ta-
ble 2 (b) where b
con
32
== e
con
31
and e
con
32
< e) or
the primitive resource’s extended availability-time
interval (e.g., J
P R
k
3
[b
con
33
, e
con
33
] P R
k
[e, e + δ]
in Table 2 (b) where b
con
33
== e
con
32
and e
con
33
<
e + δ).
5 CONSUMPTION OF
COMPOSITE RESOURCES
After defining some concepts linked to the coordi-
nated consumption of composite resources, we now
discuss how these resources’ consumption flows are
generated according to primitive resources’ availabil-
ity times and consumption properties.
5.1 Definitions
In preparation for defining composite resources, we
deem necessary contrasting them with business pro-
cesses and composite Web services. On the one hand,
while a business process and composite Web service
ENASE 2023 - 18th International Conference on Evaluation of Novel Approaches to Software Engineering
56
have a process model and composition schema, re-
spectively, a composite resource also has a consump-
tion flow. In addition, while the performance of a
business process and composite Web service is de-
pendent on their tasks’ and component Web services’
non-functional properties, respectively, the consump-
tion of a composite resource is also dependent on
their primitive resources’ availability-time intervals
and consumption properties. On the other hand, while
a business process’ process model and composite Web
service’s composition schema are known ahead of
time, a composite resource’s consumption flow is
set on-the-fly according to their primitive resources’
availability-time intervals and consumption proper-
ties and Allen’s time-interval relations that could vary
from one consumption cycle to another (begin and
end values assigned to time intervals vary per sce-
nario). Finally, the completion of business processes
and composite Web services depends on the availabil-
ity of composite resources that themselves depend on
the availability of primitive resources.
Definition 2. A composite resource C R is defined
by the tuple < id, name, evt, {UPR}, C F > where
id is the identifier of the composite resource, name
is the name of the composite resource, evt is the
name of the event that triggers the consumption of
the composite resource, UPR is an unordered set
of primitive resources {P R
i
} as per Definition 1,
and C F is the consumption flow of the compos-
ite resource that is generated on-the-fly based on
both the primitive resources’ availability-time in-
tervals/consumption properties and Allen’s appro-
priate time-interval relations between these primi-
tive resources. The consumption flow is represented
as a set of couples {rel(P R
i
, P R
j
)} where rel
{equals, starts, f inishes, overlaps, during}. More de-
tails are given in Section 5.2
5.2 Generation of Consumption Flows
Let us assume a job (J ) to carry out like in the run-
ning example. The generation of this job’s compos-
ite resource’s consumption flow (C F ) would go over
identification and adjustment stages (Fig. 3). Briefly,
in the identification stage, the designer defines Allen’s
time-interval relations that would connect the primi-
tive resources together based on these primitive re-
sources’ respective availability-time intervals. This
produces what we refer to as the composite resource’s
initial consumption flow (I C F ). And, in the adjust-
ment stage, the designer assesses the impact of the
identified Allen’s time-interval relations on the primi-
tive resources’ consumption properties. This could re-
quire adjusting the availability-time intervals of these
primitive resources to enforce their concurrent/com-
posite consumption whenever deemed possible. The
assessment goes through several rounds until what we
refer to as the composite resource’s final consumption
flow (F C F ) is obtained.
Identification Stage. As per Definition 2, the un-
ordered set of primitive resources (UP R ) that form
a composite resource are known based on the trig-
gered event of the job to complete. This set consti-
tutes an input to Algorithm 1 whose output is the com-
posite resource’s I C F . In I C F , the different primi-
tive resources are connected together through appro-
priate Allen’s time-interval relations, e.g., I C F =
{overlaps(P R
i
,P R
j
), ·· · , starts(P R
k
,P R
l
)}.
Adjustment Stage. The outcome of the identifica-
tion stage that is I C F is processed according to the
following steps:
Step 1: parses the I C F to cluster the primitive re-
sources based on Allen’s time-interval relations.
The result are 5 clusters, C
rd=1···m
rt=1···5
, where a clus-
ter’s superscript (rd)
1
and subscript (rt) corre-
spond to the current number of round tracking
the progress of parsing the I C F and a numerical
value that is the time relation’s type, respectively.
For instance, C
1
1
is the cluster of all primitive re-
sources connected through equals at round 1 and
C
3
2
is the cluster of all primitive resources con-
nected through starts at round 3. It is worth noting
that some clusters could end-up empty depending
on the time-relation intervals included in I C F .
Step 2: flushes UP R and generates a unique com-
posite resource, C R
rd
i j
, for each Allen’s time-
interval relation included in the 5 clusters,
C
rd
rt=1···5
, that illustrate a concurrent consumption
of primitive resources, namely equals, starts, fin-
ishes, overlaps, and during. For instance, C R
1
12
is the composition of P R
1
and P R
2
at round 1.
Prior to inserting C R
rd
i j
into the flushed UP R
that will become an unordered set of composite
resources, CR
rd
i j
s availability-time interval needs
to be defined first, according to both Allen’s time-
interval relation of the cluster and the consump-
tion properties and availability-time intervals of
the primitive resources in the cluster as well and
second, in a way that the concurrent consumption
of the primitive resources is maintained.
Equals(P R
i
, P R
j
): whether P R
i
and P R
j
are limited or limited-but-extensible, C R
rd
i j
s
availability-time interval is the availability-
time interval of any primitive resource, for in-
1
The maximum value, m, is known after completing the
adjustment stage.
Time-Constrained, Event-Driven Coordination of Composite Resources’ Consumption Flows
57
Figure 3: Modules, repositories, and interactions in the generation of consumption flows
stance [b
i
, e
i
].
Starts(P R
i
, P R
j
):
Limited property (Table 3-Case a): C R
rd
i j
s
availability-time interval is set as follows:
begin-time of any primitive resource and end-
time of PR
i
since it has the first end-time, for
instance [b
i
, e
i
].
Limited-but-extensible property (Table 3-
Case b): C R
rd
i j
s availability-time interval is
set as follows: begin-time of any primitive re-
source and end-time of P R
j
that has the last
end-time, for instance [b
i
, e
j
]. At the same
time, P R
i
s end-time is extended to match
P R
j
s end-time, e
i
+ δ == e
j
.
Finishes(P R
i
, P R
j
):
- Limited property: CR
rd
i j
s availability-time
interval is set as follows: begin-time of P R
i
that has the last begin-time and end-time of
any primitive resource.
- Limited-but-extensible property: C R
rd
i j
s
availability-time interval is set as follows:
begin-time of PR
i
that has the last begin-time
and end-time of any primitive resource.
During(P R
i
, P R
j
):
- Limited property: CR
rd
i j
s availability-time
interval is set as follows: begin-time of P R
i
that has the last begin-time and end-time of
P R
i
again that has the first end-time.
- Limited-but-extensible property: C R
rd
i j
s
availability-time interval is set as follows:
begin-time of P R
i
that has the last begin-
time and end-time of P R
j
that has the last
end-time. At the same time, P R
i
s end-
time is extended to match P R
j
s end-time,
e
i
+ δ == e
j
.
Overlaps(P R
i
, P R
j
):
- Limited property: CR
rd
i j
s availability-time
interval is set as follows: begin-time of P R
j
that has the last begin-time and end-time of
P R
i
that has the first end-time.
- Limited-but-extensible property: C R
rd
i j
s
availability-time interval is set as follows:
begin-time of P R
j
that has the last begin-
time and end-time of P R
j
again that has the
last end-time. At the same time, P R
i
s end-
time is extended to match P R
j
s end-time,
e
i
+ δ == e
j
.
Step 3: increments the number of round by 1,
runs Algorithm 1 again with UP R as an un-
ordered set of composite resources, and goes
back to Step 1 until the 4 clusters, except
for equals, become empty, i.e., C
rd
rt=2···5
==
φ. Should the condition hold for the 4 clus-
ters, then the composite resource’s F C F is de-
picted in C
rd
1
linked to equals, e.g., F C F =
{equals(C R
rd
i
, C R
rd
j
) equals(C R
rd
k
, C R
rd
l
)
equals(C R
rd
m
, C R
rd
n
), . . . }. All the composite re-
sources will have the same interval.
5.3 Illustration
With respect to the running example, the Web
services consume different resources like vir-
tual machines for processing and databases for
storage. To illustrate the generation of a con-
sumption flow, we assume an UP R consisting
of 4 primitive resources, P R
1..4
, all limited,
having each an availability-time interval, for
instance [2,5], [3,6], [2,5], and [3,5], respectively.
We proceed with rolling out the identifica-
tion and adjustment stages. After completing
Algorithm 1, I C F = {overlaps(P R
1
,P R
2
),
equals(P R
1
,P R
3
), overlaps(P R
3
,P R
2
),
starts(P R
2
,P R
4
), finishes(P R
4
,P R
3
),
finishes(P R
4
,P R
1
)}. Then, the final inter-
val would be [3,5].
ENASE 2023 - 18th International Conference on Evaluation of Novel Approaches to Software Engineering
58
Input: UP R : {P R
i
[b
i
, e
i
]}
i=1,n
: unordered set of primitive
resources
Output: I C F : initial consumption flow of a composite
resource
1 begin
2 Initialize I C F to φ;
3 Initialize Concurrency to true;
4 foreach i [1, n-1] do
5 foreach j [i + 1, n] do
6 if Concurrency == true then
7 if e
i
== b
j
then
8 I C F = φ; Concurrency f alse;
break;
9 end
10 if b
i
== e
j
then
11 I C F = φ; Concurrency f alse;
break;
12 end
13 if b
i
> b
j
and e
j
< b
i
then
14 I C F = φ; Concurrency f alse;
break;
15 end
16 if e
i
> b
j
and e
i
< b
j
then
17 I C F = φ; Concurrency f alse;
break;
18 end
19 if (e
i
== e
j
andb
i
== b
j
) then
20 I C F = I C F equals(P R
i
, P R
j
);
break;
21 end
22 if b
i
== b
j
and e
i
> e
j
then
23 I C F = I C F starts(P R
i
, P R
j
);
break;
24 end
25 if b
i
== b
j
and e
i
< e
j
then
26 I C F = I C F starts(P R
i
, P R
j
);
break;
27 end
28 if e
i
== e
j
and b
i
< b
j
then
29 I C F =
I C F f inishes(P R
i
, P R
j
);
break;
30 end
31 if e
i
== e
j
and b
i
> b
j
then
32 I C F =
I C F f inishes(P R
j
, P R
i
);
break;
33 end
34 if b
i
< b
j
and e
i
< e
j
then
35 I C F = I C F during(P R
i
, P R
j
);
break;
36 end
37 if b
i
< b
j
and e
j
> b
i
then
38 I C F =
I C F overlaps(P R
j
, P R
i
);
break;
39 end
40 if e
i
> b
j
and e
i
> e
j
then
41 I C F = I C F during(P R
j
, P R
i
);
break;
42 end
43 if e
i
> b
j
and e
i
< e
j
then
44 I C F =
I C F overlaps(P R
i
, P R
j
);
break;
45 end
46 end
47 end
48 end
49 return IC F
50 end
Algorithm 1: Initial consumption-flow development.
Table 3: Definition of a composite resource’s availability-
time interval because of starts.
PR 
j
b 
j
e 
j
trim
CR 
ij
b 
i
e 
i
PR 
i
b 
i
e 
i
Case a
PR 
j
b 
j
e 
j
extend
PR 
i
b 
i
e 
i
CR 
ij
b 
i
e 
j
Case b
6 IMPLEMENTATION
This section discusses first the system implementing
the approach for composing primitive resources and
then, the experiments to test and evaluate this system.
6.1 Overview
To demonstrate the technical doability of on-the-fly
development of consumption flows of composite re-
sources, a system whose main graphical user inter-
face is shown in Fig. 4, was implemented using multi-
ple languages, tools, and technologies. This includes
Java, NodeJS (a back-end JavaScript runtime environ-
ment), Spring boot (a Java-based open source frame-
work to build and deploy Web applications), Gradle (a
tool for automating software build), ReactJS (a front-
end JavaScript library to build user interfaces), JSON
(an open standard for data format and interchange),
Visual Studio Code (an open source lightweight-code
editor for JavaScript and TypeScript languages), and
Postman (a platform for testing components repre-
sented as API endpoints). Classes in the system
are primitiveResource, compositeResource, relation-
Allen, and consumptionFlowGenerator implementing
the model-view-presenter architectural pattern. The
development and experimentation of the system took
place on top of an 11
th
Generation Intel 4 Cores
i5 Processors@4.2GHZ, 16GB RAM desktop.
To use the system, a designer stores necessary de-
tails about jobs to complete using primitive resources
into JSON files and then, uploads these files into the
system as per Fig. 4. In this figure, “All are con-
current”, “Part are concurrent”, and “Both” (not-
considered further) indicate possible scenarios to test
as per the next paragraphs.
Time-Constrained, Event-Driven Coordination of Composite Resources’ Consumption Flows
59
Figure 4: System’s main GUI.
Figure 5: Representation of scenario 1’s resources’ availability-time intervals.
6.2 Tests and Evaluation
Due to the unavailability of datasets that would cater
for our needs, we generated 2 separate datasets con-
taining each 15, 150, 1500, 15000, and 150000 primi-
tive resources along with their respective availability-
time intervals. The scenarios that were tested and
evaluated are as follows.
Scenario 1 (”All are concurrent”) targets a con-
sumption flow that features concurrent consumption
of all primitive resources (Fig. 5). The dataset of this
scenario, i.e., UP R formatted as per Listing 1, is
the result of Algorithm 2 whose inputs are a given
time interval ([b, e]) and a number of primitive re-
sources (n). To define each primitive resource’s
availability-time interval in the dataset, generateInter-
val function uses a randomize function twice where
genBegin and genEnd are pseudo-random numbers
with 0 genBegin b, e genEnd max, and max
is an arbitrary value like (b +e).
Listing 1: Excerpt of scenario 1-related dataset in JSON.
1 [{" id " : 2 , " n a me " : " re so ur c e - 3 " , " b e gi n T i m e " : 5 6 ,"
en d T i me " : 11 4 , " sh a re a bl e ": fa ls e },
2 . ..
3 {" id " : 1 3 , " n am e " : " r eso ur ce - 1 4 " , " b e gi n Ti m e " : 1 5 , "
en d T i me " : 11 1 , " sh a re a bl e ": fa ls e }]
A graphical representation of Listing 1 is shown in
Fig. 5 after setting the number of primitive resources
to 15. Some Allen’s time relations in this representa-
tion include during between resource-1 and resource-
2, and overlaps between resource-4 and resource-5.
ENASE 2023 - 18th International Conference on Evaluation of Novel Approaches to Software Engineering
60
Input: b: begin-time interval, e: end-time
interval, n: number of primitive resources
to generate
Output: UP R : set of primitives resources
1 begin
2 Initialize UP R to φ;
3 foreach i [1, n] do
4 generateInterval(b,e,b +
e,genBegin,genEnd);
5 UP R = UP R
createResource(genBegin,genEnd);
6 end
7 return UP R
8 end
Algorithm 2: Dataset generation for scenario 1.
After completing the identification and adjustment
stages, [65,75] is the common availability-time in-
terval (Fig. 5:red band) ensuring the concurrent con-
sumption of all the primitive resources. Using the sys-
tem, the designer can check the availability-time in-
terval of each primitive resource, zoom in/out the dis-
played results, and save these results in formats like
csv and png.
Scenario 2 (”Part are concurrent”) targets a con-
sumption flow that features both concurrent and se-
quential consumption of primitive resources (Fig. 6).
This scenario whose dataset is formatted as per List-
ing 2 required adjusting Algorithm 1 in a way that
meets and precedes time-relations were supported this
time. To generate the second dataset, Algorithm 2 is
used again after adjusting randomize function where
a start time is generated first subject to satisfying
0 genBegin < e. Then, an end time that satis-
fies genBegin < genEnd max is generated based on
this start time.
Listing 2: Excerpt of scenario 2-related dataset in JSON.
1 [{" id " : 0 , " n a me " : " re so ur c e - 1 " , " b e gi n T i m e " : 2 5 ,"
en d T i me " : 93 , " sh a re a bl e " : fa l s e },
2 . ..
3 {" id " : 1 4 , " n am e " : " r eso ur ce - 1 5 " , " b e gi n Ti m e " : 5 4 , "
en d T i me " : 55 , " sh a re a bl e " : fa l s e }]
A graphical representation of Listing 2 is given in
Fig. 6 where 15 primitive resources are included again
with a maximum number among these resources
to consume concurrently and the rest sequentially.
Some Allen’s time relations include meets between
resource-2 and resource 11, and overlaps between
resource-12 and resource-9. After completing the
identification and adjustment stages, Fig. 6:red band
indicates the availability-time interval for consuming
each resource in the final consumption flow. The de-
signer can roll the mouse over the red band to check
when the consumption of a primitive resource will ef-
fectively occur. All the consumption whether sequen-
tial or concurrent will fall into [28,100] interval. Dur-
ing this interval, several gaps like ]39,54[ and ]55, 62[
can be noticed where no consumption will happen.
Outside these gaps, other availability-time intervals
like [28, 39] and [54, 55] will correspond to consump-
tion.
Testing both scenarios was done in compliance
with unit testing in test-driven development (Beck,
2003) where for each test an output result is compared
to an expected output to verify the correctness of this
result. In conjunction with this testing, we evaluated
the creation time of a composite resource’s final con-
sumption flow (F C F ) per scenario (Table 4). This
time increases as the number of primitive resources
increases too with scenario 2 requiring more process-
ing than scenario 1.
Table 4: Creation time of a composite resource’s F C F .
F C F creation time (ms)
# of resources Scenario 1 Scenario 2
15 4 6
150 6 750
1500 80 2522
15000 10040 25540
7 CONCLUSION
This paper presented an approach for coordinating the
consumption of primitive resources subject to con-
sumption properties and time availabilities. These
properties included unlimited, limited, limited-but-
extensible, shareable, and non-shareable impacting
their assignments to user-related jobs. The assign-
ments are also dependent on time periods dictating
when a primitive resource is available for use. Multi-
ple primitive resources means multiple separate time-
availabilities that raise different coordination chal-
lenges. To tackle these challenges, Allen’s time alge-
bra was used establishing time relations between time
availabilities like overlaps, meets, and during. The
paper also presented a system demonstrating the tech-
nical doability of a time-constrained, event-driven co-
ordination of composing primitive resources. In term
of future work, we would like to examine the impact
of failures on primitive resources’ time availabilities.
Could these availabilities be adjusted when a primi-
tive resource has a limited consumption-property, for
example? Another future work is to assess the im-
pact of transactional properties like pivot, retriable,
and compensatable on primitive resources’ availabil-
ity times and hence, integration into composite re-
sources.
Time-Constrained, Event-Driven Coordination of Composite Resources’ Consumption Flows
61
Figure 6: Representation of scenario 2’s resources’ availability-time intervals.
REFERENCES
Akbarinia, R., Pacitti, E., and Valduriez, P. (2011). Best Po-
sition Algorithms for Efficient Top-k Query Process-
ing. Information Systems, 36(6).
Allen, J. (1983). Maintaining Knowledge about Temporal
Intervals. Communications of the ACM, 26(11).
Arias, M., Rojas, E., Munoz-Gama, J., and Sep
´
ulveda, M.
(2015). A Framework for Recommending Resource
Allocation based on Process Mining. In Proceedings
of the 13th International Business Process Manage-
ment Workshops held in conjunction with BPM’2015,
Innsbruck, Austria.
Baker, T., Ugljanin, E., Faci, N., Sellami, M., Maamar,
Z., and Kajan, E. (2018). Everything as a Re-
source: Foundations and Illustration through Internet-
of-Things. Computers in Industry, 94.
Beck, K. (2003). Test-driven Development - by Example.
Addison-Wesley Signature Series. Addison-Wesley.
de Weerdt, M. and Clement, B. (2009). Introduction to
Planning in Multiagent Systems. Multiagent Grid Sys-
tems, 5(4).
Dimick, D. (2014). As World’s Population Booms, Will
its Resources be Enough for Us? https://tinyurl.com/
5an3dhez.
Fielding, R. (2000). Architectural Styles and the Design
of Network-based Software Architectures. PhD thesis,
University of California, Irvine.
Hofman, W. (2015). Towards a Federated Infrastruc-
ture for the Global Data Pipeline. In Proceedings
of the 14th IFIP WG 6.11 on Open and Big Data
Management and Innovation held in conjunction with
I3E’2015, Delft,The Netherlands.
Janhunen, T. and Sioutis, M. (2019). Allen’s Interval Alge-
bra Makes the Difference. CoRR, abs/1909.01128.
Langdon, C. S. (2003). The State of Web Services. IEEE
Computer, 36(7).
Lucchim, R., Millot, M., and Elfers, C. (2008). Resource
oriented Architecture and REST: Assessment of Im-
pact and Advantage on INSPIRE. JRC Scientific and
Technical Reports EUR 23397 EN - 2008, JRC Euro-
pean Commission.
Maamar, Z. and Al Khafajiy, M. (2021). Cloud-Edge Cou-
pling to Mitigate Execution Failures. In Proceedings
of SAC’2021, South Korea (online).
Maamar, Z., Faci, N., Sakr, S., Boukhebouze, M., and Bar-
nawi, A. (2016). Network-based Social coordination
of Business Processes. Information Systems, 58.
Maamar, Z., Sellami, M., and Masmoudi, F. (2021). A
Transactional Approach to Enforce Resource Avail-
abilities: Application to the Cloud. In Proceedings
of RCIS’2021, Cyprus (online).
Maamar, Z., Yahya, F., and Benammar, L. (2022). On the
Use of Allen’s Interval Algebra in the Coordination
of Resource Consumption by Transactional Business
Processes. In Proceedings of ENASE’2022, Portu-
gal (online).
Mell, P. and Grance, T. (2011). The NIST Definition of
Cloud Computing. Technical Report 800-145, Na-
tional Institute of Standards and Technology (NIST).
Park, G. and Song, M. (2019). Prediction-based Re-
source Allocation using LSTM and Minimum Cost
and Maximum Flow Algorithm. In Proceedings of
ICPM’2019, Aachen, Germany,.
Schreiber, G. and Raimond, Y. (2014). RDF 1.1 Primer.
Technical report, World Wide Web Consortium.
Sindhgatta, R., Ghose, A. K., and Dam, H. K. (2016).
Context-aware Analysis of Past Process Executions to
Aid Resource Allocation Decisions. In Proceedings
of CAiSE’2016, Ljubljana, Slovenia.
ENASE 2023 - 18th International Conference on Evaluation of Novel Approaches to Software Engineering
62
Stefanini, A., Aloini, D., Benevento, E., Dulmin, R., and
Mininno, V. (2020). A Data-driven Methodology
for Supporting Resource Planning of Health Services.
Socio-Economic Planning Sciences, 70.
Weske, M. (2012). Business Process Management Archi-
tectures. In Business Process Management. Springer.
Zhao, W., Liu, H., Dai, W., and Ma, J. (2016). An Entropy-
based Clustering Ensemble Method to Support Re-
source Allocation in Business Process Management.
Knowledge and Information Systems, 48(2).
Zhao, W., Pu, S., and Jiang, D. (2020). A Human Resource
Allocation Method for Business Processes using Team
Faultlines. Applied Intelligence, 50(9).
Time-Constrained, Event-Driven Coordination of Composite Resources’ Consumption Flows
63