Examples of ModelService


Examples of com.founder.fix.fixflow.core.ModelService

  public String getProcessVersionInfo(String fileName, String userId)throws Exception {
    String processKey = fileName.substring(0, fileName.lastIndexOf("."));
      List<Map<String, Object>> resultMaps = new ArrayList<Map<String,Object>>();
      ProcessEngine processEngine = getProcessEngine(userId);
      if(processEngine != null){
        ModelService modelService = processEngine.getModelService();
        ProcessDefinitionQuery processDefinitionQuery = modelService.createProcessDefinitionQuery();
        processDefinitionQuery.processDefinitionKey(processKey);
        processDefinitionQuery.orderByProcessDefinitionVersion().desc();
        List<ProcessDefinitionBehavior> processDefinitionBehaviors = processDefinitionQuery.list();
        for(ProcessDefinitionBehavior processDefinitionBehavior :processDefinitionBehaviors){
          resultMaps.add(processDefinitionBehavior.getPersistentState());
View Full Code Here

Examples of com.iqbon.jcms.service.ModelService

  private static final Logger logger = Logger.getLogger(ParseModelJob.class);

  @Override
  public void execute(JobExecutionContext context) throws JobExecutionException {
    QuartzService quartzService = (QuartzService) BeanFactory.getBean("quartzService");
    ModelService modelService = (ModelService) BeanFactory.getBean("modelService");
    JobDetail jobDetail = context.getJobDetail();
    String jobName = jobDetail.getKey().getName();
    if (String.valueOf(Quartz.runningStatus.running.ordinal()).equals(
        quartzService.getQuartzStatus(jobName))) {//如果是正在运行状态
      logger.warn("上一个调度任务" + jobName + "正在运行,本次调度运行跳过。");
      return;
    } else {
      quartzService.setQuartzStatus(jobName, Quartz.runningStatus.running.ordinal());
      long start = System.currentTimeMillis();
      logger.info("开始刷新文章");
      quartzService.setQuartzStatus(jobName, Quartz.runningStatus.stop.ordinal());
      String refresh = jobDetail.getJobDataMap().getString(Quartz.JOB_FRESH_MINUTE);
      List<String> modelIdList = modelService.getNeedPublishModelByRefresh(refresh);
      for (String modelName : modelIdList) {
        try {
          logger.info("刷新模板" + modelName);
          Model model = modelService.getModelInfoByModelName(modelName);
          modelService.publishModelContent(model);
        } catch (IOException e) {
          logger.error(modelName + "模板刷新失败", e);
          logEnd(start, jobName);
          quartzService.setQuartzStatus(jobName, Quartz.runningStatus.stop.ordinal());
        } catch (NotFoundException ne) {
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.impl.ModelService

    init();
    if(target!=null) {
      if(getCoffeeName()==null) {
        this.setCoffeeName(target.getName());
      }
      model = new ModelService(this);
      parse(target);
    }
    return model;
 
View Full Code Here

Examples of org.mule.module.management.mbean.ModelService

    protected void registerModelServices() throws NotCompliantMBeanException, MBeanRegistrationException,
            InstanceAlreadyExistsException, MalformedObjectNameException
    {
        for (Model model : muleContext.getRegistry().lookupObjects(Model.class))
        {
            ModelServiceMBean service = new ModelService(model);
            String rawName = service.getName() + "(" + service.getType() + ")";
            String name = jmxSupport.escape(rawName);
            final String jmxName = String.format("%s:%s%s", jmxSupport.getDomainName(muleContext, !containerMode), ModelServiceMBean.DEFAULT_JMX_NAME_PREFIX, name);
            ObjectName on = jmxSupport.getObjectName(jmxName);
            ClassloaderSwitchingMBeanWrapper mBean = new ClassloaderSwitchingMBeanWrapper(service, ModelServiceMBean.class, muleContext.getExecutionClassLoader());
            logger.debug("Registering model with name: " + on);
View Full Code Here

Examples of org.ofbiz.service.ModelService

        }

        String encoding = System.getProperty("file.encoding");
        String file = Charset.forName(encoding).decode(fileBytes).toString();
        // get the createProductPromoCode Model
        ModelService promoModel;
        try {
            promoModel = dispatcher.getDispatchContext().getModelService("createProductPromoCode");
        } catch (GenericServiceException e) {
            Debug.logError(e, module);
            return ServiceUtil.returnError(e.getMessage());
        }

        // make a temp context for invocations
        Map<String, Object> invokeCtx = promoModel.makeValid(context, ModelService.IN_PARAM);

        // read the bytes into a reader
        BufferedReader reader = new BufferedReader(new StringReader(file));
        List<Object> errors = FastList.newInstance();
        int lines = 0;
View Full Code Here

Examples of org.ofbiz.service.ModelService

        // if the content has a service attached run the service

        String serviceName = content.getString("serviceName");
        if (dispatcher != null && UtilValidate.isNotEmpty(serviceName)) {
            DispatchContext dctx = dispatcher.getDispatchContext();
            ModelService service = dctx.getModelService(serviceName);
            if (service != null) {
                Map<String,Object> serviceCtx = service.makeValid(templateContext, ModelService.IN_PARAM);
                Map<String,Object> serviceRes;
                try {
                    serviceRes = dispatcher.runSync(serviceName, serviceCtx);
                } catch (GenericServiceException e) {
                    Debug.logError(e, module);
View Full Code Here

Examples of org.ofbiz.service.ModelService

        if (UtilValidate.isEmpty(this.getServiceName()) || UtilValidate.isEmpty(this.getAttributeName())) {
            return false;
        }
        DispatchContext dispatchContext = this.getModelForm().dispatchContext;
        try {
            ModelService modelService = dispatchContext.getModelService(this.getServiceName());
            if (modelService != null) {
                ModelParam modelParam = modelService.getParam(this.getAttributeName());
                if (modelParam != null) {
                    if (UtilValidate.isNotEmpty(modelParam.entityName) && UtilValidate.isNotEmpty(modelParam.fieldName)) {
                        this.entityName = modelParam.entityName;
                        this.fieldName = modelParam.fieldName;
                        if (this.induceFieldInfoFromEntityField(defaultFieldType)) {
View Full Code Here

Examples of org.ofbiz.service.ModelService

                request.setAttribute("_ERROR_MESSAGE_", "<li>" + errMsg + " [" + "persistContentAndAssoc" + "]: " + e.toString());
                return "error";
           }
        }

        ModelService modelService = null;
        try {
            modelService = dispatcher.getDispatchContext().getModelService("persistContentAndAssoc");
        } catch (GenericServiceException e) {
            String errMsg = "Error getting model service for serviceName, 'persistContentAndAssoc'. " + e.toString();
            Debug.logError(errMsg, module);
            request.setAttribute("_ERROR_MESSAGE_", "<li>" + errMsg + "</li>");
            return "error";
        }
        Map<String, Object> persistMap = modelService.makeValid(paramMap, ModelService.IN_PARAM);
        persistMap.put("userLogin", userLogin);
        try {
            Map<String, Object> persistResult = dispatcher.runSync("persistContentAndAssoc", persistMap);
            contentId = (String)persistResult.get("contentId");
            //request.setAttribute("contentId", contentId);
View Full Code Here

Examples of org.ofbiz.service.ModelService

                // get the service objects
                LocalDispatcher dispatcher = this.modelScreen.getDispatcher(context);
                DispatchContext dctx = dispatcher.getDispatchContext();

                // get the service
                ModelService permService;
                try {
                    permService = dctx.getModelService(serviceName);
                } catch (GenericServiceException e) {
                    Debug.logError(e, module);
                    return false;
                }

                if (permService != null) {
                    // build the context
                    Map<String, Object> svcCtx = permService.makeValid(serviceContext, ModelService.IN_PARAM);
                    svcCtx.put("resourceDescription", resource);
                    if (UtilValidate.isNotEmpty(mainAction)) {
                        svcCtx.put("mainAction", mainAction);
                    }
View Full Code Here

Examples of org.ofbiz.service.ModelService

                Debug.logError(e, "Error running serviceName persistContentAndAssoc", module);
                return ServiceUtil.returnError(UtilProperties.getMessage(CoreEvents.err_resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale));
           }
        }

        ModelService modelService = null;
        try {
            modelService = dispatcher.getDispatchContext().getModelService("persistContentAndAssoc");
        } catch (GenericServiceException e) {
            Debug.logError("Error getting model service for serviceName, 'persistContentAndAssoc'. " + e.toString(), module);
            return ServiceUtil.returnError(UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.error_modelservice_for_srv_name", locale));
        }
        Map<String, Object> persistMap = modelService.makeValid(context, ModelService.IN_PARAM);
        persistMap.put("userLogin", userLogin);
        try {
            Map<String, Object> persistContentResult = dispatcher.runSync("persistContentAndAssoc", persistMap);
            if (ServiceUtil.isError(persistContentResult)) {
                return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentContentCreatingError", UtilMisc.toMap("serviceName", "persistContentAndAssoc"), locale), null, null, persistContentResult);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.