coral-erm / coral

CORAL ERM main repository
http://coral-erm.org/
Other
52 stars 64 forks source link

Workflows and the "any" problem #570

Open poacherone opened 5 years ago

poacherone commented 5 years ago

Workflows can be set-up to work with any combination of either Acquisition Type, Resource Format or Resource Type. This is in the edit window marked with a blank option (see screenshot 1 below).

Coral Any blank

On the workflow setup in Resource Admin it is marked as "any" (screenshot 2).

Coral workflow admin

The code for workflows sometimes uses the literal value "any" (or “Any”) and sometimes interprets it as no value (NULL in the database). This creates several related issues. This issue works as an umbrella issue, giving background and linking to each issue.

veggiematts commented 5 years ago

After thinking about this, here are my thoughts on this problem:

The reason we have "any" and "Any" for workflows comes from a poorly-designed way to allow to have different behaviors when a workflow is (re)started.

On one hand, we wanted to be able to leave the resource values as they were when a workflow is (re)started. That's the role of the any value (which is null, in fact). Resource Type: Book -> workflow (re)start -> Resource Type: Book

On the other hand, we wanted to be able to force the resource values back to a default setting when a workflow is (re)started. That's the role of the "Any" value (which is really a value). Resource Type: Book -> workflow (re)start -> Resource Type: Any.

If we want to keep this behavior and fix the bugs (#571 and #572) and confusion, I would suggest the following:

How does that sound?

poacherone commented 5 years ago

This sounds like a reasonable approach to us!

andyp-uk commented 4 years ago

Yes, I agree this sounds like a sensible approach.

xsong9 commented 4 years ago

For libraries who use the literal value "any" (or “Any”), for example, we have workflows with Any for acquisition type, which means the workflow applies to any acquisition types (direct order, or renewal or EBSCO order), how would Matthias' suggestion impact these workflows?

maahlen commented 4 years ago

I also agree that the suggested solution would work fine.