Package is not getting completely generated | Community
Skip to main content
Level 4
June 11, 2020
Solved

Package is not getting completely generated

  • June 11, 2020
  • 1 reply
  • 1226 views

Hi,

 

I am trying to create a package in a workflow process. The package will contain filters as current payload and workflow instance. PFB the code which i have used for this.

My issue is the workflow instance is not getting built completely. I save workflow instance for history purpose like getting approval notes from participant. 

Please let me know if i am missing any step in building package.

 

Thanks in advance !!

 

Node rootNode = getRootNode(session, siteName); JcrPackageManager jcrPackageManager = packaging.getPackageManager(session); ProgressTrackerListener listener = new DefaultProgressListener(); JcrPackage jcrPackage = jcrPackageManager.create(rootNode, pkgName); JcrPackageDefinition jcrPackageDefinition = jcrPackage.getDefinition(); DefaultWorkspaceFilter workspaceFilter = new DefaultWorkspaceFilter(); for (PathFilterSet packageFilter : packageFilters) { workspaceFilter.add(packageFilter); } jcrPackageDefinition.setFilter(workspaceFilter, AUTO_SAVE); jcrPackageDefinition.set(JcrPackageDefinition.PN_DESCRIPTION, PACKAGE_DESCRIPTION + pkgName, false); jcrPackageDefinition.set(JcrPackageDefinition.PN_GROUP, rootNode.getName() , false); jcrPackageManager.assemble(jcrPackage, listener);

  

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Surabhi_Katiyar

Hi santhoshsrg,

 

You are trying to build the workflow which is still in running state. So you will not be able to get the complete package.

 

All the workflow steps processed after the package was created will not be included as workflow is still in RUNNING state and transition nodes are still getting added under "history" for the respective workflow instance.

 

For building up the entire workflow the process of creating the workflow should be executed once the entire workflow is completed. You can have event listener on the workflow node to check when the processing is completed, start package building. Or you can create a schedular which runs at the specific time to create packages based on the cron jobs.

 

Thanks 

 

1 reply

Surabhi_Katiyar
Adobe Employee
Surabhi_KatiyarAdobe EmployeeAccepted solution
Adobe Employee
June 11, 2020

Hi santhoshsrg,

 

You are trying to build the workflow which is still in running state. So you will not be able to get the complete package.

 

All the workflow steps processed after the package was created will not be included as workflow is still in RUNNING state and transition nodes are still getting added under "history" for the respective workflow instance.

 

For building up the entire workflow the process of creating the workflow should be executed once the entire workflow is completed. You can have event listener on the workflow node to check when the processing is completed, start package building. Or you can create a schedular which runs at the specific time to create packages based on the cron jobs.

 

Thanks