Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Captain
Captain
431 views

Filter fun with packages

We have quite a few drivers where the functionality is split across a base package and several alternative "flavour" packages that allow to process students, employees, teaching staff etc. differently upon a common code base.

This used to work for years, but with one of our drivers I've found the filter resource of the flavour package not being applied to the finished driver in our _production_ system. Everything went fine in our development system, but after building the packages involved and importing them into our production environment, the driver's filter ended up with the base package's filter definitions only. No matter, whether we upgraded the driver from an earlier package version or installed a new test driver from scratch: the feature package filters were never taken into account, contrary to what was seen in our development system. And yes, the filter resource was present in the package imported into prod and it was of the correct type.

After performing numerous boring tests and trials to no avail, I consulted the forum today and came across Mr. Reibenweins interesting report "Filter resources from packages are not installed on drivers".

To make it short: temporary enabling package developer mode did the trick still in 2021! The reason to create a new post is Mr. Reinweins findings have been observed quite some time ago and I wonder, if any official documentation on that behaviour has been produced since then or if other members have made similiar observations.

I'm not sure, if package developer mode is the only remedy. I'm not aware of having enabled developer mode in our production system ever before. Nevertheless older packages developed and imported in the same way, did not lack filter definitions from additionally installed packages. The filter resources never show up in Designer's outline view, but the resulting driver filter contained _all_ filter definitions. It would be desirable to find the underlying reason and a reproducable procedure to deal with this, though.

So if there are any news since 2012 I'd be interested to learn more.

Axel

PS: Designer 4.8.2, OS X

Labels (1)
7 Replies
Knowledge Partner Knowledge Partner
Knowledge Partner

Designer recently gained a new feature for this: "Revert Customizations" on the filter. Right-click and enjoy... to some extent.

In my experience this does actually rebuild the filter from all filter resources, but: it does so differently than what "Sync to Package" does when you develop a package. The order of the classes and attribute nodes in the filter XML is often mixed up, so when you compare to the live system, the whole filter is different and it's hard to see the actual changes. Running "Revert customizations" a second time sometimes seems to fix this, or a "Sync to package" on the filter resource(s). I usually try one, run live-compare and see if it helped, if not try the other one. Not sure if this happens in developer mode and with yet unreleased packages only or may show up in production trees as well.

A little disappointing that this long missed feature when it finally has been implemented just gives you another quirk to work around every other day...

______________________________________________
https://www.is4it.de/identity-access-management
Knowledge Partner Knowledge Partner
Knowledge Partner

I am not sure why Package Developer mode would make a difference. That is interesting.  (I happen to always run with it on, so I probably never noticed this).

 

I would note that Filters are very finicky. If the checksum of the filter is different than the packages think (manual edits, even simple changes) Designer will sometimes not update it.  In which case, the simplest fix is delete the contents of the filter.  And paste in the filter, that a blank driver, with those packages (Usually in afake IDV, make a new driver, with all the packages and get the filter to copy). 

In some ways this is what Lothar suggested with the Revert changes in new Designer. 

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner


@AS78 wrote:

Everything went fine in our development system, but after building the packages involved and importing them into our production environment, the driver's filter ended up with the base package's filter definitions only.


Not sure what you mean by "the base package's filter definitions": does your base package contain a filter resource and it's the only one being applied? Or does your base package has a filter as part of Initial Settings?

If the latter: in my experience it's a bad idea to mix filter resources with filters from Initial Settings. Either use filter resources exclusively OR use Initial Settings to package the filter.

Something else to keep in mind: Filter resources are merged to the effective filter by Designer before deploying it (unlike GCV resources which are deployed as resources and the engine reads and merges them on every driver startup). Any change made to a driver filter directly in Designer prevents the contents of filter resources from being applied consistently. This may happen accidentally by editing the filter instead of the resource at some point, or accidentally importing a changed filter into Designer during Compare/Reconcile.So if you see filter resources no being applied this could be the root cause.

Until recently, the only way to fix this was to uninstall all packages with filter resources off a driver, clear out the remaining driver filter and reinstall them. I usually made sure the IDV had all GCVs and settings correctly beforehand, so I could then re-import them into Designer. "Revert customizations" for the filter now makes it a lot easier to discard any unwanted changes and rebuild the filter from resources only.

______________________________________________
https://www.is4it.de/identity-access-management
Captain
Captain

Thanks for your contributions. I might have to provide a more detailed view:

I'm using two separate projects in Designer: one for development and testing (package developer mode enabled) a second one for deployment to our production system (developer mode disabled).

I've created a custom base package containing functionality that is going to be shared among different drivers and different "flavour" packages that contain functionality for specific drivers. Sometimes I add additional functionality using dedicated packages (e.g. stricter name checks for sources known for sloppy typing of names, birthdates etc.). Hence I can add stricter name checking to different drivers as desired and without messing around with their code.

However, in the present case only two packages were involved: base and "flavour". Both packages contained one filter resource. The base package defined attributes a, b, c, ..., g, while the flavour package defined additional attributes h, i, ..., o and redefined one or two filter definitions of the base package. I went into the general packages properties to remove any filter definitions from the initial settings (have been bitten by those years ago).

Upgrading a driver to the new package content proceeds smoothly. So does installing a pristine new driver using both packages. As I've just checked, both package's filter resources _do_ appear in Designer's outline view.

