Commit Graph

106 Commits

Author SHA1 Message Date
 Ján Mikláš
f71935f137 Add translator comments to automation steps and subjects
[MAILPOET-5729]
2023-11-24 08:10:35 +02:00
David Remer
221e496714 Add comment
[PREMIUM-248]
2023-10-30 21:22:23 +01:00
David Remer
dd103b81d7 Catch exceptions when trying to match filters in trigger handler
[PREMIUM-248]
2023-10-30 21:22:23 +01:00
David Remer
53f3a5d001 Allow to return null in SubjectTransformer::transform()
Sometimes a transformer can't return a subject. In this case transform() will return null
instead of throwing an exception. This means an automation can run until it comes to a
step where the subject would be needed. There it would fail.

[PREMIUM-248]
2023-10-30 21:22:23 +01:00
Jan Jakes
f55c4f7755 Make next step ID nullable (ability to save multiple edges without next steps)
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
32e5d4f8ac Add check that next step was scheduled when multiple next steps are possible
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
72ce5fb569 Add a possibility to schedule next step by index
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
David Remer
a464df2831 Ensure WP_DEBUG is cast to a boolean value
[MAILPOET-5608]
2023-09-26 13:26:22 +02:00
David Remer
2ea9a69a40 Make method public
[MAILPOET-5516]
2023-09-25 07:11:43 -07:00
Jan Jakes
944b440bdf Rethrow integration log exceptions in debug mode
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
Jan Jakes
864cc2b01d Add run number to logs
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
Jan Jakes
ef97e4d05a Add logging for automation triggers
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
Jan Jakes
a13dc71cd0 Log step key data
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
Jan Jakes
370f4ee3ae Add step type, step key, and updated timestamp to run logs
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
Jan Jakes
dd881d8b33 Extract logging logic to a service, make logs mutable
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
Jan Jakes
43c396220b Move all of step handler args checks to top-level handler, improve readability
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
Jan Jakes
9cd871c32e Remove unused step runner interface
[MAILPOET-5568]
2023-09-20 02:36:40 -07:00
Jan Jakes
e5550ffead Add the possibility to schedule another run of the same step (progress)
[MAILPOET-5569]
2023-09-20 02:36:40 -07:00
Jan Jakes
eeb4d64e8b Pass step run controller to automation actions
[MAILPOET-5569]
2023-09-20 02:36:40 -07:00
Jan Jakes
9d4f55b399 Add step run controller to allow actions control their flow
[MAILPOET-5569]
2023-09-20 02:36:40 -07:00
Jan Jakes
5f088d2c35 Add step run number to step run args
[MAILPOET-5569]
2023-09-20 02:36:40 -07:00
Jan Jakes
e3da509f70 Move automation completion to step scheduler
[MAILPOET-5569]
2023-09-20 02:36:40 -07:00
Jan Jakes
b7ef250511 Refactor next step scheduling to a StepScheduler service
[MAILPOET-5569]
2023-09-20 02:36:40 -07:00
Jan Jakes
d04baaee4f Sort subject keys that are used to render field groups
[MAILPOET-5169]
2023-06-19 11:06:23 +02:00
David Remer
8d5e9bd951 Get all subjectEntries into the StepArgs, not just the required ones
[MAILPOET-4934]
2023-05-15 08:19:19 +02:00
Jan Jakes
b45e105cb4 Evaluate global filter operator
[MAILPOET-5218]
2023-05-04 14:34:11 +02:00
Jan Jakes
c40cb47928 Evaluate filter group operators (and/or)
[MAILPOET-5218]
2023-05-04 14:34:11 +02:00
Jan Jakes
34ca96d007 Introduce filters data type and filter groups to enable saving and/or filter combinations
[MAILPOET-5257]
2023-04-24 10:42:28 +02:00
Jan Jakes
abe44ca9f8 Implement filter handler to apply filters on field values during automation run
[MAILPOET-4946]
2023-04-20 16:32:32 +02:00
Jan Jakes
7f9faf1d99 Use automation WP helpers
[MAILPOET-4946]
2023-04-20 16:32:32 +02:00
Jan Jakes
ae828b9ac4 Do not load all possible subjects eagerly
With subject transformers the amount of possible subjects will grow,
and preloading even those that won't be used may result in performance
issues, and unnecessary errors (e.g., caused by 3rd party transformers).

[MAILPOET-4946]
2023-04-20 16:32:32 +02:00
Jan Jakes
54f5addca9 Extract subject loading before automation processing loop
[MAILPOET-4946]
2023-04-20 16:32:32 +02:00
Jan Jakes
70dbfc28b7 Early return when no active automation matches given trigger
[MAILPOET-4946]
2023-04-20 16:32:32 +02:00
David Remer
328b5b1475 Remove private getSubjectKeysForSingleKey method
[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
e2777aebc3 Use plural for array of subject transformers
[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
19b5abc171 Use array_keys $all to get the keys
[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
d6760cb113 Use array
[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
8cf48d2707 Simplify SubjectTransformer
[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
68f09b6bd1 Prevent infinite loop when a subject from the trigger is missing
Given the trigger provides two subjects but only one subject was given via parameter and no
transformer was able to generate the second from the first, this method runs into an
infinite loop. This commit prevents this infinite loop.

[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
b5a846327a Remove SubjectTransformerHandler from StepHandler
All subjects are created and persisted during AutomationRun creation. Therefore, the required
subject must exist when searching for it in the StepHandler. This commit reverses the last
changes and updates the test.

[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
d365be2334 Persist all possible subject on run creation
[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
c968b03ca7 Provide all possible subjects for a trigger to the UI
[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
5328213d85 Introduce subject transformation
[MAILPOET-4935]
2023-03-30 12:21:25 +02:00
David Remer
48e2c5f945 Add filter to decide whether an automation run should be created
[MAILPOET-4966]
2023-03-01 16:14:38 +01:00
David Remer
b25f2cd5f4 Enable a Trigger to activate a second automation
[MAILPOET-4842]
2022-11-28 13:03:06 +01:00
Jan Jakes
9063dc3079 Remove duplicities in naming
[MAILPOET-4793]
2022-11-14 12:14:35 +02:00
Jan Jakes
9d55d3f134 Use "automation" instead of "workflow"
[MAILPOET-4793]
2022-11-14 12:14:35 +02:00
Jan Jakes
f825e535e3 Save next step in trigger handler
[MAILPOET-4787]
2022-11-08 22:55:57 +02:00
Jan Jakes
c6d3573652 Save next step ID to workflow runs
[MAILPOET-4787]
2022-11-08 22:55:57 +02:00
Jan Jakes
af1e09f46f Remove "inactive" status for now, use "draft" instead
[MAILPOET-4757]
2022-11-07 11:17:36 +02:00