Tuesday, July 27, 2010

"Vero" what??

VeroRight” is the code name identifying a suite of technologies that enable rapid construction of complete semantic data solutions. Unlike common solution development platforms that result in data being stuffed into rigid, quickly-aging models accessed by expensive, custom-programmed applications – causing business knowledge to be broken apart and buried within data, code, systems, tools, and people – “VeroRight” is designed from the ground up for:
  • Changing data models and surrounding applications without corruption or excessive cost.
  • Gathering knowledge in a single place instead of spreading it across data, code, and people.
  • Deriving value from data in new, unanticipated ways today and in the future.
  • Containing costs by reducing dependency on expensive software engineering.
With "VeroRight", a complete semantic data solution is mostly configured, not programmed, then deployed, enterprise-ready:



The “VeroRight” suite of technologies includes:
  • VeroMark”, the semantic client user interface builder
  • VeroServe”, a set of semantic data services
  • The xServe set of enterprise infrastructure services:
  • LogServe” enterprise diagnostics service
  • ProfileServe” enterprise user profile service
  • PermissionServe” enterprise authorization service
  • IdentityServe” enterprise identity management and authentication service
  • ExecutionServe” distributed work execution service
Because data is modeled semantically, VeroRight solutions can deliver accuracy despite change -- which explains at least the first part of the name: Vero is Italian for truth.


Monday, July 19, 2010

Executing work from a "VeroServe Workflow"

While the interaction of an enterprise user application with its back-end services is orchestrated in a “VeroServe Workflow”, execution of intensive or performance sensitive “VeroServe Workflow” work can in turn be delegated to one or more instances of ExecuteServe for load balancing across servers. “VeroServe Workflow” hides the details of delegating work to ExecuteServe through its ExecuteActivity.




To use ExecuteActivity, first add it to VS by hovering over the toolbar when displaying a work flow, right clicking, selecting the “System.Activities.Components” tab, then browsing for ExecutionActivity.dll (built from svn://[repositoryAddress]/[company]/WorkflowServices/WorkflowServices.sln). Then, drag it to the appropriate location in your work flow. 

ExecuteActivity requires configuration of the following in and out parameters:

ExecuteActivity.DLL Activity Control:

In Parameters:
   callbackAddress          String
   workflowInstanceId       String
   executeActivityNumber    String
   worker                   Worker
   executionServiceAddress  String


Out Parameters:
   executeReturnParameter   ExecuteReturnParameter


    public class ExecuteReturnParameter
    {
        public string Status { ... }
        public string Message { ... }
        public string AssemblyName { ... }
        public string ClassName { get; set; }
        public string SerializedWorker { ... }
        public ExecuteParameter ExecutionParameter { ... }
    }


Work flows containing the ExecuteActivity must also have a client endpoint element in its web.config named "IExecutionServiceEndpointConfigurationName". The following web.config entry can be directly cut/pasted into a "VeroServe Workflow" web.config without any modification to satisfy this requirement:

Web.config Settings:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IExecutionService" .... >
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint binding="basicHttpBinding" 
        bindingConfiguration="BasicHttpBinding_IExecutionService" contract="IExecutionService" address="http://localhost/ExecutionService.svc"
        name="IExecutionServiceEndpointConfigurationName" />
    </client>
  </system.serviceModel>
</configuration>

The following figure is an example of settings for ExecuteActivity parameters:



ExecuteActivity's in parameters include:
  • callbackAddress, the execution URL of the “VeroServe Workflow” containing the ExecuteActivity. In this figure, this "VeroServe Workflow" is configured to execute at "http://localhost:1392/PayoutWorkflowService.xamlx".
  • workflowInstanceId, a unique number that identifies the instance of the "VeroServe Workflow" executing. In this example, the variable workflowId was set in "VeroServe Workflow" prior to this ExecuteActivity with a unique Guid generated for the executing instance.
  • executeActivityNumber, a unique constant that identifies the ExecuteActivity within the "VeroServe Workflow". In this example, the variable invocationNumber was set to a constant that uniquely identifies this ExecuteActivity within the "VeroServe Workflow".
  • worker, an instance of a derivative of Worker, with its DataMember-decorated properties set to their values in preparation for execution within ExecutionServe.
  • executionServiceAddress, the URL of an ExecutionServe service.

ExecuteActivity also requres an ExecuteReturnParameter out parameter defined in Entities.dll (built from svn://[repositoryAddress]/[company]/WorkflowServices/WorkflowServices.sln), which will include a Worker-defined status and an ExecutionParameter that can be used by Worker's desearalize() static method to re-instantiate the Worker within the work flow after ExecuteActivity completes. Modifications made to any Worker property decorated with the [DataMember] attribute during execution directed by ExecuteActivity will be subsequently reflected in these deserialized values.


    public abstract class Worker
    {
        public static Worker deserialize(ExecuteParameter executeParameter)
        { ... }
        }

        public ExecuteParameter serialize()
        { ... }

    }

Saturday, July 17, 2010

Persistence of Worker data in "VeroServe Workflow"

When an ExecutionServe Worker is used as a variable within a "VeroServe Workflow", its properties decorated with the [DataMember] attribute will be persisted with the rest of the work flow when it persists.

What makes this possible is the persistence services of SqlWorkflowInstanceStore, which "VeroServe Workflow" uses to persist work flows. SqlWorkflowInstanceStore in turn uses  the NetDataContractSerializer to serialize and deserialize complex types, including those decorated with the [DataContract] attribute like ExecutionServe Workers.

Friday, July 16, 2010

How to add help to a "VeroMark" semantic client builder user interface

Aaah, application help, who can get by without it? Luckily, you can add context sensitive help easily to your VeroMark application client.

VeroMark’s help system can access compiled chm files or html files either locally or by http. By default, VeroMark accesses help content from a help url constructed from a concatenated path and HelpString, but can also be configured to access help content from a path and HelpString separately.


The following VeroMark configuration file appSettings cause it to append a context-sensitive HelpString to the base url http://server/path/VeroMark/default.aspx?pageid= when accessing help content. It also specifies that the default HelpString is Welcome for use when a context-specific HelpString is not available. Given these settings, VeroMark’s help system will access the url http://server/path/VeroMark/default.aspx?pageid=Welcome when your user presses the F1 key and no context-specific HelpString is available.



    <add key="[company].Inventory.SPI.MainWindow.AppendHelpstringToUrl" value="true"   />
    <add key="[company].Inventory.SPI.MainWindow.HelpUrl" value="http://server/path/VeroMark/default.aspx?pageid="   />
    <add key="[company].Inventory.SPI.HelpProvider.HelpstringDefault" value="Welcome"   />

VeroMark defaults the first entry to “true” when not included in the configuration file. To access traditional chm files, make sure to include the first configuration entry but set it to “false” as follows:



    <add key="[company].Inventory.SPI.MainWindow.AppendHelpstringToUrl" value="false"   />
    <add key="[company].Inventory.SPI.MainWindow.HelpUrl" value="C:\path\sample.chm   />
    <add key="[company].Inventory.SPI.HelpProvider.HelpstringDefault" value="sample.chm::/compiledHtmlPage.htm"   />

Context-specific HelpStrings are configured within VeroMark Page markup by setting the HelpProvider.HelpString property on FrameworkElements as follows:

<Page xmlns:ns="clr-namespace:[company].Inventory.SPI;assembly=SPIControls"
      ....
      ns:HelpProvider.HelpString="stringToAppendToHelpUrl">


Now, for example, when a user has focus on a child FrameworkElement within this Page which doesn’t have a context-specific HelpString configured, pressing F1 will cause VeroMark’s help system to access http://server/path/VeroMark/default.aspx?pageid=stringToAppendToHelpUrl .

VeroMark’s help system first checks to see if the FrameworkElement with focus has a context-specific HelpString configured. If it doesn’t, it then checks to see if the FrameworkElement that caught the F1 event has one. If it also doesn’t, it defaults to the HelpStringDefault configured in VeroMark’s configuration file.


Context-specificity can be increased by adding HelpStrings to children deeper into the LogicalTree. The following markup, within the same Page, causes VeroMark’s help system to access http://server/path/VeroMark/default.aspx?pageid=stringToAppendToHelpUrlWhenControlHasFocus when the SpiTextBox has focus and a user presses the F1 key.

         ...
         <ns:SpiTextBox Grid.Column="1" Width="400" TextWrapping="Wrap"
            Style="{StaticResource MValueTextBoxStyle}" 
            ns:HelpProvider.HelpString="stringToAppendToHelpUrlWhenControlHasFocus";
            Text="{Binding Source={StaticResource CurrentEntity}, Path=[MValue_PartyName_Categories_Pronunciation].StringValue, 
            Mode=TwoWay, 
            TargetNullValue={x:Static System:String.Empty}}"/>
                  ...

