Topic
17 replies Latest Post - ‏2012-02-25T05:54:24Z by kolban
SystemAdmin
SystemAdmin
7615 Posts
ACCEPTED ANSWER

Pinned topic Starting a process from an email message

‏2011-05-12T15:44:36Z |
Hello, i would need an example about how to start a new process instance when i send a message from my email client.

Thank you very much in advanced
Updated on 2012-02-25T05:54:24Z at 2012-02-25T05:54:24Z by kolban
  • JohnT.Reynolds
    JohnT.Reynolds
    233 Posts
    ACCEPTED ANSWER

    Re: Starting a process from an email message

    ‏2011-05-12T16:37:52Z  in response to SystemAdmin
    Do you want to start a process, or run a task within a runnning process?

    Either way, the secret is to know the URL of a stand-alone service or the URL to run a Task.

    http://wiki.lombardi.com/display/commwiki/Lombardi+Edition+-+URLs+to+run+BPDs%2C+Services+and+Tasks

    http://host_name:port/teamworks/executeServiceByName ?processApp=acronym&serviceName=MyService
    or
    http://server:port/teamworks/process.lsw?zWorkflowState=1&zTaskId=101

    Embed a link like this in the email.

    If you want to start a process, then insert a UCA in you service to send a Start Message to your process.
    • JoeRyan
      JoeRyan
      5 Posts
      ACCEPTED ANSWER

      Re: Starting a process from an email message

      ‏2012-02-23T20:28:26Z  in response to JohnT.Reynolds
      I am using BPM version 7.5 standard - is there an issue passing parameters on a URL like:
      http://host:port/teamworks/executeServiceByName?processApp=RHILA&serviceName=svcApproval&tw_local_requestNumber=1329952620055

      The parameter passing works in Lombardi 6.1 but does not seem to be working in 7.5

      Any help would be appreciated.
      thaks
      Joe
      • kolban
        kolban
        3314 Posts
        ACCEPTED ANSWER

        Re: Starting a process from an email message

        ‏2012-02-23T20:51:42Z  in response to JoeRyan
        Hi Joe,
        If what you are trying to achieve is the start of a service through a URL click, I am tempted to suggest that what you probably want to look at is using the exposed REST APIs. These became a fully documented and supported part of the product from IBPM 7.5.1 onwards. Specifically, it seems like the following API might be what you need (pointer to InfoCenter):

        http://publib.boulder.ibm.com/infocenter/dmndhelp/v7r5m1/topic/com.ibm.wbpm.bspace.ref.doc/bpmrest-docs/rest_bpm_wle_v1_service_instanceid_post_start.htm

        If you want to start this through a link contained in an Email, I am tempted to suggest that you create a wrapper web page that makes the call rather than attempting to expose this as a direct link in the web page. I say this because it appears that this REST API is a "POST" request as opposed to a simple "GET" request.

        It may seem like a little bit more work, but I feel that the architecture warrants this to make for a clean and clear interface.

        Neil
        • JoeRyan
          JoeRyan
          5 Posts
          ACCEPTED ANSWER

          Re: Starting a process from an email message

          ‏2012-02-24T00:00:03Z  in response to kolban
          The REST API is a nice idea but does not really help. When my process is in flight it knows the key to the persistent data that should be used when the email link is used. If that email link cannot use a parameter (the key to the data) then the target of the URL has no way of obtaining the correct data for the subsequent process/service. I read somewhere that the executeServiceByName method had the parameter issue addressed in 7.5.1 - as I am using 7.5.0 then I'm stuck.
          Is there any other way around this ?
          thanks
          Joe
          • kolban
            kolban
            3314 Posts
            ACCEPTED ANSWER

            Re: Starting a process from an email message

            ‏2012-02-24T02:31:06Z  in response to JoeRyan
            Hi Joe,
            I too believe that 7.5.0 had problems passing in parameters via REST requests and I have validated that in 7.5.1 these issues are no longer a problem. A migration to 7.5.1 would cure that all up ... but I realize that is a "loose" answer. Unfortunately, I think the inability to pass in data to a service was considered a design change when it was added to 7.5.1 so I don't think IBM will fix it at the 7.5.0 to add the missing function.

            Other choices available to us would be JMS and Web Services. I realize that these can't be called directly from an email, but a Web App deployed on WAS 7 could invoke either of these APIs which could trigger work in the IBM BPM runtime. What concerns me the most is the wasted development effort on your part to get function going that is simply "there" in 7.5.1.

            Neil
            • SystemAdmin
              SystemAdmin
              7615 Posts
              ACCEPTED ANSWER

              Re: Starting a process from an email message

              ‏2012-02-24T03:41:45Z  in response to kolban
              You can use event manager Http Controller Send Event.

              In your email message you can embed a HTML form and place a hidden field with name "eventmsg". Use form action as http://localhost:9080/eventmgr/httpcontroller/sendEvent

              and send the input data to BPD through eventmsg XML.

               <script>
              function doSubmit() {
              document.frm.eventmsg.value = "<eventmsg>
              <event processAppShortName='MyProcess'>Start New Instance</event>
              <parameters>
              <parameter>
              <key></key>
              <value></value>
              </parameter>
              <parameter>
              <key></key>
              <value></value>
              </parameter>
              </parameters>
              </eventmsg>";

              document.frm.submit();
              }
              </script>
              <form action="http://localhost:9080/eventmgr/httpcontroller/sendEvent" method="post" name="frm">

              <input type="hidden" name="eventmsg"/>
              <input type="button" value="Launch Process" onclick="doSubmit()">

              </form>


              Make sure the eventmsg xml into single line I broke up to multiple lines for easy to read.

              I did this 5 years back when I was working with version 5.5.6. I hope this code still works in 7.x.

              Thanks,
              Jeelani
              • SystemAdmin
                SystemAdmin
                7615 Posts
                ACCEPTED ANSWER

                Re: Starting a process from an email message

                ‏2012-02-24T03:46:25Z  in response to SystemAdmin
                Appologies for posting such long text! I put the code in pre tag for HTML tags and it formatted with too many number of lines.
                • JoeRyan
                  JoeRyan
                  5 Posts
                  ACCEPTED ANSWER

                  Re: Starting a process from an email message

                  ‏2012-02-24T18:50:47Z  in response to SystemAdmin
                  Thanks for that - I like it , always more than one way to make it co-operate.
                  Joe
                  • kolban
                    kolban
                    3314 Posts
                    ACCEPTED ANSWER

                    Re: Starting a process from an email message

                    ‏2012-02-24T18:59:11Z  in response to JoeRyan
                    Hi guys,
                    I'm from the old school of hard knocks. IBM has a policy that it calls "Clearly defined programming interfaces" which basically means that interfaces that are not documented in writing as being consumable by customers should either not be used or should be used with extreme caution and not at all assured to be there in future releases or may stop working at any time without any IBM support assistance to change that outcome.

                    This may sounds constraining but the implication is actually very positive. IBM provides long term support for customer investments in their own applications. If a customer builds an application on an IBM product, the customer can be assured of the IBM function being supported and available for a long-long time to come. IBM will do its very best to ensure that new releases of the product will be backwards compatible with ... and here is the key phrase ... documented capabilities of previous releases. If we leverage a feature that is not documented, we can't be assured of its continued support.

                    Now ... with all this said ... I simply don't know if the technique mentioned in the last couple of posts is or is not a documented feature ... it is one that I am not personally familiar with (which doesn't mean much) ... so ... I'd ask ... do we have any written evidence that this is a supported feature? Any writings in an InfoCenter or similar manual?

                    Neil
                    • FlournoyHenry
                      FlournoyHenry
                      96 Posts
                      ACCEPTED ANSWER

                      Re: Starting a process from an email message

                      ‏2012-02-24T19:08:12Z  in response to kolban
                      Yes, executeServiceByName is the method described in the URL option to expose a service. They don't explicitly mention passing parameters, but surely that is/should be expected when starting a service.

                      http://publib.boulder.ibm.com/infocenter/dmndhelp/v7r5mx/index.jsp?topic=%2Fcom.ibm.wbpm.wle.editor.doc%2Fmodeling%2Ftopic%2Fcreating_services_C.html
                      Flournoy Henry BP3 Global, Inc. www.bp-3.com
                      • kolban
                        kolban
                        3314 Posts
                        ACCEPTED ANSWER

                        Re: Starting a process from an email message

                        ‏2012-02-24T19:19:29Z  in response to FlournoyHenry
                        Flournoy,
                        Cool stuff. My last post was more speaking about:

                        http://localhost:9080/eventmgr/httpcontroller/sendEvent

                        That was the one that I am not sure about ...

                        But as you have found, the executeServiceByName seems to be captured in the docs but parameter passing is, as you noted, not documented ...

                        I'd probably suggest raising a PMR on that one. If IBM does allow parameters, perhaps we can ask them to create a TechNote showing how the parameters are added. TechNotes add (in my opinion) areas that were meant to work or be covered but somehow missed the manuals.

                        Neil
                        • SystemAdmin
                          SystemAdmin
                          7615 Posts
                          ACCEPTED ANSWER

                          Re: Starting a process from an email message

                          ‏2012-02-24T21:19:00Z  in response to kolban
                          Hi Neil,

                          This is the link of Info Center that talks about posting messages to Event Manager.

                          http://publib.boulder.ibm.com/infocenter/dmndhelp/v7r5m1/topic/com.ibm.wbpm.wle.editor.doc/modeling/topic/sending_message_events.html

                          Thanks,
                          Jeelani
                          • kolban
                            kolban
                            3314 Posts
                            ACCEPTED ANSWER

                            Re: Starting a process from an email message

                            ‏2012-02-24T22:05:15Z  in response to SystemAdmin
                            Hi Jeelani,
                            Excellent link and I fully agree that the InfoCenter page referenced describes the format of a message which, when posted to the IBM BPM Event Manager causes it to process the content. However, what I haven't yet found is any documentation on "how" one would "mechanically" post such a message to the Event Manager? It appears that there are two possibilities (that I have seen). One it to place such an XML message on a JMS queue and the other is to use the HTTP request described earlier. However ... and this is my slight consternation ... I haven't yet seen the HTTP distribution mechanism documented.

                            So ... it seems like we have a great document on building the structure of the message and we know what it should do when delivered ... but then some "magic happens" and the message is delivered. To placate my nervousness, a few lines describing how the message would be delivered would make me much happier.

                            I sense that I am coming over sounding a lot more negative that I am or feel ... I'm just being a "stickler" here. Information and knowledge is my commodity of trade. It frustrates me when extremely talented product designers and developers spend countless hours designing, building and testing capabilities and functions only to miss the last little bit which is the information and instructions to be used by the final end consumers. A lifetime ago I was a product developer and I remember how the creative juices flowed in designing something and then worrying about how to implement it and ... once built and running ... the idea of documenting it for final end users seemed somehow "boring" and ended up being given a lower priority than the next design/development task. When I did a stint out of development working the phone lines for technical support and started fielding usage questions for the product area I had the responsibility of working upon, my eyes were opened to the notion that I had spent months building and only hours documenting so all the months of effort I put into design/development were "of low value" if what I built couldn't be used. I think we are still very far from the day when APIs and functions of middleware products will be "self explanatory" so I like to see instructions for just about everything.

                            Neil
                            • SystemAdmin
                              SystemAdmin
                              7615 Posts
                              ACCEPTED ANSWER

                              Re: Starting a process from an email message

                              ‏2012-02-25T00:01:14Z  in response to kolban
                              Neil,

                              I complete agree with you. I have seen clear documentation in old versions (5.x and 6.x). In Info Center I dont know this documenation left intentionally or they missed it.

                              Now let me ask you a question.

                              When developers seen and followed a documentation/features in previous releases and nothing explictly called out that some of the features are being deprecated in Release Notes and those features are not documented in Newer versions.

                              for example posting message through HTTP Controller How should we take this?

                              Thanks,
                              Jeelani
                              • kolban
                                kolban
                                3314 Posts
                                ACCEPTED ANSWER

                                Re: Starting a process from an email message

                                ‏2012-02-25T03:12:29Z  in response to SystemAdmin
                                Hi Jeelani,
                                I'll be delighted to share my opinion but that is all it will be and I don't want to be mistaken for this to be an official IBM statement :-)

                                If v5.x or v6.x of a product contained a documented feature then I believe that feature should either be present in v7.x as is or documented as being removed in v7.x with a recommendation on how to migrate previous releases to now work on a v7.x release.

                                For example, if I built a solution on v6.x and wanted to get that running on v7.x, I can appreciate that a "migration" may be required. I expect that migration to be as easy as possible. IBM also wants that migration to be as easy as possible and hence features found in earlier releases are almost always carried forward to current and future releases. If there is a solid reason to remove a feature then ideally it is flagged as "deprecated" meaning it is available in 7.0 (example) but explicitly state that it is a candidate for removal in 7.1 (example). If it has to removed with no "deprecation" period, then the next best thing is that it has a well documented replacement and/or a recipe from how to get from "where we are" to "where we need to be".

                                Again, all of this is abstract and philosophical and mostly my opinion only. However, IBM is staffed by people who put their pants on one leg at a time like the rest of us and mistakes and omissions can and do happen. If a feature that we used in previous releases is simply not documented in the current release then there is a distinct possibility that the a mistake was made and it failed to make it into the current documentation. This is especially possible where significant changes occurs like, oh ... lets say ... IBM buys Lombardi who had a 6.x product and as part of the process of making the acquisition an integral part of IBM, decides to do away with PDF manuals and provide the documentation as on-line, web accessible InfoCenters ... I could trivially imagine a feature slipping through the cracks in the docs. As such, what we need is clarification.

                                IBM provides a support service for customers who have purchased the product. This is colloquially known as "raising a PMR". I'd suggest raising a PMR asking the question "I have a Lombardi 6.x solution that uses a capability called HTTP Controller. It can be found documented in the 6.x manuals here <insert link>. I am now working on IBM BPM 7.x and in reviewing the InfoCenters can no longer find this capability documented. Can you clarify if this is a documentation omission (and if so fix it) or if this feature has been removed and, if that is the case, what IBM's alternative to that feature may be? ... Many thanks <insert your name>"

                                I'm really intrigued to see the answer to this one now. Remember, these forums are "just us shooting the breeze together" and should not be taken as formal alternatives to support. My thoughts and answers could trivially be wrong (and commonly are). There may already be documentation on this feature somewhere in the docs and we just haven't found it yet.

                                Neil
                            • SystemAdmin
                              SystemAdmin
                              7615 Posts
                              ACCEPTED ANSWER

                              Re: Starting a process from an email message

                              ‏2012-02-25T04:20:53Z  in response to kolban
                              The posting of event messages was documented in TeamWorks 5 and 6 and was an accepted practice in those versions of the product. Much of this documentation was lost or buried when the documentation was chaffed for info center. Even if the feature were totally removed you would only have to surface your EM call in a WebService and write your own JSP to pRse the XML and post the WebService call. That can't be more than a day's worth of work. Low risk IMO.

                              Neil - the current development team is given no time for documentation. There are dedicated Information Developers, but. 1). They aren't the ones writing the new code, and 2) they aren't going back and making up for the fact that Lombardi under invested in ID for years (all of TeamWorks 7 was documented by essentially a single person)
                              • kolban
                                kolban
                                3314 Posts
                                ACCEPTED ANSWER

                                Re: Starting a process from an email message

                                ‏2012-02-25T05:54:24Z  in response to SystemAdmin
                                Hi Andrew, thanks for the post. Great stuff. It is disappointing to hear that development schedules don't appear to allow for sufficient time for documentation creation and review. As I mentioned in my previous posts, it was a real eye opener to me (as a developer) when I came face to face with consumers who couldn't use the function I had invested blood, sweat and tears into getting right solely because there wasn't adequate documentation to consume it.

                                I can't help but feel that if I were an IBM product developer I'd be scanning forum posts, defect report lists and (especially) reading the product manuals myself to try and find our how consumers were thinking about my work. Maybe I am being too idealistic, but programmers (and that definitely includes me) like it very much when their work is used and appreciated. Artists don't sculpt or paint and then hide their creations in the basement where no-one can seem them yet that seems to be what happens with vendor software when the documentation isn't sufficient.

                                I've worked with dozens of products over the last two decades and what we are describing (your posts and mine) is nothing new. Actually, in my opinion, the documentation for IBM BPM is a lot better than I have seen of other IBM products. I once got so irritated at really poor product documentation (many years ago) that I sought out the writers and offered my own time to assist them in any way I could. After a few days of working with them, I came to the horrendous conclusion that they themselves had no idea what the product was intended to do never mind how it actually did it. Apparently the notes given to them by development talked in terms of the underlying implementation and not about what the product did.

                                I don't have much personal contact with the IBMers who write the IBM BPM manuals but I am fortunate enough to have access to an internal version of the InfoCenter which allows those with access to add comments to articles. These comments are then read by the writers and considered for inclusion or changes in future releases. In my own little happy world, I'd ideally like to see such a feature exposed to the Internet to allow anyone/anywhere to be able to add such comments.

                                But, to end on a positive note ... looking at this forum and elsewhere, it seems we have a thriving community of folks such as yourself who are extremely responsive to questions and thoughts. Although not a replacement for product documentation and support, our merry band of IBM BPM believers seem extremely positive and willing to help.

                                Neil