| Summary: | Package-tree corruption after migration from BRMS 5.1.0 to 5.2.0 | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise BRMS Platform 5 | Reporter: | Toshiya Kobayashi <tkobayas> |
| Component: | BRM (Guvnor) | Assignee: | Mark Proctor <mproctor> |
| Status: | VERIFIED --- | QA Contact: | Lukáš Petrovický <lpetrovi> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | BRMS 5.2.0.GA | CC: | mproctor |
| Target Milestone: | ER6 | ||
| Target Release: | BRMS 5.3.0.GA | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
As the exported repository file was created by guvnor 5.1 which has the drools:title value set incorrectly, the only solution we can provide to customers is this workaround: Before exporting the repository, do a package rename. This should fix the package drools:title attribute. Nothing to verify here. |
Package-tree in 'Knowledge Bases' panel may corrupt after they export/import a repository from BRMS 5.1.0 to 5.2.0. You can reproduce it by: - Start up BRMS 5.1.0 and install mortgages example - 'Copy' mortgages package as 'newpackage' package - Export the repository - Start up BRMS 5.2.0 - Import the exported repository - You will see duplicate 'mortgages' packages in package-tree In BRMS 5.1.0, when you copy a package, the title of a new package would be just copied from the old title(= old package name). org.drools.repository.RulesRepository public void copyPackage(String sourcePackageName, String destPackageName) { PackageItem source = loadPackage( sourcePackageName ); String sourcePath; try { sourcePath = source.getNode().getPath(); String destPath = source.getNode().getParent().getPath() + "/" + destPackageName; if ( this.getAreaNode( RULE_PACKAGE_AREA ).hasNode( destPackageName ) ) { throw new RulesRepositoryException( "Destination already exists." ); } this.session.getWorkspace().copy( sourcePath, destPath ); PackageItem newPkg = loadPackage( destPackageName ); for ( Iterator iter = newPkg.getAssets(); iter.hasNext(); ) { AssetItem as = (AssetItem) iter.next(); as.updateStringProperty( destPackageName, AssetItem.PACKAGE_NAME_PROPERTY ); } save(); } catch ( RepositoryException e ) { log.error( e.getMessage(), e ); throw new RulesRepositoryException( e ); } } # In BRMS 5.2.0, the title will be filled with the new package name As long as you use BRMS 5.1.0, this is not a problem because PackageConfigData.name is filled with PackageItem.getName(). org.drools.guvnor.server.ServiceImplementation private PackageConfigData[] listPackages(boolean archive, RepositoryFilter filter) { List<PackageConfigData> result = new ArrayList<PackageConfigData>(); PackageIterator pkgs = repository.listPackages(); pkgs.setArchivedIterator( archive ); while ( pkgs.hasNext() ) { PackageItem pkg = pkgs.next(); PackageConfigData data = new PackageConfigData(); data.uuid = pkg.getUUID(); data.name = pkg.getName(); ... org.drools.repository.VersionableItem public String getName() { try { return getVersionContentNode().getName(); } catch (RepositoryException e) { throw new RulesRepositoryException(e); } } But In BRMS 5.2.0, PackageItem.getName() returns getTitle(). org.drools.repository.VersionableItem public String getName() { return getTitle(); } That is the cause of the corruption.