@Override
 public void exitInvokeFromSource(WUMLParser.InvokeFromSourceContext ctx) {
   // String inbountEndpointName = ctx.INBOUNDENDPOINTNAME().getText();
   String pipelineName = ctx.PIPELINENAME().getText();
   integrationFlow.getEsbConfigHolder().getInboundEndpoint().setPipeline(pipelineName);
   pipelineStack.push(pipelineName);
   // activePipeline = pipelineName;
   super.exitInvokeFromSource(ctx);
 }
 @Override
 public void exitOutboundEndpointDefStatement(WUMLParser.OutboundEndpointDefStatementContext ctx) {
   String protocolName =
       StringParserUtil.getValueWithinDoubleQuotes(
           ctx.outboundEndpointDef().PROTOCOLDEF().getText());
   String uri =
       StringParserUtil.getValueWithinDoubleQuotes(ctx.outboundEndpointDef().HOSTDEF().getText());
   OutboundEndpoint outboundEndpoint =
       OutboundEndpointFactory.getOutboundEndpoint(
           OutboundEndpointType.valueOf(protocolName), ctx.OUTBOUNDENDPOINTNAME().getText(), uri);
   integrationFlow.getEsbConfigHolder().addOutboundEndpoint(outboundEndpoint);
   super.exitOutboundEndpointDefStatement(ctx);
 }
  @Override
  public void exitMessageProcessingDef(WUMLParser.MessageProcessingDefContext ctx) {
    String mediatorName = ctx.MEDIATORNAME().getText();
    String configurations =
        StringParserUtil.getValueWithinDoubleQuotes(ctx.ARGUMENTLISTDEF().getText());
    Mediator mediator = MediatorFactory.getInstance().getMediator(mediatorName, configurations);
    if (ifMultiThenBlockStarted) {
      filterMediatorStack.peek().addThenMediator(mediator);

    } else if (ifElseBlockStarted) {
      filterMediatorStack.peek().addOtherwiseMediator(mediator);

    } else {
      integrationFlow.getEsbConfigHolder().getPipeline(pipelineStack.peek()).addMediator(mediator);
    }
    super.exitMessageProcessingDef(ctx);
  }
 @Override
 public void exitConditionStatement(WUMLParser.ConditionStatementContext ctx) {
   String sourceDefinition =
       StringParserUtil.getValueWithinDoubleQuotes(ctx.conditionDef().SOURCEDEF().getText());
   Source source = new Source(sourceDefinition);
   Condition condition =
       new Condition(
           source,
           Pattern.compile(
               StringParserUtil.getValueWithinDoubleQuotes(
                   ctx.conditionDef().PATTERNDEF().getText())));
   FilterMediator filterMediator = new FilterMediator(condition);
   integrationFlow
       .getEsbConfigHolder()
       .getPipeline(pipelineStack.peek())
       .addMediator(filterMediator);
   filterMediatorStack.push(filterMediator);
   super.exitConditionStatement(ctx);
 }
 @Override
 public void exitInboundEndpointDefStatement(WUMLParser.InboundEndpointDefStatementContext ctx) {
   String protocolName =
       StringParserUtil.getValueWithinDoubleQuotes(
           ctx.inboundEndpointDef().PROTOCOLDEF().getText());
   int port =
       Integer.parseInt(
           StringParserUtil.getValueWithinBrackets(ctx.inboundEndpointDef().PORTDEF().getText()));
   String context =
       StringParserUtil.getValueWithinDoubleQuotes(
           ctx.inboundEndpointDef().CONTEXTDEF().getText());
   InboundEndpoint inboundEndpoint =
       InboundEndpointFactory.getInboundEndpoint(
           InboundEndpointType.valueOf(protocolName), ctx.INBOUNDENDPOINTNAME().getText(), port);
   if (inboundEndpoint instanceof HTTPInboundEP) {
     ((HTTPInboundEP) inboundEndpoint).setContext(context);
   }
   integrationFlow.getEsbConfigHolder().setInboundEndpoint(inboundEndpoint);
   super.exitInboundEndpointDefStatement(ctx);
 }
  @Override
  public void exitInvokeToSource(WUMLParser.InvokeToSourceContext ctx) {
    Mediator mediator = MediatorFactory.getInstance().getMediator("respond", null);
    if (ifMultiThenBlockStarted) {
      filterMediatorStack.peek().addThenMediator(mediator);

    } else if (ifElseBlockStarted) {
      filterMediatorStack.peek().addOtherwiseMediator(mediator);

    } else {
      //            String mediatorName =
      // StringParserUtil.getValueWithinDoubleQuotes(ctx.MEDIATORNAMESTRINGX().getText());
      //            String configurations =
      // StringParserUtil.getValueWithinDoubleQuotes(ctx.CONFIGSDEF().getText());
      //            Mediator mediator =
      // MediatorFactory.getMediator(MediatorType.valueOf(mediatorName), configurations);
      integrationFlow.getEsbConfigHolder().getPipeline(pipelineStack.peek()).addMediator(mediator);
    }
    pipelineStack.pop();
    super.exitInvokeToSource(ctx);
  }
 @Override
 public void exitPipelineDefStatement(WUMLParser.PipelineDefStatementContext ctx) {
   Pipeline pipeline = new Pipeline(ctx.PIPELINENAME().getText());
   integrationFlow.getEsbConfigHolder().addPipeline(pipeline);
   super.exitPipelineDefStatement(ctx);
 }