Friday, February 13, 2015

No longer working with WebMethods

Just wanted to say I'm no longer working with WebMethods so I'm not updating the content here any more or checking comments.  But I will keep the posts here as they are still good references.

Thanks for all the views!

Tuesday, May 28, 2013

Debugging a subscribe flow service without disrupting the existing pub-sub flow for other testing.

So I'm working on a pub-sub model and encountering errors.  To debug I had to disable the trigger to prevent new traffic while I'm debugging, change the pipeline from save to restore and then hold off any other testing from co-workers while I stepped through and made my changes.

It was far from ideal.

So I set out to make it better.  Instead of using the built-in save pipeline and restore pipeline (added in WM8) I went back to the old-school flow services.   I added a debug variable (parallel to my published document variable) and then added a Branch statement on that variable.  If not set (or really anything but "true") then I would save the pipeline, but I added the key data to the file name from my published document, so I could keep them all separate.  So for my interface I added the form number and data.  So my file was handlePOSLog-1000789-2013-05-23.xml.

Now to debug, I just set debug to true and fill in those 2 bits of information in my published document.  When debug was true, the branch statement would do a restore pipeline and load the file that had been run before.

This ended up working out great.  As we were running a test cycle and a bug would come up, I could start my debugger and trace through it while the others were still running test cases.  Many times I could fix the bug right away and we could retest that one and move on.  I also then had a history of all the runs and could reprocess them if needed to check the behavior was still the same.

So it looked like this:

Branch on /debug:
  • true: pub.flow.restorePipelineFromFile
  • $default: pub.flow.savePipelineToFile
I'll remove it before pushing it up to production but it has been a great help in developing the pub-sub interface.

Tuesday, November 13, 2012

Switching from Developer to Designer in 8.2

WebMethods Developer is reaching end-of-life and will no longer be supported by Software AG. Developer is replaced by Designer. Version 8.2 of Designer can be used for everything that was done in Developer (so we are told!).
Below are some notes on how to make the switch from Developer to Designer.


Setup

IMPORTANT: Find the eclipse.ini file in the C:\SoftwareAG822\eclipse\v36 directory.  Edit it and change -Xms128m to -Xms1024m (unless you don't have a lot of memory, then at least set it to -Xms512m).  This will prevent a lot of garbage collection thrashing in eclipse (and therefore Designer) which makes it a lot faster!

Perspective

Use the "Service Development" perspective - this is the perspective that replaces the functionality of Developer
From Designer, select Window > Open Perspective > Service Development

You can now move windows around and even pull them out onto a second screen.  I personally move the pipeline to my second 24" monitor and have a huge pipeline window now.

Once you perspective is configured how you like it, you can save it with Window->Save Perpective As... and give it a name.  I have a different saved perspective when working on the laptop versus working on dual 24" monitors.

If you mess up and lose a window, you can usually get it back with Window->Show View->Other and find the window (like properties or pipeline).

If you really mess up your layout, use Window->Reset Perspective.

Connect to Integration Server

You still need to connect to an Integration Server.
From Designer, select Window > Preferences > +Software AG > Integration Server >Default > Edit set the server Host, Port, User, and Password. You can use the defaults for the check-boxes "Connect immediately" and "Connect at startup".   Leave your development is name as Default, especially if you will be doing workflow development.

You can create

Hints for usage

  • Keyboard shortcuts
    • Ctrl-L locks the service you are focused on
    • Ctrl-U unlocks the service you are focused on
  • Double click on a service invoke step in the service editor will open that service in the editor.
  • Windows -> Preferences SoftwareAG -> Service Development -> Flow Service Editor - add/remove favorite services to customize your palette view
  • To get to the flow service properties (like for setting the pipeline debug option), click on white space in the editor.
  • Sometimes you just can't seem to add a new variable to the pipeline.  Click on an existing string variable, then the insert usually works!

Process Development

By default you are in Business Analyst mode. To get to advanced options and settings You have to hit an icon in the toolbar that says Process Developer. Note this is different than the Process Development perspective.

New features of Designer

Document References

Right click on a document to "Inspect Pipeline references". This will search for any pipeline mappings on the whole server which don't match the document definition. (Great if you've changed a doc structure and want to make sure you changed all the mappings).

Working Set

