Package com.camunda.fox.mule

Source Code of com.camunda.fox.mule.MuleService

package com.camunda.fox.mule;

import javax.inject.Inject;
import javax.inject.Named;

import org.activiti.engine.delegate.DelegateExecution;
import org.mule.api.MuleContext;
import org.mule.api.MuleException;
import org.mule.api.client.MuleClient;

@Named(value="mule")
public class MuleService {

  @Inject
  MuleContext context;
 
  public void flow(String flowName, DelegateExecution execution) throws MuleException {
   
    MuleClient client = context.getClient();
   
    client.dispatch("vm://" + flowName, execution.getVariables(), null);

    // if we want to be able to write return values back into the
    // result-variable in fox, we could alternatively use "request-respond"
    // pattern and call/ return client.send(url, message) here. In the flow,
    // we would then have to set exchange-pattern="request-response"
   
  }
 
}
TOP

Related Classes of com.camunda.fox.mule.MuleService

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.