Thursday, October 28, 2010

Starting a process from a web URL.

I couldn't find a way to have a task initiate a workflow process.

What I did was just had a publish event integration service that publishes an empty document to start the process. Then you can just have a web link to the invoke step like 
 http://<server>:5555/invoke/DtMigrationChecklist.v1.flow:publishRequestMigrationEvent 

Then my first step of the process was the task for filling in the data.  This indirectly starts the process "from a task".  We used it for our migration process for getting code from development up to QA and then tested and approved.

Removing a published document from the Broker

If you have a document set to infinite retry, but it's never going to go through you can remove it from the Broker.  Here's how:
 

  1. Connect to the environment where you want to remove a document. (see [MWS Environments|MWSConnectionInformation])
  2. Navigate to "Administration > Messaging > Broker Servers > Clients"
  3. Search for the subscribing Trigger (easiest way is to use the package name where the Trigger is located)
  4. Click on the Client ID link of the appropriate Trigger
  5. To remove all documents
    1. Click on the "Statistics" tab
    2. Click the "Clear Queue" button
  6. To remove a single document
    1. Click on the "Configuration" tab
    2. Click on the "Lock Queue" button (make sure to unlock queue when done)
    3. Click on the "Browse Queue" tab
    4. Search for the document you want to remove
    5. Select the document
    6. Click the "Delete" button
    7. Click back on the "Configuration" tab
    8. Click on the "Unlock Queue" button (make sure you do this!!!)

KPIs

I just could not get the custom KPIs to work. I had found these steps pretty easily.
  1.  Administration -> Business -> Business Processes : turn on analysis for the process
  2.  Administration -> Business -> Tasks -> Task Engine Administration : turn on analysis for each task 
  3. Setup the KPI in Designer for the process
I finally had to call support to get them working.  Here is the step I was missing!
  1.  Turn on Logging for the fields used for the KPIs. In the Properties Tab->Advanced->Logged Fields 
Once I did that they immediately started working.  You have to tell the process what data it cares about as far as KPIs are concerned.  It makes sense, but it sure wasn't clear in the documentation.

Tuesday, October 26, 2010

Debugging a remotely triggered flow service.

To debug a process that is run from a trigger or business process in IntegrationServer7:
  1. Put a pub.flow:savePipelineToFile as the first entry in the flow service and enter a filename.
  2. Execute the code that hits the trigger or business process.
  3. Look at the file on the IntegrationServer/pipeline directory to check the data.
  4. To debug, disable the savePipelineToFile and add a pub.flow:restorePipelineFromFile with the same filename
  5. Step through the flow service and you can now see exactly how it behaved and find your problem.
And in IntegrationServer8 (as mentioned in the comments) it gets much easier:
  1. Open the service and change the pipeline debug option to "Save".  (You may have to click on the title bar of the service to get to the right properties screen)
  2. Execute the code that hits the trigger or business process.
  3. The data is saved in the IntegrationServer/pipeline directory
  4. Now select the service again as in step 1, but change the pipeline debug option to either "Restore" option.
  5. Step through the flow service and it will start out with your restored pipeline.

    Put a custom identifier on the task list to easily differentiate tasks

    1. Open the task overview pages (either double click it in the Solutions tree or from the process model)
    2. Switch to the Events tab (at the bottom)
    3. Add a new event with an {{Event Type}} of {{Queued}}
    4. Add a simple action and choose Set Task CustomID.
    5. Use the {{...}} button to select the field to use as a custom id.
    6. Repeat this for every task that you want a customId on (and they can be different for each task if that makes more sense).
    Now you need to add the custom id to your inbox/task list.
    1.  Login to my webmethods
    2. Goto the {{My Inbox}} tab.
    3. Click on the middle button above the {{Scheduled Delegations}} link.  It is circular and looks like an options list.
    4. Move the Custom ID field from the {{Available Columns}} list to the {{Selected Columns}} list and use the up and down arrows to change the column order.
    Now the custom ID will show up in your inbox list.

    Do the same process for the {{Task List Management}} view as well.

    Remove the task folder from the task view.

    If you do not implement a custom inbox task portlet, then you also don't want the tab showing in the list. Open the WebContent/WEB-INF/tasks/<task id>/taskDefinition.xml file and change the isTaskFolder="true" value to false in the section that looks like this:

      <!-- Publish Task pages -->
    <CONTEXT alias="webm.apps.workflow">
          <folder name="Service Delay" description="" 
                   alias="BF21B6F4-8954CEC6-4057-571C9AF1FF66.task.app" isTaskFolder="false"/>
    </CONTEXT>

    Purpose

    I've been working with webMethods for about a year now and I have found there are lots of items that are hard to figure out via the documentation and very few posts on the web about them.  I thought I'd post them here as I find them to help out other people (hopefully).