On the Package Navigator toolbar, click V and select "Select Working Set". You can then select only the packages you want to see and filter out the rest. (p66 of the Designer User's Guide).

Pipeline as Html

On the pipeline view, right click and select "View as HTML" if you want to save the view of the pipeline and/or print it.

Launch Configurations (for running or debugging)

In Run > Run Configurations you can set up different inputs for a service for different uses (unit tests is a good candidate). They all get saved as files in your workspace. (p300 of the Designer User's Guide)

Saving the pipeline while debugging

You can now save the pipeline while you are debugging a service either to your local drive or to the Integration Server's pipeline directory. You can then debug again and restore the data from that file (p319 of the Designer User's Guide)

Debug Java Service

You can now debug java services in Designer. It requires some setup (p 341 of the Designer User's Guide) but it is very handy!

Thursday, March 15, 2012

Filtering a subscription trigger

So you want to filter out your subscription trigger so it only triggers on certain events.   There's a filter field in the subscription trigger, but it's just a free-form field.  The documentation isn't clear.

Update - found an easier way.
(%myField%=="myvalue")

Complex filters can look like this:

(%textMessageMonitorEvent/textMessageEnvelope/processType%=="VehicleReady" && %textMessageMonitorEvent/textMessageTrackingInfo/monitorStatus%=="DONE" && %textMessageMonitorEvent/textMessageTrackingInfo/deliveryStatus%<>"SUCCESS")

The below also works, but is harder to read and you have to include the document in the clause.  The above just needs the field path.

%myDoc/myField% L_EQUALS myvalue

Note that there are no quotes on the right operand even though it is a string value!

Also, you need to use the "name" operators like L_EQUALS to have the filter operate on the broker, rather than passing it to the Integration Server and then filtering it (which causes more network traffic and IS CPU usage).

Here are the possible comparators I found in the Developer's handbook.

L_EQUALS
L_NOT_EQUALS
L_LESS_THAN
L_LESS_OR_EQUAL
L_GREATER_THAN
L_GREATER_THAN
L_GREATER_OR_EQUAL
L_GREATER_OR_EQUAL

Monday, February 27, 2012

Branch and regular expressions

I don't know why but it just never clicked.  You can use regular expressions as the labels on your branch step even when evaluate labels is false.  A simple example is checking the http status values from a RESTful call:

  • Branch header->status
    • /^2[0-9][0-9]$/ (OK)
    • /^4[0-9][0-9]$/ (Non retry enabled error)
    • /^5[0-9][0-9]$/ (Retry enabled error)
Much easier than trying to list all combinations.

Wednesday, October 26, 2011

External ID is missing the system ID

com.wm.lang.wsdl.WSDException: com.wm.lang.flow.WattEvaluationException: com.wm.lang.xml.WMDocumentException: [ISC.0042.9322] External ID is missing the system ID

I got this error when trying to import a WSDL from an outside company.  Searched the net, wmusers, no help.

Then I tried saving the WSDL to a file from the URL, then importing the file directly.  That worked!  Whew!

Wednesday, October 12, 2011

Restful Service in webMethods

This is another of those things that should be easy right?  Well, it is once you know what to do.

++++ Added note ++++
After I figured out how to do this indirectly, I found the actual Webmethods REST users guide.  It is a more complete way to implement RESTful services. This only works in version 8.2 however.

See http://documentation.softwareag.com/webmethods/wmsuites/wmsuite8-2_ga/Integration_Server/8-2-SP1_REST_Developers_Guide.pdf
++++++++++++

I had a rest service call coming into the Integration Server with an HTTP Post request to http://<server>:5555/invoke/TestForKev.esla.pub/event with a type of application/xml in UTF-8.

  1. So I wrote a flow service in TestForKev/esla/pub called event.  
  2. I created an input parameter of contentStream with an object type.
  3. I called pub.io:streamToString to convert the contentStream to a string
  4. I called pub.xml:xmlStringToXMLNode to create the XML node.
  5. Then I called pub.xml:xmlNodeToDocument to finally convert to a webmethods document.

It should look something like this.



Now you have a webmethods document from your rest service interface.


URL Parameters

If you need to take a rest service input that uses URL parameters, you can still get to them.  Say you have a url like http://<server>:5555/invoke/TestForKev.esla.pub/event_change/98765 where 98765 is the event_id.  


Just write the service as above, but add in a call to pub.flow:getTransportInfo.  The requestURL returned will contain the service name and the parameters at the end of the url, so you can parse them out.   


<value name="requestUrl">/invoke/TestForKev.esla.pub/event_change/98765</value>

Response Values

Found out how to send the http status and message back to the caller.  Use pub.flow:setResponseCode to explicitly set the response values.  Otherwise defaults are chosen for you.