Skip to content

Implement macros for event log creation#33

Merged
aarkue merged 11 commits intoaarkue:mainfrom
cpitsch:feat/event-log-macros
Aug 13, 2025
Merged

Implement macros for event log creation#33
aarkue merged 11 commits intoaarkue:mainfrom
cpitsch:feat/event-log-macros

Conversation

@cpitsch
Copy link
Copy Markdown
Collaborator

@cpitsch cpitsch commented Jul 31, 2025

  • Implement From<_> for AttributeValue
  • Re-export chrono
  • Add macros for event log creation. For instance:
attribute!("concept:name" => "Approve");
attributes!(
    "concept:name" => "Approve",
    "time:timestamp" => chrono::Utc::now()
);

event!("a");
event!("b"; {"org:resource" => "John"});

trace!("a", "b", "c", "d");
trace!(
    {"outcome" => "approved"};
    "a"; {"time:timestamp" => chrono::Utc::now()}, "b", "c", "d"
);

event_log!(
    ["a", "b", "c", "d"],
    ["a", "c", "b", "d"],
);
event_log!(
    {"created_at" => chrono::Utc::now()};
    ["a", "b", "c", "d"] {"approved" => true},
    ["a", "c"; {"org:resource" => "John"}, "b", "d"],
);

cpitsch added 4 commits July 31, 2025 12:45
`From<Vec<Attribute>>` is ambiguous since it _could_ be interpreted as a List or
Container. Currently, a List is assumed.
`attribute`, `attributes`, `event`, `trace`, `log`,
Since without the semicolon, a `[` would follow a `{`, there is no
reason to require a semicolon.
For now, this has been made optional, but all examples still use a
semicolon
@cpitsch cpitsch requested a review from VikiPeeva August 5, 2025 10:10
Comment thread process_mining/src/event_log/macros.rs
Comment thread process_mining/src/event_log/macros.rs
Comment thread process_mining/src/event_log/macros.rs Outdated
Comment thread process_mining/src/event_log/macros.rs
Comment thread process_mining/src/event_log/macros.rs
Comment thread process_mining/src/event_log/macros.rs
Comment thread process_mining/src/event_log/macros.rs
Comment thread process_mining/src/event_log/macros.rs
Comment thread process_mining/src/event_log/macros.rs
Comment thread process_mining/src/event_log/macros.rs Outdated
Comment thread process_mining/src/event_log/macros.rs
trace ids and manual, integer, trace ids

For instance, the invocation `event_log!(["a"], ["b"] {"concept:name" =>
0})` has two traces with trace id `0`.
@aarkue aarkue merged commit bca9c55 into aarkue:main Aug 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants