Java Code Examples for javax.enterprise.context.Conversation#begin()

The following examples show how to use javax.enterprise.context.Conversation#begin() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BusinessProcess.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
/**
 * @see #startTask(String)
 * 
 *      this method allows to start a conversation if no conversation is active
 */
public Task startTask(String taskId, boolean beginConversation) {
  if (beginConversation) {
    Conversation conversation = conversationInstance.get();
    if (conversation.isTransient()) {
      conversation.begin();
    }
  }
  return startTask(taskId);
}
 
Example 2
Source File: GuestbookController.java    From enkan with Eclipse Public License 1.0 5 votes vote down vote up
public HttpResponse list(Conversation conversation) {
    if (conversation.isTransient()) conversation.begin();
    GuestbookDao dao = domaProvider.getDao(GuestbookDao.class);
    List<Guestbook> guestbooks = dao.selectAll();
    return templateEngine.render("guestbook/list",
            "guestbooks", guestbooks);
}
 
Example 3
Source File: ConversationStateController.java    From enkan with Eclipse Public License 1.0 5 votes vote down vote up
public HttpResponse page1(Conversation conversation) {
    if (conversation.isTransient()) conversation.begin();
    int randomValue = new Random().nextInt();
    ConversationState conversationState = new ConversationState();
    conversationState.put("random", randomValue);
    return builder(templateEngine.render("conversationState/page1",
            "random", randomValue))
            .set(HttpResponse::setConversationState, conversationState)
            .build();
}
 
Example 4
Source File: BusinessProcess.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
/**
 * @see #startTask(String)
 * <p>
 * this method allows to start a conversation if no conversation is active
 */
public Task startTask(String taskId, boolean beginConversation) {
    if (beginConversation) {
        Conversation conversation = conversationInstance.get();
        if (conversation.isTransient()) {
            conversation.begin();
        }
    }
    return startTask(taskId);
}
 
Example 5
Source File: BusinessProcess.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
/**
 * @see #startTask(String)
 *
 * this method allows to start a conversation if no conversation is active
 */
public Task startTask(String taskId, boolean beginConversation) {
  if(beginConversation) {
    Conversation conversation = conversationInstance.get();
    if(conversation.isTransient()) {
     conversation.begin();
    }
  }
  return startTask(taskId);
}
 
Example 6
Source File: LoginController.java    From enkan with Eclipse Public License 1.0 4 votes vote down vote up
public HttpResponse loginForm(Parameters params, Conversation conversation) {
    if (conversation.isTransient()) conversation.begin();
    return templateEngine.render("guestbook/login",
            "url", params.get("url"));
}