I'm trying to have a custom workflow method add some text as a comment for the next activity (which is a manual activity). This occurs in middle of the workflow. There are two packages, both are visible in the auto-activity and both have a document (one document in each package). The issue i ran into is that I'm unable to get the package id of either of the packages from that activity and without getting the package Id I cannot IDfPackage.appendNote method.
Here is a snippet of my code (simplified). Please advice if this is possible or if i'm making any mistakes.
i have removed all the log statements and NCRConstants.EMPTY_ID is equal to DfId.DF_NULLID_STR (0000000000000000)
| | IDfActivity act = wi.getActivity(); |
| | String comment = "This is a comment"; |
| | for (int i = 0; i < act.getPackageCount(); i++) |
| | { |
| | | IDfId packageId = act.getPackageId(i); |
| | | if (packageId.getId() != null |
| | | | | && !packageId.getId().equals(NCRConstants.EMPTY_ID)) |
| | | { |
| | | | IDfPackage packageObj = wi.getPackage(packageId); |
| | | | String packageName = packageObj.getPackageName(); |
| | | | if (packageName.equals("package name")) |
| | | | { |
| | | | | packageObj.appendNote(comment, false); |
| | | | } |
| | | } |
| | } |
based on my log statements, the package id was always '0000000000000000'
I aldo ran some DQL and the value r_package_id in dm_activity was also always 0000000000000000 (which does not make any sense to me). I did filter it based on the workflow id.
Thanks a lot in advance !!