Package org.joget.apps.app.model

Examples of org.joget.apps.app.model.PackageDefinition


        AppDefinition appDef = appService.getAppDefinition(appId, appVersion);

        if ("getActivities".equals(action)) {
            try {
                JSONArray jsonArray = new JSONArray();
                PackageDefinition packageDefinition = appDef.getPackageDefinition();
                Long packageVersion = (packageDefinition != null) ? packageDefinition.getVersion() : new Long(1);
                Collection<WorkflowProcess> processList = workflowManager.getProcessList(appId, packageVersion.toString());

                if (processList != null && !processList.isEmpty()) {
                    for (WorkflowProcess p : processList) {
                        Collection<WorkflowActivity> activityList = workflowManager.getProcessActivityDefinitionList(p.getId());
View Full Code Here


                ApplicationContext ac = AppUtil.getApplicationContext();
                AppService appService = (AppService) ac.getBean("appService");
                WorkflowManager workflowManager = (WorkflowManager) ac.getBean("workflowManager");
                AppDefinition appDef = appService.getAppDefinition(appId, appVersion);
                PackageDefinition packageDefinition = appDef.getPackageDefinition();
                Long packageVersion = (packageDefinition != null) ? packageDefinition.getVersion() : new Long(1);
                Collection<WorkflowProcess> processList = workflowManager.getProcessList(appId, packageVersion.toString());

                Map<String, String> empty = new HashMap<String, String>();
                empty.put("value", "");
                empty.put("label", "");
View Full Code Here

            String processDefId = assignment.getProcessDefId();
            WorkflowProcess process = workflowManager.getProcess(processDefId);
            if (process != null) {
                String packageId = process.getPackageId();
                Long packageVersion = Long.parseLong(process.getVersion());
                PackageDefinition packageDef = packageDefinitionDao.loadPackageDefinition(packageId, packageVersion);
                if (packageDef != null) {
                    appDef = packageDef.getAppDefinition();
                }
            }
        }

        if (appDef != null && appDef.getPackageDefinition() != null) {
            PackageDefinition packageDef = appDef.getPackageDefinition();
            String processDefId = WorkflowUtil.getProcessDefIdWithoutVersion(assignment.getProcessDefId());
            PackageActivityPlugin activityPluginMeta = packageDef.getPackageActivityPlugin(processDefId, assignment.getActivityDefId());

            Plugin plugin = null;

            if (activityPluginMeta != null) {
                plugin = pluginManager.getPlugin(activityPluginMeta.getPluginName());
View Full Code Here

            ApplicationContext appContext = AppUtil.getApplicationContext();
            PackageDefinitionDao packageDefinitionDao = (PackageDefinitionDao) appContext.getBean("packageDefinitionDao");

            procDefId = WorkflowUtil.getProcessDefIdWithoutVersion(procDefId);
            Long packageVersion = Long.parseLong(version);
            PackageDefinition packageDef = packageDefinitionDao.loadPackageDefinition(packageId, packageVersion);
           
            if (packageDef != null) {
                PackageParticipant participant = packageDef.getPackageParticipant(procDefId, participantId);

                //Set app definition   
                AppDefinition appDef = packageDef.getAppDefinition();
                AppUtil.setCurrentAppDefinition(appDef);

                //if process start white list and app is not publish
                if (WorkflowUtil.PROCESS_START_WHITE_LIST.equals(participantId) && !appDef.isPublished()) {
                    resultList = getParticipantsByAdminUser();
View Full Code Here

                //get package definition by process id
                WorkflowProcess process = workflowManager.getRunningProcessById(processId);

                if (process != null) {
                    PackageDefinition packageDef = packageDefinitionDao.loadPackageDefinition(process.getPackageId(), Long.parseLong(process.getVersion()));
                    if (packageDef != null) {
                        appDef = packageDef.getAppDefinition();
                    }
                }

                if (appDef != null) {
                    PluginDefaultPropertiesDao pluginDefaultPropertiesDao = (PluginDefaultPropertiesDao) AppUtil.getApplicationContext().getBean("pluginDefaultPropertiesDao");
View Full Code Here

        //appID same with packageId
        AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");
        Long version = appService.getPublishedVersion(packageId);
       
        AppDefinition appDef = appService.getAppDefinition(packageId, version.toString());
        PackageDefinition packageDef = appDef.getPackageDefinition();
       
        if (packageDef != null && packageDef.getVersion() != null) {
            return packageDef.getVersion().toString();
        }
        return null;
    }
View Full Code Here

        AppDefinition appDef = obj.getAppDefinition();
        if (appDef != null) {
            // disassociate from app
            Collection<PackageDefinition> list = appDef.getPackageDefinitionList();
            for (Iterator<PackageDefinition> i = list.iterator(); i.hasNext();) {
                PackageDefinition def = i.next();
                if (def.getId() != null && def.getId().equals(obj.getId())) {
                    i.remove();
                }
            }
            appDefinitionDao.saveOrUpdate(appDef);
        }
View Full Code Here

     * @param appVersion
     * @return
     */
    @Override
    public PackageDefinition loadAppPackageDefinition(String appId, Long appVersion) {
        PackageDefinition packageDef = null;

        // load the package definition
        String condition = " INNER JOIN e.appDefinition app WHERE app.id=? AND app.version=?";
        Object[] params = {appId, appVersion};
        Collection<PackageDefinition> results = find(getEntityName(), condition, params, null, null, 0, 1);
View Full Code Here

     * @param packageVersion
     * @return
     */
    @Override
    public PackageDefinition loadPackageDefinition(String packageId, Long packageVersion) {
        PackageDefinition packageDef = null;
        if (packageVersion != null) {
            // load the package definition
            String condition = " WHERE e.id=? AND e.version=?";
            Object[] params = {packageId, packageVersion};
            Collection<PackageDefinition> results = find(getEntityName(), condition, params, null, null, 0, 1);
View Full Code Here

     * @param processDefId
     * @return
     */
    @Override
    public PackageDefinition loadPackageDefinitionByProcess(String packageId, Long packageVersion, String processDefId) {
        PackageDefinition packageDef = null;
        if (packageVersion != null) {
            processDefId = WorkflowUtil.getProcessDefIdWithoutVersion(processDefId);

            // load the package definition
            String condition = " INNER JOIN e.packageActivityFormMap paf WHERE e.id=? AND e.version=? AND paf.processDefId=?";
View Full Code Here

TOP

Related Classes of org.joget.apps.app.model.PackageDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.