Kicking off a workflow from an online form submission

I should be drinking the kool-aid, right?  Meaning, I should be using the features of the product suite to my advantage.  I started to go down the route of trying to figure out how to effectively track when someone "Requests More Information" from my website.  I surely don't want to use 4 different products to manage that process.  Why can't I take the form submission from squarespace and have it kick-off a workflow within Content Manager?  

Once my email link server was configured it took all of about 5 minutes to get this setup.


Here's the workflow I want to kick-off....

 
2017-10-03_13-07-35.png
 

First I went into squarespace and created a submission form.  It sends me an email with the contents of the form.  That email looks like the image below.

2017-10-03_11-56-48.png

Next I went into Content Manager and created myself a new check-in style.  I'm doing this via the webclient, but the process is the same for the thick client.  

 
Web-client

Web-client

 
 

I then gave the check-in style a name and chose my "Request for Information" record type.  

 
2017-10-03_12-03-20.png
 
 

Then I gave it a default workflow template for my process

 
2017-10-03_12-05-04.png
 
 

I then clicked into the processing section and checked the first two check boxes: Automatically create server-side email capture folders and Keep email in the mail system.  By keeping it in there I'm hoping my conversations can be automatically related and captured down the road.

2017-10-03_12-56-40.png

Now after I click save, it shows me my new check-in style

 
2017-10-03_12-07-16.png
 

If I go back to my gmail inbox I can now see this folder available

 
2017-10-03_12-08-57.png
 

Next I create a new filter for my inbox, so that all incoming form submissions are automatically labeled into this folder.

 
2017-10-03_11-34-12.png
 

I know the sender and receiver of the messages I care about, so I define those on the filter like shown below.

 
2017-10-03_12-11-58.png
 

In the other options dialog I indicate the new label name and then click save

 
2017-10-03_11-37-03.png
 

Now I go visit my website and complete the form...

2017-10-03_12-28-15.png

Now if I check my workflows worklist, I can see my workflow has been kicked-off & assigned automatically!

 
2017-10-03_13-09-39.png
 

The things we can accomplish with the newest versions are pretty cool.  I can see lots of useful ways to leverage these features.  Keep in mind that once the form data is within Content Manager, I can apply scripts, code, and add-ons to do anything necessary (like harvest the form data, initiate an integration, etc).

The integration with gmail is secure.  It works.  And it's free (if you have both G Suite and Content Manager).  You just need to configure it.  :)

Monitor Event Server via Powershell and notify on failures

Someone posted an interesting question over on the forum: how to monitor event processing without getting directly onto the server.  The OP was searching for a way to do it via C#, but even that is unnecessary.  It's possible to do this directly from powershell.  Even better, you can schedule your powershell script and have it do something when there's a problem. 

Here's a cut-down version of a powershell script I provide to my customers.  In the example below I have it writing to the event log when there are failures and to the information log with the current counters.

$dbid = "CM"
$wrksrv = "WG1"
 
#determine where in the event logs this information will go, create if doesn't exist
$eventLogDisplayName = "HPE Content Manager Event Processor"
$eventLogSourceName = "HPE Content Manager Event Processor"
$logFileExists = Get-EventLog -ComputerName $wrksrv -list | Where-Object {$_.logdisplayname -eq $eventLogDisplayName} 
if (! $logFileExists) {
    New-EventLog -ComputerName $wrksrv -LogName $eventLogDisplayName -Source $eventLogSourceName
}
 
#import CM namespace, create threaded database connection 
Add-Type -Path "C:\Program Files\Hewlett Packard Enterprise\Content Manager\HP.HPTRIM.SDK.dll"
[HP.HPTRIM.SDK.Database]::AllowAccessFromMultipleThreads = $true
$db = New-Object HP.HPTRIM.SDK.Database
$db.Id = $dbid
$db.WorkgroupServerName = $wrksrv
$db.Connect
 
#create an event monitor with refresh interval -- not should not really be any less than the interval defined in the event processing properties
$monitor = New-Object HP.HPTRIM.SDK.EventMonitor -ArgumentList $db, 500
#store list of what is processing and then tell it we want stats
$processors = $monitor.GetAvailableProcessors()
foreach ( $p in $processors ) {
    $monitor.EnableCounters($p)
}
#start gathering stats
$guid = $monitor.Initialise()
#give the event processor some time to process
Start-Sleep -Seconds 1
if ( $monitor.IsAlive() ) {
    foreach ( $p in $processors ) {
        #look for failure results
        $counters = $monitor.GetResults($p)
        $failed = $counters.FailedEvents()
        $queued = $counters.QueuedEvents()
        $processed = $counters.ProcessedEvents()
        if ( $failed -gt 0 ) {
            Write-EventLog -ComputerName $wrksrv -LogName $eventLogDisplayName -Source $eventLogSourceName -EntryType Error -EventId 1 -Message "Detected $($failed) Failed Events"
        }
        if ( $processed -gt 0 ) {
            Write-EventLog -ComputerName $wrksrv -LogName $eventLogDisplayName -Source $eventLogSourceName -EntryType Information -EventId 1 -Message "Detected $($processed) Processed Events"
        }
 
    }
}
               

As a CM administrator, I can install Server Manager on my local Windows 10 workstation.  When I'm in the Server Manager I can use standard windows servers features (instead of custom or third party products) to manage the environment.

The highlighted entry is the one created by the powershell script

The highlighted entry is the one created by the powershell script

Making webdrawer's results sortable and searchable

The out-of-the-box design of webdrawer does not include common data table functionality.  For instance, the column headers & labels can't be clicked.  They also don't indicate if that column is being sorted. 

 
 
2017-09-30_21-56-32.png
 

 

The ubiquitous dataTable library could be imported into webdrawer and then applied to the results list.  If done, the results list will appear as shown below.

2017-10-02_16-03-39.png

With this users can now:

  • Change how many items are in the view
  • Search all rows and columns for a given value
  • Click any column header and sort the items by that column

Even cooler, if the user types into the search box then all non-matching rows will be hidden.

2017-10-02_16-06-21.png

 

Although Webdrawer's out-of-the-box footer works perfectly well, I feel the dataTable library includes a better pagination.  Also, by increasing the page size and enabling pagination here, more advanced features can be added (such as column formulas, signature lines, save as excel workbook).  Once enabled the footer would appear like shown below.

 
2017-09-30_22-00-59.png
 

It's super easy to incorporate this into your own implementation.  Definitely test and tune your environment, as I'm just showing the broad brushstrokes.  Contact me for more details about implementation or more advanced features.  Otherwise here are the instructions.


First I opened the "Views/Shared" resultsList class file in Visual Studio.  I located the table element which will contain all of the records.  I then added an id attribute with "records" as the value.

2017-09-30_20-00-37.png

Now that my table is named, I went into my initialize method (previously used to setup the map on the page) and added a invocation of the jquery dataTable plugin.  I provided it the name and a configuration object that enabled pagination.  

2017-09-30_20-02-22.png

I then imported the dataTable jquery plugin via a public CDN, like so:

<link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" type="text/css" rel="stylesheet" />

That's it.  Three lines of code.  Crazy, isn't it?  :)