<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    jBPM Services 
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="https://community.jboss.org/people/swiderski.maciej">Maciej Swiderski</a> in <i>jBPM</i> - <a href="https://community.jboss.org/docs/DOC-19754">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>This document focus is to describe a service layer on top of the jBPM5 runtime</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><em><strong>Following content is just for discussion purpose and everyone is invited to leave comments, ideas, requirements.</strong></em></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Couple of initial thoughts on what should be available. First of all I think that there is a need for different kinds of services:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>updated diagram to include recent comments</p><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/19229/jbpm-services.png"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/19229/jbpm-services.png </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li style="text-align: start;">transport layer - responsible for providing access to the services remotely over different transports</li><li style="text-align: start;">business services - most obvious provides straight operations understandable from business point of view like startProcess, signalProcess, addData/Variable but it does not limit to processes it should provide ht services too</li><li style="text-align: start;">session services - way of controlling and altering session and its configuration</li><li style="text-align: start;">knowledge service - way of controlling and altering knowledge base</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">These services are built one on another where knowledge services are at the bottom and business services on top. That means upstream services rely on downstream services.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;"><strong>Business services</strong> are more like an extension to what we have available over REST API but completely isolated from the transport specifics. It just provides POJO services that can be used both locally and remotely with well defined data structures that it accepts and return. downstream services will get injected into business services to perform operations.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;"><strong>Session services</strong> are mainly dedicated to manage sessions, in two aspects:</p><ol><li style="text-align: start;">Configuration - provide an easy way of configuring session management that covers session settings itself (persistence, handlers, listeners, etc) as well as life cycle of it (when to dispose, when to reload) and support for multi session configuration.</li><li style="text-align: start;">Runtime - allows to operate on the session - in most of the cases session API should be enough here</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">Configuration</p><ul><li style="text-align: start;">register handlers</li><li style="text-align: start;">add/remove event listeners</li><li style="text-align: start;">set configuration properties</li><li style="text-align: start;">etc</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">Runtime</p><ul><li style="text-align: start;">executing commands</li><li style="text-align: start;">insert/update/retract facts</li><li style="text-align: start;">fire rules</li><li style="text-align: start;">query working memory</li><li style="text-align: start;">etc</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;"><strong>Knowledge services</strong></p><p style="text-align: start;">responsible for providing business assets into the runtime, so it is mainly configuration related services. adding removing assets, reconfiguring knowledge agent if is used, etc</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">As one of the consumers of these services is console, it could be good to be able to use console not only to simple start/signal process and complete tasks but as well (based on user roles) maintain the environment - knowledge base, sessions etc.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="https://community.jboss.org/docs/DOC-19754">going to Community</a></p>

        <p style="margin: 0;">Create a new document in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>