The first two parts of this series dealt with overview of the process (Central MDM Business Partner Creation Scenario with Galaxy (BPM) – Part I) and some implementation details (Central MDM Business Partner Creation Scenario with Galaxy (BPM) – Part II) respectively. In this third and final part I’ll talk about the rules integration as well as remote invocation of the process.
As a memory refresher – we wanted a rule such that if the new business partner record doesn’t have a SSN entered the record should be manually approved. Otherwise it should be approved automatically.
Think of this rule as a function which takes two arguments – “context” which passes the entire web dynpro context to the function and “return” of type Boolean which is set to true if manual approval is needed and false otherwise. The rule engine will pick up the SSN entry from the context, evaluate it and set return accordingly.
Here’s the rule at design time:
Since the return type is Boolean we can conveniently assign this function as a condition to the non-default gate of the exclusive choice gateway. Check the process model in Central MDM Business Partner Creation Scenario with Galaxy (BPM) – Part I for clarification.
For example, if you have called the ruleset as “checkApprovalMethod” and if the non-default gate for the exclusive choice is the one for auto-approval, then as a condition for this gate you can write: not(checkApprovalMethod(Context,IsAutoApproval)). So this gate will be taken by the process if the condition evaluates to true. Here Context and IsAutoApproval are two data-objects that you have created. IsAutoApproval is of type Boolean here.
So much for the rule, let’s look at the way to start the process remotely. True to BPMN standards, every Galaxy process model has a Start event which can be bound to a web service interface and an operation of that interface. We can also handcraft wsdl files to suit our needs and bind it to the start event.
For example, in this scenario I had to pass the record ID to the process context when the process is started. So I added the following XML element to the default process start web service WSDL provided by Galaxy.
Logically if we invoke this web service operation manually it should start the process and that is exactly what happens! All you need to do is find out the URL of the wsdl of this web service from the NWA and the rest is easy. Since I was using web dynpro, I simply created an adaptive web service model out of this web service and invoked the operation on click of a button.
That brings us to the end of this series. Let me know if you have any questions regarding the implementation or about this scenario by posting your comments.