Now, after everything has been sync'd to both packages, I'm building JARs and import these into the second project's package catalogue. Both filter resources are seen in the packages, nevertheless they are not listed in the outline view and once upgraded, the driver's effective filter has just the base package's filter definitions. Again, the same holds upon installing a fresh new driver. No harm is done neither to the upgraded nor to the newly installed driver, not a single bit is touched.

After consulting the forum, I've temporarily enabled package developer mode in our production project and voilà, here we go. Contrary to the development project, the filter resources still don't appear in Designer's outline, but both are taken into account in the resulting effective filter.

As a matter of fact, I don't see _any_ package's filter resource in outline view of our production project with any of our drivers, which were built the same way from packages imported into the project. Nevertheless, their effective filter was OK before enabling package developer mode, as far as I can say. (These packages have been built some years ago and developer mode might have been enabled once upon a time.)

So no edits after building packages and no deployment to the vault. I've found "revert customization" being active at the effective filter despite of no customizations having been made so far. Thanks to Lothar for the hint I didn't know yet. To test, I would have to delete and reimport packages with developer mode disabled, I guess, because for now the effective filter is working even with developer mode disabled again. I'm posting here should I find something new.

Axel

Knowledge Partner Knowledge Partner
Knowledge Partner


@AS78 wrote:

I'm using two separate projects in Designer: one for development and testing (package developer mode enabled) a second one for deployment to our production system (developer mode disabled).

Developer mode is enabled/disabled per Tree, not per project. You can have trees in both configurations in the same project. In my experience it makes staging a lot easier when all stages are part of the same project. I rather split between groups of related drivers into separate project than between stages.

Upgrading a driver to the new package content proceeds smoothly. So does installing a pristine new driver using both packages. As I've just checked, both package's filter resources _do_ appear in Designer's outline view.

Now, after everything has been sync'd to both packages, I'm building JARs and import these into the second project's package catalogue. Both filter resources are seen in the packages, nevertheless they are not listed in the outline view

That's one difference between developer mode enabled or not. Filter resources were not meant to be used as objects by the engine, it's Designer who combines them into the all-in-one driver filter and only this resulting filter is relevant to the running driver. Inconsistent behaviour between dev mode on/off, as well as inconsistent behaviour between filter resources and GCV resources (which seem to be similar but are implemented totally different). Too many cooks spoil the broth...

I've found "revert customization" being active at the effective filter despite of no customizations having been made so far.

That's always active, regardless of a filter being customized or not. The state of customization is not tracked by Designer, they probably thought it too much work to implement. You can only try running "Revert customization" and see if it makes a difference e.g. by comparing to Edir.

 

______________________________________________
https://www.is4it.de/identity-access-management
0 Likes
Captain
Captain

Out of curiosity I've meanwhile installed five test drivers "Test A" to "Test E" using an old project state saved last year. Package developer mode was disabled as usual. Everything took place solely in Designer, nothing was ever deployed.

Having a look at the old driver I realised the effective filter was OK (contained all filter definitions from the two packages involved). The package version used contained filter definitions in the initial settings section, however, which might explain this finding. Installing a pristine new driver "Test A" with those two package versions showed a fully working effective driver.

Next I imported the actual packages (base and feature) into this old project. This way it was ensured, both packages had never seen by Designer whilst in package developer mode. As mentioned, these package versions do only contain a single filter resource each, no filter definitions in initial settings. Upgrading the existing driver to the newly imported package versions yielded a full effective filter (the same as before, in fact, since the new package versions didn't contain new filter definitions not to be found in earlier package versions). Fun began when installing a fresh new driver "Test B": the effective filter now lacked all filter definitions from the base package's filter resource!

The next step was to enable package developer mode and installing one more driver "Test C": Once again, all base package's filter definitions were missing! Uninstalling the base package from driver "Test C" and adding it again afterwards did however repair the effective filter. In the flow of installing drivers I came up with fresh drivers "Test D" and "Test E" installed with package developer mode still enabled and after being switched off, respectively: Both received a nice effective filter that left nothing to desire.

For me this seems to perfectly resemble the findings reported by T. Reibenwein eight years ago. Unfortunately, this behaviour seems to be poorly documented although around for years, if not a decade. Probably only few people deploy to prod from Designer projects with package developer mode disabled.

I'd be delighted, should some information on the background and reason for this peculiar behaviour unearth some day, but for the time being will try not to forget to enable developer mode when importing and installing new package versions.

Axel

Knowledge Partner Knowledge Partner
Knowledge Partner


@AS78 wrote:

For me this seems to perfectly resemble the findings reported by T. Reibenwein eight years ago. Unfortunately, this behaviour seems to be poorly documented although around for years, if not a decade. Probably only few people deploy to prod from Designer projects with package developer mode disabled.

I'd be delighted, should some information on the background and reason for this peculiar behaviour unearth some day, but for the time being will try not to forget to enable developer mode when importing and installing new package versions.


Maybe I've never run into this myself because my project usually have DEV + QA trees with dev mode enabled and PROD tree with dev mode off all in the same project. All cases where filters were not build correctly from resources (I use filter resources exclusively, never ever put filter stuff into initial settings) were due to manually/accidentally editing the driver filter directly. "Revert customization" now seems to reliably fix that.

______________________________________________
https://www.is4it.de/identity-access-management
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.