show assignments count on html page?

Confluence User - 08 Sep, 2021

Hi everybody, 

I'm looking for a simple customization of the home of my joget app. Since I set the home app as landing page, I would like to replicate the home page of Joget where the number of assignments is shown in a <h1> tag over the background images that alternate. I update below an image to clarify better what I mean.  

I tried to look in the javascript api of joget, but I didn't find any useful function to get the current number of pending assignments.

Any advice will be appreciated. 

userviews;javascript

3


12 Sep, 2021
confluenceUser
confluenceUser

Go to your app's properties, add this environment variable "getAssignmentCount".

import org.joget.apps.app.service.AppUtil;
import org.joget.workflow.model.service.WorkflowManager;

WorkflowManager workflowManager = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager");
int count = workflowManager.getAssignmentSize(false, null);

return Integer.toString(count);

Go to your html page, add "#beanshell.getAssignmentCount#".

It will show your assignment count of the current logged in user now.

16 Sep, 2021
confluenceUser
confluenceUser

Hi Bastiana thank you for your precious support. I followed your advice, so created the environment variable with value the beanshell script you posted. But now, how can I access the variable from html code? Probably I'm missing something, I thought that we cannot access bean shell from javascript or html.

16 Sep, 2021
confluenceUser
confluenceUser

EDIT: I solved, It's just necessary to upload the plugin bean shell variable as explained here: How to develop a Bean Shell Hash Variable

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print