RE: How to use conditional statement in liferay

Jamie Sammons, modified 2 Years ago. New Member Posts: 5 Join Date: 3/24/23 Recent Posts

Hi,

I want my file to be auto approved if it hit the workflow. I am using below condition for it but not getting any solution. Please help me with same.

  List<AssetCategory> assetCategories = assetEntry.getCategories();

        returnValue = "BPR Review";

        for (AssetCategory assetCategory : assetCategories) {
            String categoryName = assetCategory.getName()

            if (categoryName.equals("SEC FILINGS")) {
                    
                    returnValue = "Approved";

                    return true;
                }
        }

thumbnail
David H Nebinger, modified 2 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

First, categories show title in the control panel, even though they do also have a name (which you're checking).

Are you sure that the category you want to match to actually has the name SEC FILINGS?

Also, could it be a case match issue or something?