{"id":1813,"date":"2020-10-05T14:18:51","date_gmt":"2020-10-05T14:18:51","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/project-hygiene\/sub-microflows-that-are-used-in-nanoflows-should-be-prefixed-properly\/"},"modified":"2022-06-15T06:52:34","modified_gmt":"2022-06-15T06:52:34","slug":"microflowprojecthygienesubinnanoflow","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/project-hygiene\/microflowprojecthygienesubinnanoflow","title":{"rendered":"Sub-Microflows that are used in Nanoflows should be prefixed properly"},"content":{"rendered":"\n<p>Introduced in version 2.1 (Released November 3rd)<\/p>\n\n\n\n<p>Since the release of Mendix 8.2, it is possible to <a rel=\"noreferrer noopener\" aria-label=\"call a microflows from a nanoflow (opens in a new tab)\" href=\"https:\/\/docs.mendix.com\/releasenotes\/studio-pro\/8.2#call-microflows-from-nanoflows\" target=\"_blank\">call a microflow from a nanoflow<\/a>. It is a requirement to give these microflows permission. If these are called with the prefix SUB_ you may encounter violations in the rule <a href=\"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/security\/microflowunneccesarypermissions\" target=\"_blank\" rel=\"noreferrer noopener\">Microflow should only have permissions if used from a page<\/a>. To prevent this violation, we advise sub-microflows that are called from a nanoflow to be named with the prefix <strong>NSub_ <\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"186\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-2.png\" alt=\"\" class=\"wp-image-1825\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-2.png 406w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-2-300x137.png 300w\" sizes=\"(max-width: 406px) 100vw, 406px\" \/><\/figure><\/div>\n\n\n\n<p><strong>Non-compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"171\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-5.png\" alt=\"\" class=\"wp-image-1828\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-5.png 750w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-5-480x109.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 750px, 100vw\" \/><figcaption>The microflow CalledFromNanoflow_NotOK &amp; SUB_Microflow_NotOK has the wrong naming convention because they are called from a nanoflow<\/figcaption><\/figure>\n\n\n\n<p><strong>Compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"664\" height=\"143\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-3.png\" alt=\"\" class=\"wp-image-1826\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-3.png 664w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-3-480x103.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 664px, 100vw\" \/><figcaption> The microflow NSub_Microflow_OK is correctly named because it&#8217;s called from a nanoflow <\/figcaption><\/figure>\n\n\n\n<p>Sub-Microflows that are used in Nanoflows should be prefixed <strong>NSub_<\/strong><\/p>\n\n\n\n<p>If you want to use a sub-microflow from a microflow AND a nanoflow, you need to be aware of its <a rel=\"noreferrer noopener\" aria-label=\"permissions (opens in a new tab)\" href=\"https:\/\/sdf-docs.clevr.com\/docs\/acr-rules\/security\/microflowunneccesarypermissions\/\" target=\"_blank\">permissions<\/a>. In this case, we advise using a special Nsub_ wrapper (with permissions) in the nanoflow that calls the SUB_microflow (with no permission) that is also used as a regular sub-microflow.<\/p>\n","protected":false},"featured_media":0,"parent":100,"menu_order":31,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-1813","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1813"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1813"}],"version-history":[{"count":10,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1813\/revisions"}],"predecessor-version":[{"id":2459,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1813\/revisions\/2459"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/100"}],"next":[{"title":"There should be no ToDo annotations in the project","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/project-hygiene\/todoannotations","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/291"}],"prev":[{"title":"Sub-microflows should be prefixed correctly","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/project-hygiene\/microflowprefixsubmicroflows","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1110"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1813"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=1813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}