1
0
-1

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. 

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      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.

      1. Francesco

        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.

      2. Francesco

        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

      CommentAdd your comment...