Commit Graph

61 Commits

Author SHA1 Message Date
Dan 8c673c4fb6 BPMN.io -- Just show the message names not the ids - to assure we are only exposing the names.
SpiffWorkflow -
    - start_messages function should return message names, not ids.
    - don't catch external thrown messages within the same workflow process
    - add an expected value to the Correlation Property Model so we can use this well defined class as an external communication tool (rather than building an arbitrary dictionary)
    - Added a "get_awaiting_correlations" to an event, so we can get a list of the correlation properties related to the workflows currently defined correlation values.
    - workflows.waiting_events() function now returns the above awaiting correlations as the value on returned message events
 Backend
    - Dropping MessageModel and MessageCorrelationProperties - at least for now.  We don't need them to send / receive messages though we may eventually want to track the messages and correlations defined across the system - these things (which are ever changing) should not be directly connected to the Messages which may be in flux - and the cross relationships between the tables could cause unexpected and unceissary errors.  Commented out the caching logic so we can turn this back on later.
    - Slight improvement to API Errors
    - MessageInstances are no longer in a many-to-many relationship with Correlations - Each message instance has a unique set of message correlations specific to the instance.
    - Message Instances have users, and can be linked through a "counterpart_id" so you can see what send is connected to what recieve.
    - Message Correlations are connected to  recieving message instances.  It is not to a process instance, and not to a message model.  They now include the expected value and retrieval expression required to validate an incoming message.
    - A process instance is not connected to message correlations.
    - Message Instances are not always tied to a process instance (for example, a Send Message from an API)
    - API calls to create a message use the same logic as all other message catching code.
    - Make use of the new waiting_events() method to check for any new recieve messages in the workflow (much easier than
    churning through all of the tasks)
    - One giant mother of a migration.
2023-02-23 13:53:03 -05:00
Dan 5171e53240 * SpiffWorkflow event_definitions wanted to return a message event's correlation properties mested within correlation keys. But messages are directly related to properties, not to keys - and it forced a number of conversions that made for tricky code. So Messages now contain a dictionary of correlation properties only.
* SpiffWorkflow did not serialize correlations - so they were lost between save and retrieve.

* When comparing Correlation Property values - we are storing these values as strings in the database and can't convert them back to integers later, so I'm changing everying everywhere to compare after conversion to a string.  Don't feel great about this one.
* By using an SQL Alchemy join table, there is a lot of db queries we don't need to write.
* A few handy fucntions on db models to make it easier to work with correlations.
* Updated tests because I changed some of the BPMN models we were testing against.
* Database migration to use the new constraint names with the alternate form of the join table between correlation mesages to instance messages.
2023-02-20 11:50:35 -05:00
Dan 28ac9ef872 * Re-work message tests so I could wrap my simple head around what was happening - just needed an example that made sense to me.
* Clear out complex get_message_instance_receive how that many-to-many works.
* Create decent error messages when correlations fail
* Move correlation checks into the MessageInstance class
* The APIError could bomb out ugly if it hit a workflow exception with not Task Spec.
2023-02-18 13:09:58 -05:00
Dan 5f9ba556d1 Merge commit '35fd8ffc0f9c1bf9cbd346464419b6387cb5d4e9' into feature/message_fixes 2023-02-18 10:32:56 -05:00
Dan 35fd8ffc0f Squashed 'SpiffWorkflow/' changes from 11e4b4f96..b439f69f2
b439f69f2 Merge pull request #296 from sartography/bugfix/subprocess-access-to-data-objects
6d2a2031e update spiff subworkflow tasks too
992c38671 make data objects referenceable within subprocesses
6c8ff5cdf allow subprocesses & call activities to have different data copy policies
2b14f3a48 initialize subprocesses in _update_hook instead of _on_ready_before
791f335d5 Merge pull request #295 from sartography/improvement/remove-camunda-from-base-and-misc-cleanup
28b579beb remove a few unused, duplicative, and debugging methods
8f14d1098 remove some other unused diagrams and tests
408bc6734 rely on top level camunda parser for almost all namespace references
895b2cc9b remove camunda namespace from base bpmn parser
76ecbf7cc Merge pull request #294 from sartography/bugfix/reactivate-boundary-event
82b6c8ad4 hack to ensure timers (and other events) are reset if returned to via loop reset
590903f47 Merge pull request #292 from sartography/feature/multiinstance-refactor
537490043 fix bug & typo
f31726db1 raise error on attempting to migrate workflows with MI
44e6d08d8 create spiff multiinstance task
2168c022b create camunda MI that approximates what it used to do
9894cea59 some improvements and bugfixes
f857ad5d4 remove some now unused functionality & tests, create a few more tests
6fead9d04 updated serializer & fixes for most tests
ec662ecdd add parallel multiinstance
bd19b2a8a working sequential multiinstance
2f9c192b6 further cleanup around _update_hook
947792bf6 fix bug in exclusive gateway migration
d3d87b28d add io spec to all tasks
f1586e275 add support for standard loop tasks

