Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Package is not getting completely generated

Avatar

Avatar
Give Back 5
Level 3
santhoshsrg
Level 3

Likes

21 likes

Total Posts

56 posts

Correct Reply

2 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 3
Ignite 1
View profile

Avatar
Give Back 5
Level 3
santhoshsrg
Level 3

Likes

21 likes

Total Posts

56 posts

Correct Reply

2 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 3
Ignite 1
View profile
santhoshsrg
Level 3

11-06-2020

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);

  

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
Employee
surabhikatiyar
Employee

Likes

68 likes

Total Posts

46 posts

Correct Reply

18 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Boost 50
Employee
surabhikatiyar
Employee

Likes

68 likes

Total Posts

46 posts

Correct Reply

18 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile
surabhikatiyar
Employee

11-06-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 

 

Answers (0)