{"action":"created","comment":{"url":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/comments/173987734","pull_request_review_id":103265976,"id":173987734,"diff_hunk":"@@ -13,45 +13,98 @@ If you peak under the covers, you'll note that we have a number of different map\n \n | Type | Description |\n | --- | --- |\n-| 1 | Direct mapping. Assigning the value from var1 to var2. No other implied logic. |\n-| 2 | A literal mapping. For example, mapping the string \"hello\" to a string typed variable. |\n-| 3 | Reserved for future use. |\n-| 4 | Complex object. Used when a JSON-based complex object must be built and assigned. |\n+| assign | Direct mapping. Assigning the value from var1 to var2. No other implied logic. |\n+| literal | A literal mapping. For example, mapping the string \"hello\" to a string typed variable. |\n+| expression | Expression mapping.  This enable using functions and expression condition in mamping|\n+| object | Complex object. Used when a JSON-based complex object must be built and assigned. |\n+| array | Array mapping. Mapping an Array of Objects. |\n \n Types manifest themselves directly in your application json, as follows:\n \n ```json\n {\n   \"mapTo\": \"ISBN\",\n-  \"type\": 1,\n+  \"type\": \"assign\",\n   \"value\": \"evt.ISBN\"\n }\n ```\n \n-The obove mapping indicates that the value of evt.ISBN should be mapped to the variables named ISBN. This is a type 1 mapping, hence the value of evnt.ISBN is assigned directly to ISBN. Consider two additional samples, below you will find a type 2 mapping, as well as a complex object, type 4 mapping.\n+The above mapping indicates that the value of evt.ISBN should be mapped to the variable named ISBN. This is a type assign mapping, hence the value of evt.ISBN is assigned directly to ISBN. Consider two additional samples, below you will find a type literal mapping, as well as a complex object type object mapping.\n+\n+Type literal:\n \n-Type 2:\n ```json\n {\n   \"mapTo\": \"ISBN\",\n-  \"type\": 2,\n+  \"type\": \"literal\",\n   \"value\": \"12937\"\n }\n ```\n \n-Type 4:\n+Type object:\n+\n ```json\n {\n   \"mapTo\": \"ISBN\",\n-  \"type\": 4,\n+  \"type\": \"object\",\n   \"value\": { \"ISBN\": \"12937\", \"Author\": \"{{$flow.Author}}\" }\n }\n ```\n-\n-The type 2 mapping is pretty simple to understand, however type 4 does require a bit of an explanation. Note that the value param is assigned an object, not a string, and also note the use of the template style variable injection. You can use \"{{ }}\" when you need to inject the value of another object into your complex object. If you assign the value of an array then that param will be treated as an array, likewise for a string, int, etc. For example, let us pretend flow.Author is an array, then the Author object would be an array. In otherwords, direct assignment is occurring.\n+The type literal mapping is pretty simple to understand, however type object does require a bit of an explanation. Note that the value param is assigned an object, not a string, and also note the use of the template style variable injection. You can use \"{{ }}\" when you need to inject the value of another object into your complex object. If you assign the value of an array then that param will be treated as an array, likewise for a string, int, etc. For example, let us pretend flow.Author is an array, then the Author object would be an array. In otherwords, direct assignment is occurring.\n \n The WebUI insulates you frome much of this understanding and will infer the correct mapping type.\n \n+\n+Type expression:\n+\n+```json\n+{\n+  \"type\": \"expression\",","path":"docs/content/development/flows/mapping.md","position":62,"original_position":62,"commit_id":"01a318d57267d6a90336cbf8fb3710a61caea650","original_commit_id":"01a318d57267d6a90336cbf8fb3710a61caea650","user":{"login":"mellistibco","id":16921208,"avatar_url":"https://avatars2.githubusercontent.com/u/16921208?v=4","gravatar_id":"","url":"https://api.github.com/users/mellistibco","html_url":"https://github.com/mellistibco","followers_url":"https://api.github.com/users/mellistibco/followers","following_url":"https://api.github.com/users/mellistibco/following{/other_user}","gists_url":"https://api.github.com/users/mellistibco/gists{/gist_id}","starred_url":"https://api.github.com/users/mellistibco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mellistibco/subscriptions","organizations_url":"https://api.github.com/users/mellistibco/orgs","repos_url":"https://api.github.com/users/mellistibco/repos","events_url":"https://api.github.com/users/mellistibco/events{/privacy}","received_events_url":"https://api.github.com/users/mellistibco/received_events","type":"User","site_admin":false},"body":"we should remove the literal mapping example from 'expression' type. we should encourage the correct mapping type usage. this will give us flexibility in the future","created_at":"2018-03-13T00:35:00Z","updated_at":"2018-03-13T00:35:00Z","html_url":"https://github.com/TIBCOSoftware/flogo/pull/178#discussion_r173987734","pull_request_url":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/178","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/comments/173987734"},"html":{"href":"https://github.com/TIBCOSoftware/flogo/pull/178#discussion_r173987734"},"pull_request":{"href":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/178"}},"in_reply_to_id":173618374},"pull_request":{"url":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/178","id":173921364,"html_url":"https://github.com/TIBCOSoftware/flogo/pull/178","diff_url":"https://github.com/TIBCOSoftware/flogo/pull/178.diff","patch_url":"https://github.com/TIBCOSoftware/flogo/pull/178.patch","issue_url":"https://api.github.com/repos/TIBCOSoftware/flogo/issues/178","number":178,"state":"open","locked":false,"title":"Expression mapper doc","user":{"login":"lixingwang","id":987686,"avatar_url":"https://avatars3.githubusercontent.com/u/987686?v=4","gravatar_id":"","url":"https://api.github.com/users/lixingwang","html_url":"https://github.com/lixingwang","followers_url":"https://api.github.com/users/lixingwang/followers","following_url":"https://api.github.com/users/lixingwang/following{/other_user}","gists_url":"https://api.github.com/users/lixingwang/gists{/gist_id}","starred_url":"https://api.github.com/users/lixingwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lixingwang/subscriptions","organizations_url":"https://api.github.com/users/lixingwang/orgs","repos_url":"https://api.github.com/users/lixingwang/repos","events_url":"https://api.github.com/users/lixingwang/events{/privacy}","received_events_url":"https://api.github.com/users/lixingwang/received_events","type":"User","site_admin":false},"body":"@vijaynalawade please correct or add anything that I might miss.","created_at":"2018-03-09T05:19:02Z","updated_at":"2018-03-13T00:35:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5301826bec37e00b211ad0bdea3bc42ad21e47f1","assignee":null,"assignees":[],"requested_reviewers":[{"login":"vijaynalawade","id":7453716,"avatar_url":"https://avatars1.githubusercontent.com/u/7453716?v=4","gravatar_id":"","url":"https://api.github.com/users/vijaynalawade","html_url":"https://github.com/vijaynalawade","followers_url":"https://api.github.com/users/vijaynalawade/followers","following_url":"https://api.github.com/users/vijaynalawade/following{/other_user}","gists_url":"https://api.github.com/users/vijaynalawade/gists{/gist_id}","starred_url":"https://api.github.com/users/vijaynalawade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijaynalawade/subscriptions","organizations_url":"https://api.github.com/users/vijaynalawade/orgs","repos_url":"https://api.github.com/users/vijaynalawade/repos","events_url":"https://api.github.com/users/vijaynalawade/events{/privacy}","received_events_url":"https://api.github.com/users/vijaynalawade/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/178/commits","review_comments_url":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/178/comments","review_comment_url":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TIBCOSoftware/flogo/issues/178/comments","statuses_url":"https://api.github.com/repos/TIBCOSoftware/flogo/statuses/01a318d57267d6a90336cbf8fb3710a61caea650","head":{"label":"TIBCOSoftware:expr-mapper-doc","ref":"expr-mapper-doc","sha":"01a318d57267d6a90336cbf8fb3710a61caea650","user":{"login":"TIBCOSoftware","id":4186383,"avatar_url":"https://avatars0.githubusercontent.com/u/4186383?v=4","gravatar_id":"","url":"https://api.github.com/users/TIBCOSoftware","html_url":"https://github.com/TIBCOSoftware","followers_url":"https://api.github.com/users/TIBCOSoftware/followers","following_url":"https://api.github.com/users/TIBCOSoftware/following{/other_user}","gists_url":"https://api.github.com/users/TIBCOSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/TIBCOSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TIBCOSoftware/subscriptions","organizations_url":"https://api.github.com/users/TIBCOSoftware/orgs","repos_url":"https://api.github.com/users/TIBCOSoftware/repos","events_url":"https://api.github.com/users/TIBCOSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/TIBCOSoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":62978868,"name":"flogo","full_name":"TIBCOSoftware/flogo","owner":{"login":"TIBCOSoftware","id":4186383,"avatar_url":"https://avatars0.githubusercontent.com/u/4186383?v=4","gravatar_id":"","url":"https://api.github.com/users/TIBCOSoftware","html_url":"https://github.com/TIBCOSoftware","followers_url":"https://api.github.com/users/TIBCOSoftware/followers","following_url":"https://api.github.com/users/TIBCOSoftware/following{/other_user}","gists_url":"https://api.github.com/users/TIBCOSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/TIBCOSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TIBCOSoftware/subscriptions","organizations_url":"https://api.github.com/users/TIBCOSoftware/orgs","repos_url":"https://api.github.com/users/TIBCOSoftware/repos","events_url":"https://api.github.com/users/TIBCOSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/TIBCOSoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TIBCOSoftware/flogo","description":"Project Flogo","fork":false,"url":"https://api.github.com/repos/TIBCOSoftware/flogo","forks_url":"https://api.github.com/repos/TIBCOSoftware/flogo/forks","keys_url":"https://api.github.com/repos/TIBCOSoftware/flogo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TIBCOSoftware/flogo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TIBCOSoftware/flogo/teams","hooks_url":"https://api.github.com/repos/TIBCOSoftware/flogo/hooks","issue_events_url":"https://api.github.com/repos/TIBCOSoftware/flogo/issues/events{/number}","events_url":"https://api.github.com/repos/TIBCOSoftware/flogo/events","assignees_url":"https://api.github.com/repos/TIBCOSoftware/flogo/assignees{/user}","branches_url":"https://api.github.com/repos/TIBCOSoftware/flogo/branches{/branch}","tags_url":"https://api.github.com/repos/TIBCOSoftware/flogo/tags","blobs_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/refs{/sha}","trees_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TIBCOSoftware/flogo/statuses/{sha}","languages_url":"https://api.github.com/repos/TIBCOSoftware/flogo/languages","stargazers_url":"https://api.github.com/repos/TIBCOSoftware/flogo/stargazers","contributors_url":"https://api.github.com/repos/TIBCOSoftware/flogo/contributors","subscribers_url":"https://api.github.com/repos/TIBCOSoftware/flogo/subscribers","subscription_url":"https://api.github.com/repos/TIBCOSoftware/flogo/subscription","commits_url":"https://api.github.com/repos/TIBCOSoftware/flogo/commits{/sha}","git_commits_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/commits{/sha}","comments_url":"https://api.github.com/repos/TIBCOSoftware/flogo/comments{/number}","issue_comment_url":"https://api.github.com/repos/TIBCOSoftware/flogo/issues/comments{/number}","contents_url":"https://api.github.com/repos/TIBCOSoftware/flogo/contents/{+path}","compare_url":"https://api.github.com/repos/TIBCOSoftware/flogo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TIBCOSoftware/flogo/merges","archive_url":"https://api.github.com/repos/TIBCOSoftware/flogo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TIBCOSoftware/flogo/downloads","issues_url":"https://api.github.com/repos/TIBCOSoftware/flogo/issues{/number}","pulls_url":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls{/number}","milestones_url":"https://api.github.com/repos/TIBCOSoftware/flogo/milestones{/number}","notifications_url":"https://api.github.com/repos/TIBCOSoftware/flogo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TIBCOSoftware/flogo/labels{/name}","releases_url":"https://api.github.com/repos/TIBCOSoftware/flogo/releases{/id}","deployments_url":"https://api.github.com/repos/TIBCOSoftware/flogo/deployments","created_at":"2016-07-10T02:57:43Z","updated_at":"2018-03-13T00:32:16Z","pushed_at":"2018-03-11T13:32:32Z","git_url":"git://github.com/TIBCOSoftware/flogo.git","ssh_url":"git@github.com:TIBCOSoftware/flogo.git","clone_url":"https://github.com/TIBCOSoftware/flogo.git","svn_url":"https://github.com/TIBCOSoftware/flogo","homepage":"http://flogo.io","size":15379,"stargazers_count":414,"watchers_count":414,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":67,"mirror_url":null,"archived":false,"open_issues_count":32,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":67,"open_issues":32,"watchers":414,"default_branch":"master"}},"base":{"label":"TIBCOSoftware:master","ref":"master","sha":"8165c20c08ff5fd07c9a4efede62deaee1d98154","user":{"login":"TIBCOSoftware","id":4186383,"avatar_url":"https://avatars0.githubusercontent.com/u/4186383?v=4","gravatar_id":"","url":"https://api.github.com/users/TIBCOSoftware","html_url":"https://github.com/TIBCOSoftware","followers_url":"https://api.github.com/users/TIBCOSoftware/followers","following_url":"https://api.github.com/users/TIBCOSoftware/following{/other_user}","gists_url":"https://api.github.com/users/TIBCOSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/TIBCOSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TIBCOSoftware/subscriptions","organizations_url":"https://api.github.com/users/TIBCOSoftware/orgs","repos_url":"https://api.github.com/users/TIBCOSoftware/repos","events_url":"https://api.github.com/users/TIBCOSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/TIBCOSoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":62978868,"name":"flogo","full_name":"TIBCOSoftware/flogo","owner":{"login":"TIBCOSoftware","id":4186383,"avatar_url":"https://avatars0.githubusercontent.com/u/4186383?v=4","gravatar_id":"","url":"https://api.github.com/users/TIBCOSoftware","html_url":"https://github.com/TIBCOSoftware","followers_url":"https://api.github.com/users/TIBCOSoftware/followers","following_url":"https://api.github.com/users/TIBCOSoftware/following{/other_user}","gists_url":"https://api.github.com/users/TIBCOSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/TIBCOSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TIBCOSoftware/subscriptions","organizations_url":"https://api.github.com/users/TIBCOSoftware/orgs","repos_url":"https://api.github.com/users/TIBCOSoftware/repos","events_url":"https://api.github.com/users/TIBCOSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/TIBCOSoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TIBCOSoftware/flogo","description":"Project Flogo","fork":false,"url":"https://api.github.com/repos/TIBCOSoftware/flogo","forks_url":"https://api.github.com/repos/TIBCOSoftware/flogo/forks","keys_url":"https://api.github.com/repos/TIBCOSoftware/flogo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TIBCOSoftware/flogo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TIBCOSoftware/flogo/teams","hooks_url":"https://api.github.com/repos/TIBCOSoftware/flogo/hooks","issue_events_url":"https://api.github.com/repos/TIBCOSoftware/flogo/issues/events{/number}","events_url":"https://api.github.com/repos/TIBCOSoftware/flogo/events","assignees_url":"https://api.github.com/repos/TIBCOSoftware/flogo/assignees{/user}","branches_url":"https://api.github.com/repos/TIBCOSoftware/flogo/branches{/branch}","tags_url":"https://api.github.com/repos/TIBCOSoftware/flogo/tags","blobs_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/refs{/sha}","trees_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TIBCOSoftware/flogo/statuses/{sha}","languages_url":"https://api.github.com/repos/TIBCOSoftware/flogo/languages","stargazers_url":"https://api.github.com/repos/TIBCOSoftware/flogo/stargazers","contributors_url":"https://api.github.com/repos/TIBCOSoftware/flogo/contributors","subscribers_url":"https://api.github.com/repos/TIBCOSoftware/flogo/subscribers","subscription_url":"https://api.github.com/repos/TIBCOSoftware/flogo/subscription","commits_url":"https://api.github.com/repos/TIBCOSoftware/flogo/commits{/sha}","git_commits_url":"https://api.github.com/repos/TIBCOSoftware/flogo/git/commits{/sha}","comments_url":"https://api.github.com/repos/TIBCOSoftware/flogo/comments{/number}","issue_comment_url":"https://api.github.com/repos/TIBCOSoftware/flogo/issues/comments{/number}","contents_url":"https://api.github.com/repos/TIBCOSoftware/flogo/contents/{+path}","compare_url":"https://api.github.com/repos/TIBCOSoftware/flogo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TIBCOSoftware/flogo/merges","archive_url":"https://api.github.com/repos/TIBCOSoftware/flogo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TIBCOSoftware/flogo/downloads","issues_url":"https://api.github.com/repos/TIBCOSoftware/flogo/issues{/number}","pulls_url":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls{/number}","milestones_url":"https://api.github.com/repos/TIBCOSoftware/flogo/milestones{/number}","notifications_url":"https://api.github.com/repos/TIBCOSoftware/flogo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TIBCOSoftware/flogo/labels{/name}","releases_url":"https://api.github.com/repos/TIBCOSoftware/flogo/releases{/id}","deployments_url":"https://api.github.com/repos/TIBCOSoftware/flogo/deployments","created_at":"2016-07-10T02:57:43Z","updated_at":"2018-03-13T00:32:16Z","pushed_at":"2018-03-11T13:32:32Z","git_url":"git://github.com/TIBCOSoftware/flogo.git","ssh_url":"git@github.com:TIBCOSoftware/flogo.git","clone_url":"https://github.com/TIBCOSoftware/flogo.git","svn_url":"https://github.com/TIBCOSoftware/flogo","homepage":"http://flogo.io","size":15379,"stargazers_count":414,"watchers_count":414,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":67,"mirror_url":null,"archived":false,"open_issues_count":32,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":67,"open_issues":32,"watchers":414,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/178"},"html":{"href":"https://github.com/TIBCOSoftware/flogo/pull/178"},"issue":{"href":"https://api.github.com/repos/TIBCOSoftware/flogo/issues/178"},"comments":{"href":"https://api.github.com/repos/TIBCOSoftware/flogo/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TIBCOSoftware/flogo/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/TIBCOSoftware/flogo/statuses/01a318d57267d6a90336cbf8fb3710a61caea650"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mellistibco"}}