Workflow-only field validation

Hello,

Does anyone know of a way to impose different rules when transitioning an item through its workflow than when creating the item?

We’d like to set width limits on image files uploaded in our image content type. But if we change the limit in the future, any existing images that breaks the new limit will be blocked from being transitioned. Is there some extension or condition that will return true when an item is being transitioned between workflow states, which we could use to override the Number Range validation on the image width field, using an OR boolean?

Thanks,

Andrew.

Andrew,

As we point out in the Rhythmyx Technical Reference Manual (see p. 20), Field Validations run when the Content Item is submitted to the Repository (i.e., when you save it or update it). Item Validations run on Workflow Transitions.

The problem you are concerned with should not happen on Transition. It would occur when you save modifications to the Content Items.

I don’t see an option that would get around the problem you cite. Why do you anticipate making this change?

RLJII

I think I get it now. When we transition an item, it does sometimes complain about fields. But, checking again now, those seem to all be because the Required checkbox has been ticked for those fields. It doesn’t do Field Validations, in the strict sense as defined on p20, upon workflow transitions. But it does validate fields to ensure the required ones are filled. Is that correct?

If so, that solves that, thank you. But we would potentially like to take it even further, and skip the validation of image widths if the item is being modified (i.e. only apply a field validation rule when creating new items.) Obviously, some people might want their users to be forced to resize images and upload them again, whenever they change their web site design, or their policies on image dimensions. This would be quite sensible if their Rhythmyx system is used by a small team of “web professionals.” But we plan to allow anyone in our organisation (hundreds of people) to create and edit certain content types. One of these is the image content type. So we’d rather have the option to let existing images that break the new rules on their dimensions pass (and handle them in the templates.) Especially as, if a particular content item also fails one of the above mentioned Required field checks, or an item validation rule, they will be forced to edit it before they can transition it, and therefore will have to abide by the new field validation rules as well.

Thanks,

Andrew.

Andrew,

In case it helps you (and it may not), I implemented a new Item Validation extension recently. It validates that certain fields are non-empty (meaning that there must by some value in them) when entering any one of a defined list of workflow states. This should allow you to make a field required, but only during certain parts of the workflow.

This is available in recent builds of the PSOToolkit (which you can download from the “code” forum).

One added caveat you probably need to be aware of: Item Validations are not run when the item is transitioning OUT of a Public workflow state. This is to prevent the case where an item is in Public state and something changes that makes it no longer valid (e.g. a date range, or the related items that were in a slot have now been deleted, etc). If the item validations were enforced, you could never edit such an item, as you could not transition it to Quick Edit state.

Dave

That extension does sound useful. Maybe not exactly what we want in this specific scenario, but could help. Thanks.

Add a prerequisite to the field validation of single html param sys_contentid is null. (There is a button at the top of the Field Validation dialog.) I believe this will accomplish what you want.

Thanks Paul. That was exactly the idea that occurred to me on my way home last night. I’ll try it later today.