Package com.camunda.fox.example.domain

Examples of com.camunda.fox.example.domain.Rating


          @ReadyToRate
          LoanApplicationEvent loanApplicationEvent) {
       
    int score = creditRatingLogic.rateApplication(loanApplicationEvent.getLoanApplication());
   
    Rating rating = new Rating();   
    rating.setScore(score);
   
    entityManager.persist(rating);
    entityManager.flush();
   
    Execution execution = runtimeService.createExecutionQuery()
      .processInstanceId(loanApplicationEvent.getCorrelationId())
      .activityId("receiveRating")
      .singleResult();
       
    businessProcess.associateExecutionById(execution.getId());   
    businessProcess.setVariable("ratingId", rating.getId());
    businessProcess.signalExecution();   
  }
View Full Code Here


   
    businessProcess.startProcessByKey("creditRating");
   
    Thread.sleep(2000);
       
    Rating rating = findRating();
    Assert.assertTrue(rating.getScore()>0); // positive rating
       
  }
View Full Code Here

   
    businessProcess.startProcessByKey("creditRating");
   
    Thread.sleep(2000);
   
    Rating rating = findRating();
    Assert.assertTrue(rating.getScore()<0); // negative rating
   
  }
View Full Code Here

  @After
  public void cleanup() throws Exception {
    utx.begin();
    try {
      Rating rating = findRating();
      entityManager.remove(rating);
      utx.commit();
    } catch (Exception e) {
      utx.rollback();
    }
View Full Code Here

               
        LoanApplication application = (LoanApplication) objectMessage.getObject();
       
        int score = creditRatingLogic.rateApplication(application);
       
        Rating rating = new Rating();
        rating.setScore(score);
       
        entityManager.persist(rating);
        entityManager.flush();

        Execution execution = runtimeService.createExecutionQuery()
          .processInstanceId(message.getStringProperty("correlationId"))
          .activityId("receiveRating")
          .singleResult();
           
        businessProcess.associateExecutionById(execution.getId());   
        businessProcess.setVariable("ratingId", rating.getId());
        businessProcess.signalExecution();   
       
      } catch (JMSException e) {
        throw new EJBException("Could not unwrap object message" + e.getMessage(), e);
      }     
View Full Code Here

  @Asynchronous 
  public void rateApplication(LoanApplication loanApplication) {
   
    int score = creditRatingLogic.rateApplication(loanApplication);
   
    Rating raiting = new Rating();   
    raiting.setScore(score);
   
    entityManager.persist(raiting);
    entityManager.flush();   
  }
View Full Code Here

    Assert.assertNotNull(historyService.createHistoricActivityInstanceQuery()
      .processInstanceId(pi.getId())
      .activityId("generateContract")
      .singleResult());
   
    Rating rating = findRating();
    Assert.assertTrue(rating.getScore()>0);
       
  }
View Full Code Here

    Assert.assertNotNull(historyService.createHistoricActivityInstanceQuery()
            .processInstanceId(pi.getId())
            .activityId("generateRejectionLetter")
            .singleResult());
   
    Rating rating = findRating();
    Assert.assertTrue(rating.getScore()<0);
   
  }
View Full Code Here

   
  @After
  public void cleanup() throws Exception {
    utx.begin();
    try {
      Rating raiting = findRating();    
      entityManager.remove(raiting);    
      utx.commit();
    }catch (Exception e) {
      utx.rollback();
    }
View Full Code Here

    Assert.assertNotNull(historyService.createHistoricActivityInstanceQuery()
      .processInstanceId(pi.getId())
      .activityId("generateContract")
      .singleResult());
   
    Rating raiting = findRating();
    Assert.assertTrue(raiting.getScore()>0);
       
  }
View Full Code Here

TOP

Related Classes of com.camunda.fox.example.domain.Rating

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.