git-subtree-dir: SpiffWorkflow
git-subtree-split: b439f69f23b547df4de1e8e0c636997f2fd4e33b
2023-02-18 10:32:56 -05:00
Dan 05e226fcab Squashed 'SpiffWorkflow/' changes from 0e61be85c..11e4b4f96
11e4b4f96 fix two incorrectly names attributes in node parser
abec918a8 Merge pull request #291 from rachfop/fix-grammar
a597f9ce9 Fixes grammar, typos, and spellings
00ffaf067 Assure that when something goes wrong calling a service task that we get as much good information about the problem as possible.
c044b5646 Fix that dreadful unknown "KeyError" exception that was cropping up. Adding a bit of detail to the spiffworkflow exceptions when a duplicate process model is found. Disable the submit button on tasks after you click submit (avoid the double click and give users a better experience)

git-subtree-dir: SpiffWorkflow
git-subtree-split: 11e4b4f96f03a036bd29632f1560e347a4e69aae
2023-02-14 16:51:09 -05:00
Dan 929d04af5f Merge commit '05e226fcabf9bbe6d9ca9816cd2df827926b619a' into main 2023-02-14 16:51:09 -05:00
Dan d97fcfd238 Assure that when something goes wrong calling a service task that we get as much good information about the problem as possible. 2023-02-08 11:53:20 -05:00
Dan d010c2bce6 Fix that dreadful unknown "KeyError" exception that was cropping up.
Adding a bit of detail to the spiffworkflow exceptions when a duplicate process model is found.
Disable the submit button on tasks after you click submit (avoid the double click and give users a better experience)
2023-02-03 17:01:03 -05:00
burnettk 02855719b8 Squashed 'SpiffWorkflow/' changes from 98c6294f..0e61be85
0e61be85 Merge pull request #289 from sartography/improvement/execution-and-serialization-cleanup
527684da fix some typos in the class & method docs
0dff44a4 Merge branch 'main' into improvement/execution-and-serialization-cleanup
64737498 Allow for other PythonScriptEngine environments besides task data (#288)
dd63e916 remove some unused tests & diagrams
24aae519 clean up various small stuff
3b2dc35d use context when opening files for parsing
69eec3eb update class/method docs
24528dfb move all spec conversion classes to top level
5af33b11 remove some unused methods related to old serializer
931b90fb reorganize serializer
4e81ed29 consolidate pointless serializer classes
d62acf02 change task_spec._update_hook to return a boolean indicating whether the task is ready

git-subtree-dir: SpiffWorkflow
git-subtree-split: 0e61be85c47474a33037e6f398e64c96e02f13ad
2023-02-02 20:59:28 -05:00
burnettk 4a9f4eb9db Merge commit '02855719b8100969a395d0acf7f2537a8c69646a' 2023-02-02 20:59:28 -05:00
Dan ba67d7ad34 Squashed 'SpiffWorkflow/' changes from 450ef3bcd..98c6294f1
98c6294f1 Merge pull request #287 from sartography/feature/workflow_data_exceptions
d40a1da59 Workflow Data Exceptions were broken in the previous error refactor.  This assures we are getting good messages from these errors.
a156378e1 Merge pull request #286 from sartography/feature/inclusive-gateway-support
7f6e398c2 bypass unnecessary checks in gateway joins
ade21a894 revert a few things
e1cf75202 Merge branch 'main' into feature/inclusive-gateway-support
15a0a4414 revert change to MultiChoice and handle no defaults in BPMN specs
e1469e6bb add support for diverging inclusive gateways
71fd86386 really prevent non-default flows without conditions
924759d9b clean up join specs
7378639d3 Merge pull request #284 from sartography/feature/improved-timer-events
dc8d139d2 remove useless method
530f23697 Merge branch 'main' into feature/improved-timer-events
307cca9c5 partially clean up existing gateways
0a344285e clean up task parsers
2cef997d1 add waiting_events method to bpmn workflow
48091c407 serializer migration script and miscellaneous fixes to serialization
61316854b store internal timer data as string/float
389c14c4c add some tests for parsing durations
582bc9482 convert timers to iso 8601
6dfd7ebe9 remove extraneous calls to update
6bd429529 clean up tests
d56e9912f remove useless method

git-subtree-dir: SpiffWorkflow
git-subtree-split: 98c6294f1240aee599cd98bcee58d121cb57b331
2023-01-26 18:17:35 -05:00
Dan b2e44a3ef2 Merge commit 'ba67d7ad342481231aa5e11508e033f74e86d61f' into main 2023-01-26 18:17:35 -05:00
jasquat eedac61165 Squashed 'SpiffWorkflow/' changes from 1f51db962..450ef3bcd
450ef3bcd Merge pull request #105 from sartography/feature/avoid_logs_when_call_activity_waiting
58468a489 do not write set data logs at all since they are redundant w/ burnettk
0eeccaf1c do not write to logs when a task is inheriting data from the parent w/ burnettk

git-subtree-dir: SpiffWorkflow
git-subtree-split: 450ef3bcd639b6bc1c115fbe35bf3f93946cb0c7
2023-01-19 13:44:52 -05:00
jasquat 46c7e25494
Merge pull request #105 from sartography/feature/avoid_logs_when_call_activity_waiting
do not write to logs when a task is inheriting data from the parent w…
2023-01-19 11:08:51 -05:00
jasquat 35ef5cbe54 Squashed 'SpiffWorkflow/' changes from 4195453a4..1f51db962
1f51db962 Merge pull request #283 from sartography/feature/better_errors
69fb4967e Patching up some bugs and logical disconnects as I test out the errors.
cf5be0096 * Making a few more things consistent in the error messages -- so there isn't filename for validation errors, and file_name for WorkflowExceptions.  Same for line_number vs sourceline. * Assure than an error_type is consistently set on exceptions. * ValidationExceptions should not bild up a detailed error message that replicates information available within it.
440ee16c8 Responding to some excellent suggestions from Elizabeth:
655e415e1 Merge pull request #282 from subhakarks/fix-workfowspec-dump
1f6d3cf4e Explain that the error happened in a pre-script or post script.
8119abd14 Added a top level SpiffWorklowException that all exceptions inherit from.  Aside from a message string you can append information to these exceptions with "add_note", which is a new method that all exceptions have starting in python 3.11 Switched arguments to the WorkflowException, WorkflowTaskException - which now always takes a string message as the first argument, and named arguments thereafter to be consistent with all other error messages in Python. Consistently raise ValidationExceptions whenever we encounter an error anywhere during parsing of xml. The BPMN/WorkflowTaskExecException is removed, in favor of just calling a WorkflowTaskException.  There is nothing BPMN Specific in the logic, so no need for this. Consolidated error message logic so that things like "Did you mean" just get added by default if possible.  So we don't have to separately deal with that logic each time. Better Error messages for DMN (include row number as a part of the error information)
13463b5c5 fix for workflowspec dump
be26100bc Merge pull request #280 from sartography/feature/remove-unused-bpmn-attributes-and-methods
23a5c1d70 remove 'entering_* methods
4e5875ec8 remove sequence flow
5eed83ab1 Merge pull request #278 from sartography/feature/remove-old-serializer
614f1c68a remove compact serializer and references
e7e410d4a remove old serializer and references

git-subtree-dir: SpiffWorkflow
git-subtree-split: 1f51db962ccaed5810f5d0f7d76a932f056430ab
2023-01-19 10:47:07 -05:00
jasquat 09e5bf3182 Merge commit '35ef5cbe54a18fc177ab2593001d76ab1412c382' 2023-01-19 10:47:07 -05:00
jasquat 978f5f2180 do not write set data logs at all since they are redundant w/ burnettk 2023-01-18 17:03:55 -05:00
jasquat 8fa5866f94 do not write to logs when a task is inheriting data from the parent w/ burnettk 2023-01-17 12:23:51 -05:00
jasquat 3ff98fb51e Squashed 'SpiffWorkflow/' changes from 5664815a2..4195453a4
4195453a4 Merge commit 'b55571406634555736fc471e7a53ca8b22288980'
0629dcb9a added fix to SpiffWorkflow to deepcopy operation params before evaluating them w/ burnettk

git-subtree-dir: SpiffWorkflow
git-subtree-split: 4195453a46638f23e87c3ffdb038717c2d8abd00
2023-01-05 17:35:20 -05:00
jasquat b555714066 Squashed 'SpiffWorkflow/' changes from 80640024a..5664815a2
5664815a2 Merge pull request #277 from sartography/bugfix/update-serializer-version
893ae8334 Merge branch 'main' of github.com:sartography/SpiffWorkflow into main
40a5f3412 add link to Spiffworkflow.org
38ce694ee update serializer version

git-subtree-dir: SpiffWorkflow
git-subtree-split: 5664815a2e61cd334f35136d2d7ac8856a95a28c
2023-01-05 17:33:33 -05:00
jasquat ff71cba092 Merge commit 'b55571406634555736fc471e7a53ca8b22288980' 2023-01-05 17:33:33 -05:00
jasquat 23a93d8155 added fix to SpiffWorkflow to deepcopy operation params before evaluating them w/ burnettk 2023-01-05 17:29:28 -05:00
burnettk 7280cc5ea5 Squashed 'SpiffWorkflow/' changes from 5c4592801..80640024a
80640024a Merge pull request #275 from sartography/bugfix/data-object-error
71a377981 prevent output associations from being removed twice

git-subtree-dir: SpiffWorkflow
git-subtree-split: 80640024a8030481645f0c34f34c57e88f7b4f0c
2023-01-04 08:28:48 -05:00
burnettk 7ee913d7a5 Merge commit '7280cc5ea5663c2f2984a247550c34f4ae759897' 2023-01-04 08:28:48 -05:00
jasquat 268d717a1a Merge commit '2505de702716bbe5a8777928d01a780872987343' 2022-12-27 13:53:09 -05:00
jasquat df6e065606 Squashed 'SpiffWorkflow/' changes from ffb16867..841bd630
841bd630 Merge pull request #273 from sartography/bugfix/catch-timers-in-event-gateways
103c70d0 hacks to handle timer events like regular events

git-subtree-dir: SpiffWorkflow
git-subtree-split: 841bd63017bb1d92858456393f144b4e5b23c994
2022-12-16 13:23:00 -05:00
jasquat 768a8ebeb6 Merge commit 'df6e065606b6b5b930754697f3332c4daebb4c9e' 2022-12-16 13:23:00 -05:00
burnettk 71a2a3ec0e Squashed 'SpiffWorkflow/' changes from 46d3de27f..ffb168675
ffb168675 Option to run tests in parallel (#271)
062eaf15d another hot match -- assure hit policy is correctly passed through.
c79ee8407 Quick patch the DMN hit policy to fix a dump mistake.
36dd1b23a Fix ResourceWarning: unclosed file BpmnParser.py:60 (#270)
bba7ddf54 Merge pull request #268 from sartography/feature/multiple-event-definition
8cf770985 remove unused import
9d31e035e make multiple throw events work with start events
890c4b921 add throw support for multiple events
c1fc55660 add support for catching parallel multiple event definitions
511830b67 add event based gateway
56bd858dc add event type for multiple events

git-subtree-dir: SpiffWorkflow
git-subtree-split: ffb1686757f944065580dd2db8def73d6c1f0134
2022-12-10 23:39:00 -05:00
burnettk 6152bdc062 Merge commit '71a2a3ec0efb6384f15b2ca6a956ab80c926e164' 2022-12-10 23:39:00 -05:00
Dan cc1903387b Squashed 'SpiffWorkflow/' changes from 46f410a28..46d3de27f
46d3de27f Merge pull request #267 from sartography/feature/dmn_collect_policy
2d5ca32d5 Support for the "COLLECT" hit policy. * DecisionTable constructor now expects a third argument (the HitPolicy) * DMNParser now checks for a hitPolicy attribute, but defaults ot "UNIQUE" as Camunda doesn't put another in there if Unique is selected. * DecisionTable deserializer will default to a hitPolicy of "UNIQUE" if not value is in the Json.

git-subtree-dir: SpiffWorkflow
git-subtree-split: 46d3de27ffbcaf60025f09d1cf04fcc7ee98658a
2022-11-25 11:07:31 -05:00
Dan 0963102a88 Merge commit 'cc1903387bf02a9d0ee847e31ce568f759b06a0c' into main 2022-11-25 11:07:31 -05:00
burnettk d2af3e7252 Squashed 'SpiffWorkflow/' changes from cd4da465e..46f410a28
46f410a28 Merge pull request #265 from sartography/bugfix/spiff-script-errors
ffe07df7b correct xpath for extensions

git-subtree-dir: SpiffWorkflow
git-subtree-split: 46f410a2852baeedc8f9ac5165347ce6d4470594
2022-11-20 19:48:29 -05:00
burnettk c0feaa9b6a Merge commit 'd2af3e72523b5c26f1b4f031d6aff018bb451eee' 2022-11-20 19:48:29 -05:00
burnettk 37b7f3d7cd Squashed 'SpiffWorkflow/' changes from 580939cc..cd4da465
cd4da465 Merge pull request #264 from sartography/bugfix/dmn-equality-with-boolean
414a59eb disambiguate DMN expressions
eea53c91 Merge pull request #263 from sartography/feature/cleanup-task-completion
d248d5b1 execute postscript before other complete hook tasks
c09f1a90 streamline predict & remove some duplicated calls to it
64c21791 remove duplicate calls to update
4ca1076d move task update to _on_complete to ensure data is copied consistently after task related activities are done
d037a7eb small changes for readability
025bc30f Quick patch -- is_executable needs to be accurate immediately.
14d3d8c3 Merge pull request #262 from sartography/feature/parser_info_features
849c223e We are jumping through a lot of complex xml parsing in SpiffWorkflow-Backend because we need to know some basic information about a BPMN process at the moment it is saved.  Rather than do that work in the backend, it seems better to have SpiffWorkflow handle parsing the xml and providing a bit of metadata, including:

git-subtree-dir: SpiffWorkflow
git-subtree-split: cd4da465e125ca1ae1b57d227bfa324d9d4c507c
2022-11-18 10:03:32 -05:00
burnettk a7a6e18f78 Merge commit '37b7f3d7cdc8ee787c9ddacfc7a258adb70330c1' 2022-11-18 10:03:32 -05:00
jasquat 9460969fb9 Merge commit 'cc24e8685b4a965955e9ce2fdd9d55fed6d360fc' 2022-11-09 15:02:17 -05:00
jbirddog 4a852a5b3b
Move to Python 3.11 (#27) 2022-11-09 13:45:16 -05:00
burnettk 7ac4b51c6a Squashed 'SpiffWorkflow/' changes from a6392d1906..8d820dce1f
8d820dce1f Track spiff step details more granularly (#17)
426da26d8f Clear the remaining __init__.py imports in SpiffWorkflow (#14)
9a1d1c484a Fix FutureWarning in SpiffWorkflow (#16)

git-subtree-dir: SpiffWorkflow
git-subtree-split: 8d820dce1f439bb76bc07e39629832d998d6f634
2022-11-04 09:33:42 -04:00
jbirddog a8e904c6b8
Track spiff step details more granularly (#17) 2022-11-03 15:07:46 -04:00
jbirddog 55cb9f4fd0
Clear the remaining __init__.py imports in SpiffWorkflow (#14) 2022-11-03 11:12:00 -04:00
jbirddog 04172f2c10
Fix FutureWarning in SpiffWorkflow (#16) 2022-11-03 11:11:32 -04:00
burnettk c3cdca16b8 Squashed 'SpiffWorkflow/' changes from 5cdb881ed..a6392d190
a6392d190 SpiffWorkflow cold start improvements (#13)

git-subtree-dir: SpiffWorkflow
git-subtree-split: a6392d19061f623394f5705fb78af23673d3940d
2022-11-02 12:19:52 -04:00
jbirddog fdec3e1e12
SpiffWorkflow cold start improvements (#13) 2022-11-02 11:35:10 -04:00
burnettk f82f4c2582 Squashed 'SpiffWorkflow/' changes from 3579c477e..2d3bd0085
2d3bd0085 Merge pull request #261 from sartography/feature/xml-validation
a67abd453 Merge pull request #260 from sartography/feature/add_init_to_schema
905c1265d remove debug code w/ burnettk
8daf322da attempt using package data w/ burnettk
7f7c0c10b add an init file to schema directory to see if it can be picked up as a package w/ burnettk
abb2898b1 cleaning up code smell

git-subtree-dir: SpiffWorkflow
git-subtree-split: 2d3bd00854ab483e823c4b386430abc9267f536b
2022-10-27 15:15:03 -04:00
burnettk 8712ce0ad2 Merge commit 'f82f4c25827cd04b22c3c9ca8948653f8b79b9e5' 2022-10-27 15:15:03 -04:00
Dan 7184b165bb Squashed 'SpiffWorkflow/' changes from d27519a36..3579c477e
3579c477e use last task data instead of subworkflow data on subworkflow complete

git-subtree-dir: SpiffWorkflow
git-subtree-split: 3579c477eaf19a982a2822609fcf20b56c050eb5
2022-10-27 14:57:23 -04:00
Dan 38a2c8c5e5 Merge commit '7184b165bb6e9e229e4abf4fe1fe445e8aa08519' into main 2022-10-27 14:57:23 -04:00
jasquat 742f549e98 Squashed 'SpiffWorkflow/' changes from 12f81480a..d27519a36
d27519a36 Merge pull request #259 from sartography/bugfix/spiff-postscript-execution
21aa8a12c update execution order for postscripts
d83fd3d81 Merge pull request #256 from sartography/feature/xml-validation
8303aaab5 uping the sleep time in a test slightly to see if we can get this test to pass consistently in CI.
1d251d55d determine whether to validate by passing in a validator instead of a parameter
2d3daad2d add spiff schema
f8c65dc60 Minor changes to BPMN diagrams to assure all tests are run against valid BPMN Diagrams. Changes required:
9e06b25bf add DMN validation
1b7cbeba0 set parser to validate by default
53fdbba52 add schemas & validation option
a212d9c5d general cleanup

git-subtree-dir: SpiffWorkflow
git-subtree-split: d27519a3631b9772094e5f24dba2f478b0c47135
2022-10-27 10:50:48 -04:00
jasquat 5a63a1a5eb Merge commit '742f549e98188c1435f91be2b65fffa3542bb331' 2022-10-27 10:50:48 -04:00