You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Description

  • org.joget.apps.generator.service.GeneratorUtil
  • Under wflow-core module
  • Utility methods can be used by Generator Plugin

Code Sample

import org.joget.apps.app.model.AppDefinition;
import org.joget.apps.app.service.AppUtil;
import org.joget.apps.generator.service.GeneratorUtil;


String formId = "crm_account";
AppDefinition appDef = AppUtil.getCurrentAppDefinition();
 
String content = "This is a test string for form [formId] in app [appName]";
 
//Change the syntax to form meta
content = GeneratorUtil.populateFormMeta(content, formId, appDef);

Methods

addCategoryJsonToUserviewJson
public static java.lang.String addCategoryJsonToUserviewJson(java.lang.String categoryJson, java.lang.String userviewJson)

Adds an userview category json to an existing userview json

addParticipantsAndProcessXmlToXpdl
public static java.lang.String addParticipantsAndProcessXmlToXpdl(java.lang.String participantsXml, java.lang.String processXml, java.lang.String xpdl) throws java.lang.RuntimeException

Add participants xml and process xml to an existing xpdl

createNewUserviewJson
public static java.lang.String createNewUserviewJson(java.lang.String userviewId, java.lang.String userviewName, java.lang.String userviewDescription)

Creates a new userview definition json

createNewUserviewJson
public static java.lang.String createNewUserviewJson(java.lang.String userviewId, java.lang.String userviewName, java.lang.String userviewDescription, org.joget.apps.app.dao.UserviewDefinition copy)

Creates a new userview definition json based another userview definition

createProcessPackageXpdl
public static java.lang.String createProcessPackageXpdl(org.joget.apps.app.model.AppDefinition appDef)

Create a XPDL with empty process package

getFirstAvailableListIdByFormId
public static java.lang.String getFirstAvailableListIdByFormId(org.joget.apps.app.model.AppDefinition appDef, java.lang.String formId)

Retrieves a List id which using the form id in binder

getFirstAvailableUserviewId
public static java.lang.String getFirstAvailableUserviewId(org.joget.apps.app.model.AppDefinition appDef)

Retrieves the first userview id in the app

getFormObject
public static org.joget.apps.form.model.Form getFormObject(java.lang.String formId, org.joget.apps.app.model.AppDefinition appDef) throws java.lang.RuntimeException

Gets the Form object by Id

populateFormMeta
public static java.lang.String populateFormMeta(java.lang.String content, java.lang.String formId, org.joget.apps.app.model.AppDefinition appDef)

Method used to replaces syntax below to form meta value.

[formId], [formName], [formTableName], [appId], [appName] & [appVersion] 

 

  • No labels