If SpitextBox is the only FrameworkElement within this Page to have HelpString context-specificity, focus on other FrameworkElement's within the Page will still default back to the Page's HelpString setting and access http://server/path/VeroMark/default.aspx?pageid=stringToAppendToHelpUrl when a user presses the F1 key.

Thanks to VeroMark’s help system, you can deliver context-sensitive help content to users of your VeroMark application. All that’s left for you to do now is author content that will help your users in a useful, informative, logical, consistent, accurate, and compelling way when they encounter unexpected problems in the future. No prob!

Sunday, July 11, 2010

Implementing work for ExecutionServe

While the design goal of "VeroRight" is to accomplish as much application development through configuration as possible, some operations are complex and simply require coding. For those that are also execution intensive or performance sensitive, ExecutionServe provides a remote service-based execution environment within which submitted work can be executed asynchronously for load balancing across servers.

Units of work are implemented for execution within ExecutionServe by simply extending a base class that hides all underlying details of ExecutionServe's execution environment:
  1. Derive your worker class from the Worker class within Entities.dll (built from svn://[repositoryAddress]/[company]/WorkflowServices/WorkflowServices.sln)
  2. Decorate it with the DataContract attribute
  3. Add properties decorated with the DataMember attribute
  4. Override the doWork() method with your long running implementation.

The following example code snippet is from svn:// [repositoryAddress]/[company]/WorkflowServices/SampleCalculator:

  
    [DataContract]
    public class LongerRunningCalculator : Worker
    {
        [DataMember]
        public string Param1 { get; set; }

        [DataMember]
        public string Param2 { get; set; }

        protected override DoWorkReturnParameter doWork()
        {
            System.Threading.Thread.Sleep(14400000); //4 hours

            DoWorkReturnParameter returnParam = new DoWorkReturnParameter();
            returnParam.Message = "return value";
            returnParam.Status = "status value;

            return returnParam;
        }
    }

This example class can now be instantiated, its DataMember properties set, and then serialized so it can be supplied to a remote ExecutionServe's IExecutionService.executeAsync() operation for execution of its doWork() method. It will also be automatically serialized again and asynchronously returned to the caller  after its doWork() method completes so that any changes to its DataMember properties are available after completion. 

"VeroServe Workflow" use of ExecutionServe will be discussed in a subsequent post.