29 Commits

Author SHA1 Message Date
jasquat
50acac8160 some more index updates and a new migration for it w/ burnettk 2023-03-17 16:52:05 -04:00
jasquat
b6ddf3db3a added indexes to foreign key fields w/ burnettk 2023-03-17 16:26:35 -04:00
jasquat
e305b22b5a increase line length from 88 to 119 for black w/ burnettk 2023-03-15 16:24:08 -04:00
Dan
79a17ec829 Adding a new test for error handing to assure this doesn't break in the future, and cleaning up the message call event.
Will also need to update the error handling BPMN process so it provides correlation keys.  We should add a task that will
alert you when you create a message object without setting correlation keys - as they are required per the specification.
2023-03-09 15:27:35 -05:00
burnettk
d5800c5a40 lint and show version control identifier on process model show 2023-03-06 23:23:10 -05:00
Dan
bc225fcea8 Just some minor stuff:
1) Don't overwrite the message of all Workflow Task Exceptions to say "Something went wrong"
2) log errors when correlation evaluations fail (just so we are aware something isn't working correctly)
3) Dont make all evaluation fuctions require a current task context to execute -- that should be optional.
2023-03-06 17:07:04 -05:00
Dan
150b95070c run_pyl 2023-02-27 14:05:00 -05:00
Dan
e060e28c28 Needed an additional check for empty correlation keys - which on a RECEIVE message, should always match anything.
When finding messages to match a send, assure they are RECIEVE messages.

Fix some of the json output for messages sent to the front end
2023-02-27 14:01:21 -05:00
Dan
ff069cb862 run_pyl 2023-02-24 15:02:03 -05:00
Dan
0dc2bc3316 # SpiffWorkflow:
1) Type Safe checking on correlation properties (no more str())
2) A running workflows Correlations are once again at the key level.

# Backend
1) Both send and receive messages can have correlation_keys - and we compare these to each other to quickly assure a match (if they both exist - otherwise we fall back to comparing the properties on the receive to the sending messages payload)
2) Cleaned up the migrations to just one file
2023-02-24 14:53:22 -05:00
Dan
0d468a825a run_pyl (part 2) 2023-02-23 15:09:22 -05:00
Dan
0030a46938 run_pyl 2023-02-23 14:17:22 -05:00
Dan
0f3ef00d72 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
790483a421 run_pyl 2023-02-20 12:34:42 -05:00
Dan
5f6a61c93f * 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
2a800e844f * 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
8e257600af work in progress -
* Link between message instance and correlations is now a link table and many-to-many relationships as recommended by SQLAlchemy
* Use the correlation keys, not the process id when accepting api messages.
2023-02-17 10:45:01 -05:00
Dan
3c12e8ad35 Lots of adjustments from running pyl
Main change is in the ErrorDisplay.tsx to assure all error information is provided. and index.css to make it "pretty"
2023-01-19 12:36:45 -05:00
Dan
28a28e353b Removing dependency on flask-bpmn and taking it out of SpiffArena
Slightly updating the APIError code for recent updates to SpiffWorkflow's error refactoring.
2023-01-17 12:56:06 -05:00
burnettk
09e012674a upgrade black, give it the preview flag, and let it rip on long strings 2022-12-30 23:08:00 -05:00
jasquat
cee726e8b0 pyl passes 2022-12-08 13:47:30 -05:00
Dan
3a09b45765 running py_pl -- mainly reordering imports. 2022-12-05 12:29:19 -05:00
jasquat
71a277e37b some fixes for windows and python 3.9 w/ burnettk 2022-11-14 13:55:22 -05:00
jasquat
79537645ee added message correlations to message instance list api call w/ burnettk 2022-11-14 10:14:00 -05:00
burnettk
91b69e0ada pyl 2022-11-11 11:39:15 -05:00
mike cullerton
b13bfe0489 Delete groups now checks for running instances in nested models
also, pyl
2022-11-10 16:44:27 -05:00
burnettk
79718ad7c4 re-order imports the way backend always used to 2022-10-31 09:25:35 -04:00
jasquat
c63e9cf521 pyl passes w/ burnettk 2022-10-27 15:38:04 -04:00
Jon Herron
c30d6bbe1e Merge commit '883e65384f1e36a0310f4fdcff57ac486890cd5e' as 'spiffworkflow-backend' 2022-10-12 10:22:22 -04:00