[okfn-help] vdm: pending state

Martijn Faassen faassen at startifact.com
Wed Oct 20 20:47:10 BST 2010


Hi there,

On Thu, Oct 14, 2010 at 5:55 PM, Martijn Faassen <faassen at startifact.com> wrote:

> * there is way to turn the pending state into the published state,
> that knows about relations.

I've thought about this some more. I think there are two use cases for
publishing pending items:

* Let's say someone has added (pending) apples to a box, for instance
(one to many
  relationship). Publishing the box could plausibly entail also
publishing the newly added (pending) apples.

* But it might also be that you only want to publish the new box, as
you changed one of its atttributes.

I think therefore we need a simple publish that just publishes the
item (if possible), and a publish that is aware of relations and
publishes anything that is related to it using a one to many relation
(many to many I'm not sure about yet).

There is one exception where we *have* to publish the relation. If you
are to publish an apple that's in a box that's pending-insert,
then the box will have to be published. So I think when there's a many
to one relation and you're publishing a pending-insert, we have go to
all many-to-one relations and publish those as well if they are in the
pending-insert state.

Similarly with deletions we'll need to have some awareness of
relations; we can't delete the box without deleting the apples, for
instance, so it looks like deletion follows the one to many relation.
In fact, publishing an object with state pending-delete should *fail*
unless all items it refers to using a one to many relation are also in
the state pending-delete.

Regards,

Martijn



More information about the okfn-help mailing list