{"id":197,"date":"2010-07-09T20:38:18","date_gmt":"2010-07-10T01:38:18","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=197"},"modified":"2021-03-09T00:34:37","modified_gmt":"2021-03-09T05:34:37","slug":"powerbuilder-plug-in-applications","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-plug-in-applications\/","title":{"rendered":"PowerBuilder &#8211; &#8216;Plug in&#8217; Applications"},"content":{"rendered":"<p>I helped develop a special order processing application which was both a stand alone application as well as a &#8216;plug in&#8217; into a couple of existing apps.  By &#8216;plug in&#8217; I mean the same windows and functionality was brought into the existing applications without any significant changes.  Part of the trick in doing this is in the set up of the application libraries (.PBL files).<br \/>\nAll of the applications were MDI.<\/p>\n<p>The application library list had evolved over time into the following generalized pattern:<\/p>\n<pre>app.pbl &gt; target, project, frame menu, application manager (PFC based) and frame\nwindow.pbl &gt; all windows\ndataobject.pbl &gt; dataobjects\nservice.pbl &gt; general service type objects with limited business rules\nbusiness.pbl &gt; objects pertaining to business rules\nreport.pbl &gt; report dataobjects\neverything else including PFC libraries<\/pre>\n<p>In the order processing application the only change to the pattern was to move the frame menu into the window.pbl.  Each of the other targets had their library lists modified to include the window, dataobject, service, and business PBLs from the order processing app.  One thing to keep in mind with this process is you cannot duplicate object names.  In this case I used a two letter designation for each app and included it in the object name (ie, w_yy_main).<\/p>\n<p>Since these were PFC based applications I had to override some functionality.  In the open events of the Order Processing application windows I overrode the ancestor of the Open event and placed the following code:<\/p>\n<pre name=\"code\" class=\"VB\">\/\/ override ancestor\ninteger li_rc\nMENU       lm_WindowMenu\nstring ls_app\nls_app = gnv_app.of_getappname()\nIF (ls_app = &#039;CPRS&#039;) THEN\n\tlm_WindowMenu = CREATE USING &#039;m_cpr_frame&#039;\n\tli_rc = this.ChangeMenu (lm_WindowMenu)\nEND IF\nIF (ls_app = &#039;BRCOST&#039;) THEN\n\tlm_WindowMenu = CREATE USING &#039;m_main&#039;\n\tli_rc = this.ChangeMenu (lm_WindowMenu)\nEND IF\nsuper::event open()<\/pre>\n<p>This allows for the windows to have separate menus based on the application they are running in.  In the above code, if the Order Processing app was running it would use its own menu, otherwise it would use one of the other app menus.  The Order Processing windows had mostly self contained functionality.  By this I mean they had save, cancel, retrieve, etc. type buttons on them and did not make use of menu commands.  You could build in menu commands but I didn&#8217;t have the time on this particular project.  The apps also connected to separate databases (three total) which were handled by separate transaction objects.<\/p>\n<p>One thing to keep in mind about this type of approach is that any code changes to the common objects in the Order Processing application necessitated a rebuild of the other applications which made use of them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I helped develop a special order processing application which was both a stand alone application as well as a &#8216;plug in&#8217; into a couple of existing apps. By &#8216;plug in&#8217; I mean the same windows and functionality was brought into the existing applications without any significant changes. Part of the trick in doing this is&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[12,16],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/197"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=197"}],"version-history":[{"count":16,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/197\/revisions"}],"predecessor-version":[{"id":1759,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/197\/revisions\/1759"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}