Mule:可以使用DataWeave设置flowVars吗

Mule:可以使用DataWeave设置flowVars吗,mule,dataweave,Mule,Dataweave,我正在创建一个流,它发出twitter搜索请求,在每个tweet中循环,并推送到目标连接器(文件、jdbc等)。我希望在流程的多个步骤中使用user.screenName、text和id等属性。如果没有DataWeave,我的最初反应将是使用消息属性转换步骤来设置FlowVar 所以我的问题是,对于下面的Json负载,DataWeave中是否有更优雅的方法来设置flowVar,以便我可以在整个流范围内利用变量?或者我应该继续利用消息属性转换步骤来设置flowVars吗 Twitter响应JSON

我正在创建一个流,它发出twitter搜索请求,在每个tweet中循环,并推送到目标连接器(文件、jdbc等)。我希望在流程的多个步骤中使用user.screenName、text和id等属性。如果没有DataWeave,我的最初反应将是使用消息属性转换步骤来设置FlowVar

所以我的问题是,对于下面的Json负载,DataWeave中是否有更优雅的方法来设置flowVar,以便我可以在整个流范围内利用变量?或者我应该继续利用消息属性转换步骤来设置flowVars吗

Twitter响应JSON:

{
“sinceId”:0,
“maxId”:677174121147604994,
“refreshUrl”:“?因为\u id=677174121147604994&q=%23MuleSoft&include\u entities=1”,
“计数”:1,
“完成时间”:0.034,
“查询”:“MuleSoft”,
“推特”:[
{
“创建数据”:1450285866000,
“id”:677174121147604994,
“文本”:“连通性基准报告|数码时代的新机遇#MuleSoft”https://t.co/bmHKJAkTy1",
“来源”:“,
“inReplyToStatusId”:-1,
“inReplyToUserId”:-1,
“inReplyToScreenName”:空,
“地理位置”:空,
“地点”:空,
“retweetCount”:0,
“RetweetdStatus”:空,
“用户实体”:[],
“hashtagEntities”:[
{
“开始”:53,
“结束”:64,
“文本”:“数码时代”
},
{
“开始”:65,
“结束”:74,
“文本”:“MuleSoft”
}
],
“媒体实体”:[],
“currentUserRetweetId”:-1,
“用户”:{
“id”:228823277,
“名称”:“尼托集团有限公司”,
“屏幕名称”:“nitorgroup”,
“地点”:“华盛顿特区”,
“描述”:“通过基于标准的解决方案连接整个医疗保健世界。#直接#安全消息传递#HealthBus#互操作性#移动医疗记录#HealthIT”,
“描述实体”:[],
“profileImageUrlHttps”:https://pbs.twimg.com/profile_images/1195068249/Nitor_Logo_128x128_normal.jpg",
“url”:”http://t.co/FTsfFWQcsw",
“跟随者计数”:364,
“状态”:空,
“profileBackgroundColor”:“1A1B1F”,
“profileTextColor”:“666666”,
“profileLinkColor”:“F19E4F”,
“profileSidebarFillColor”:“333333”,
“profileSidebarBorderColor”:“000000”,
“profileUseBackgroundImage”:正确,
“ShowAllineMedia”:错误,
“Friendsont”:1371,
“createdAt”:1292873952000,
“偏爱”:2,
“utcOffset”:-18000,
“时区”:“东部时间(美国和加拿大)”,
“profileBackgroundImageUrl”:http://pbs.twimg.com/profile_background_images/323688620/nitor_twitter_bkgd.jpg",
“profileBackgroundImageUrlHttps”:https://pbs.twimg.com/profile_background_images/323688620/nitor_twitter_bkgd.jpg",
“ProfileBackgroundTilled”:错误,
“郎”:“恩”,
“状态计数”:305,
“译者”:错,
“列表帐户”:15,
“受保护”:错误,
“contributorsEnabled”:false,
“profileImageURL”:http://pbs.twimg.com/profile_images/1195068249/Nitor_Logo_128x128_normal.jpg",
“biggerProfileImageURL”:http://pbs.twimg.com/profile_images/1195068249/Nitor_Logo_128x128_bigger.jpg",
“miniProfileImageURL”:http://pbs.twimg.com/profile_images/1195068249/Nitor_Logo_128x128_mini.jpg",
“originalProfileImageURL”:http://pbs.twimg.com/profile_images/1195068249/Nitor_Logo_128x128.jpg",
“profileImageURLHttps”:https://pbs.twimg.com/profile_images/1195068249/Nitor_Logo_128x128_normal.jpg",
“biggerProfileImageURLHttps”:https://pbs.twimg.com/profile_images/1195068249/Nitor_Logo_128x128_bigger.jpg",
“miniProfileImageURLHttps”:https://pbs.twimg.com/profile_images/1195068249/Nitor_Logo_128x128_mini.jpg",
“originalProfileImageURLHttps”:https://pbs.twimg.com/profile_images/1195068249/Nitor_Logo_128x128.jpg",
“geoEnabled”:正确,
“profileBackgroundImageURL”:http://pbs.twimg.com/profile_background_images/323688620/nitor_twitter_bkgd.jpg",
“profileBannerURL”:空,
“profileBannerRetinaURL”:空,
“profileBannerIPadURL”:空,
“ProfileBanneRipAdrentinaURL”:空,
“profileBannerMobileURL”:空,
“profileBannerMobileRetinaURL”:null,
“已验证”:错误,
“followRequestSent”:false,
“实体”:{
“开始”:0,
"完":22,,
“url”:”http://t.co/FTsfFWQcsw",
“expandedURL”:http://nitorgroup.com",
“displayURL”:“nitorgroup.com”
},
“访问级别”:0,
“rateLimitStatus”:空
},
“截断”:false,
“实体”:[
{
“开始”:75,
"完":98,,
“url”:”https://t.co/bmHKJAkTy1",
“expandedURL”:http://ow.ly/VSHvk",
“显示URL”:“ow.ly/VSHvk”
}
],
“偏爱”:错误,
“转发”:错误,
“我转发”:假,
“可能敏感”:假,
“贡献者”:[],
“访问级别”:0,
“rateLimitStatus”:空
}],
“refreshURL”:“?因为\u id=677174121147604994&q=%23MuleSoft&include\u entities=1”,
“访问级别”:2,
“rateLimitStatus”:{
“剩余”:179,
“限额”:180,
“resetTimeInSeconds”:1450293371,
“secondsUntilReset”:899,
“剩余点击数”:179
}
}
DataWeave:

%dw 1.0
%output application/json
---
{
    screenName: payload.user.screenName,
    tweetId: payload.id,
    tweetText: payload.text
}

查看有关目标的DataWeave文档

简单的答案是肯定的。您可以使用
标记来设置变量。

您可以定义不同的目标来实现这一点:感谢我所寻找的!我主要感到困惑,因为在Anypoint Studio v5.4.0中添加目标时,文档截图略有不同