public Iterable<Path> loadFilesByType(String path, String fileType) {
   try {
     return fs.loadFilesByType(path, fileType);
   } catch (FileException ex) {
     Logger.getLogger(KnowledgeDomainServiceEntryPointImpl.class.getName())
         .log(Level.SEVERE, null, ex);
   }
   return null;
 }
 public byte[] loadFile(Path file) {
   try {
     return fs.loadFile(file);
   } catch (FileException ex) {
     Logger.getLogger(KnowledgeDomainServiceEntryPointImpl.class.getName())
         .log(Level.SEVERE, null, ex);
   }
   return null;
 }
 @Override
 public org.uberfire.backend.vfs.Path getProcessAssetPath(String processId) {
   String reporoot = fs.getRepositoryRoot();
   if (reporoot.endsWith("/")) {
     reporoot = reporoot.substring(0, (reporoot.length() - 1));
   }
   String uri = reporoot + domainService.getProcessAssetPath(processId);
   String name = uri.substring(uri.lastIndexOf("/") + 1);
   return PathFactory.newPath(fileSystems.getBootstrapFileSystem(), name, uri);
 }
 public void fetchChanges() {
   fs.fetchChanges();
 }
 public String createProcessDefinitionFile(String name) {
   return fs.createFile(name).toString();
 }
 public void checkFileSystem() {
   fs.fetchChanges();
 }
示例#7
0
  @Before
  public void setUp() throws Exception {

    ds = new PoolingDataSource();
    ds.setUniqueName("jdbc/testDS1");

    // NON XA CONFIGS
    ds.setClassName("org.h2.jdbcx.JdbcDataSource");
    ds.setMaxPoolSize(3);
    ds.setAllowLocalTransactions(true);
    ds.getDriverProperties().put("user", "sa");
    ds.getDriverProperties().put("password", "sasa");
    ds.getDriverProperties().put("URL", "jdbc:h2:mem:mydb");

    ds.init();

    IOService ioService = new IOServiceNio2WrapperImpl();

    EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.domain");
    EntityManager em = emf.createEntityManager();

    Logger logger = LogManager.getLogManager().getLogger("");
    JbpmServicesTransactionManager jbpmJTATransactionManager = new JbpmJTATransactionManager();
    JbpmServicesPersistenceManager pm = new JbpmServicesPersistenceManagerImpl();
    ((JbpmServicesPersistenceManagerImpl) pm).setEm(em);
    ((JbpmServicesPersistenceManagerImpl) pm).setTransactionManager(jbpmJTATransactionManager);

    this.fs = new TestVFSFileServiceImpl();
    fs.init();

    MVELWorkItemHandlerProducer workItemProducer = new MVELWorkItemHandlerProducer();
    workItemProducer.setFs(fs);

    TestIdentityProvider identityProvider = new TestIdentityProvider();
    ServicesAwareAuditEventBuilder auditEventBuilder = new ServicesAwareAuditEventBuilder();
    auditEventBuilder.setIdentityProvider(identityProvider);

    adminDataService = new KnowledgeAdminDataServiceImpl();
    ((KnowledgeAdminDataServiceImpl) adminDataService).setPm(pm);

    bpmn2Service = new BPMN2DataServiceImpl();
    ProcessDescriptionRepository repo = new ProcessDescriptionRepository();
    ((BPMN2DataServiceImpl) bpmn2Service).setRepository(repo);
    BPMN2DataServiceSemanticModule semanticModule = new BPMN2DataServiceSemanticModule();

    ProcessGetInformationHandler processHandler = new ProcessGetInformationHandler();
    processHandler.setRepository(repo);
    semanticModule.setProcessHandler(processHandler);

    ProcessGetInputHandler inputHandler = new ProcessGetInputHandler();
    inputHandler.setRepository(repo);
    semanticModule.setProcessInputHandler(inputHandler);

    GetReusableSubProcessesHandler subProcessHandler = new GetReusableSubProcessesHandler();
    subProcessHandler.setRepository(repo);
    semanticModule.setReusableSubprocessHandler(subProcessHandler);

    HumanTaskGetInformationHandler taskHandler = new HumanTaskGetInformationHandler();
    taskHandler.setRepository(repo);
    semanticModule.setTaskHandler(taskHandler);

    semanticModule.init();

    ((BPMN2DataServiceImpl) bpmn2Service).setSemanticModule(semanticModule);
    ((BPMN2DataServiceImpl) bpmn2Service).init();

    HumanTaskServiceFactory.setEntityManagerFactory(emf);

    HumanTaskServiceFactory.setJbpmServicesTransactionManager(jbpmJTATransactionManager);
    taskService = HumanTaskServiceFactory.newTaskService();

    deploymentService = new VFSDeploymentService();
    ((VFSDeploymentService) deploymentService).setBpmn2Service(bpmn2Service);
    ((VFSDeploymentService) deploymentService).setEmf(emf);
    ((VFSDeploymentService) deploymentService).setFs(fs);
    ((VFSDeploymentService) deploymentService).setIdentityProvider(identityProvider);
    ((VFSDeploymentService) deploymentService).setManagerFactory(new RuntimeManagerFactoryImpl());
    ((VFSDeploymentService) deploymentService).setPm(pm);
  }