Ubiquitous Language – Every Misunderstanding, a Bug

by bsatrom February 16, 2010 17:46

This post is the second in a series on Ubiquitous Language and Domain-Driven Design.

Photo courtesy of Lukjonis Bug

Last week, I wrote about the difference between jargon and communication and how, in the context of a software-intensive system, jargon necessitates either translation between domain experts and developers or the creation of a new, shared language that all parties exercise.

Translation is time-consuming and expensive--an increased communication cost that lengthens software development efforts. Creating a Ubiquitous Language has a cost as well--an up-front investment in creating and exercising the language--but that cost is quickly recouped in the increased velocity of the development team.

The truth is that the communication cost incurred by translation has other ripples throughout our systems. The phrase “Lost in Translation” is not only true in cultural language, but in the jargon-filled domains of our customers and clients. When we allow the need for translation to embed itself in our projects, we invite misunderstanding and, as a result, a far greater cost than just the time it takes to mediate between conflicting terminology.

Beyond the mounting cost of translation, I propose that every misunderstanding between domain experts and developers will ultimately propagate into our software as a bug.

Every Misunderstanding is a Bug in the System

Let’s consider this by way of an example.

Our development team is working on an event management dashboard for a marketing company. Metrics are important to this company, because the success of events is measured in impressions, touches and exposure. As a result, the domain expert would like to ensure that the dashboard includes metrics that give the on-site marketing teams a real-time count of relevant information.

Sounds simple? Consider this:

Domain expert: So we’ll need to provide the marketing teams with the number of opt-ins, the number of players in the game, the number of winners in the game and the total number of times the game has been played.

Technical expert: Ok, so each MARKETING TEAM will need to see those EVENT METRICS on their DASHBOARD.

Domain expert: Yeah, and each of those numbers is a feed for each team.

It’s a common occurrence in a conversation with a domain expert to hear terms that are ambiguous, overloaded in meaning or even brand new to the domain expert. In this example, the domain expert has chosen the term “feed” to represent a number on a marketing dashboard screen. To most development teams, the term feed is quite overloaded in meaning. Could the domain expert possibly mean that each number should be an RSS or Data feed? If so, does the expert expect that these numbers will be published to the dashboard, and should also be consumable via a public service or RSS/ATOM feed? Or does the expert mean something else entirely?

The only way to know for sure is to ask. But the truth is, we often don’t. I’ve been guilty many times in the past of not asking the next series of questions. Many of us have, either because we think we understand “the business” better than we actually do, or because we only have two weeks to get our project out the door when we really needed two months.

So we make an assumption. In this case, we assume that the domain expert wants that RSS feed delivered by a fancy RESTful service when the truth is much simpler:

Technical expert: Feed?

Domain expert:  Yeah, a feed.

Technical expert: Do you mean that each number should available for anyone to see via a public URL?

Domain expert: Oh, no. I just mean that the numbers should be real-time.

Technical expert: Ah, ok. And each number will be a count for only that MARKETING TEAM and EVENT, right?

Domain expert: yes, exactly. And I’d like for those numbers to really be real-time. My MARKETING TEAMS should trust that they are up-to-the-minute and not have to refresh the page.

Technical expert: Ok, that’s important. So you want those numbers to refresh automatically, without initiation by a  MARKETING TEAM MEMBER.

Domain expert: yes.

As it turns out, by “feed,” the domain expert meant a real-time count of a metric for an EVENT and MARKETING TEAM. By assuming anything else, we run the risk of introducing at least two bugs in the system:

  1. An over engineered solution – Overproduction, also a serious waste in Lean terminology, can be considered a bug in the sense that the system yields an “unexpected result.” This is not “exceeding expectations,” it’s wasting the customer’s time and money. It’s YAGNI, plain and simple.
  2. A missed requirement – By assuming that the customer wanted a RSS feed, we likely missed the fact that what he really wanted was a real-time count of the data, and one that updated on the screen automatically. By not delivering such functionality, we’ve missed a key requirement and as such, introduced another bug into the system.

It’s common in language for us to use a term that means one thing when we really mean something else. Because we are intelligent and adaptive creatures, we can absorb these ambiguities and inaccuracies in speech without our brains boiling inside our skulls. But computers are different. A computer program is nothing more than a representation, in code, of how a computer should provide a solution to a business-driven problem domain. Computer programs will do exactly what we tell them to do, every time, with no variation. When we misunderstand anything relevant to the problem domain, and then codify that misunderstanding in how we instruct a computer to act, we are introducing bugs into the system.

Every Misunderstanding? Really? Every. Single. One?

Perhaps I’m being pithy and hyperbolic. I’m willing to admit that we might be right by accident, and avoid a bug as a result. The first time around, at least. But what happens when that feature is revisited or expanded upon later? Or what about when the domain expert requests some additional functionality that, had the team properly understood the problem space, would have been a simple extension to functionality, but is now a rewrite? My statement might be pithy, but I would argue that most of us find it to be experientially true.

I’ll admit that this is all speculation; even anecdotal. But it’s been my own experience in the past that even if I dodge a bullet the first time, I can be assured that there are more rounds in the chamber.

The Bottom Line: Misunderstanding, Like Translation, Has a Cost

As if the cost of translation weren’t enough, misunderstandings between domain experts and development teams results in the added cost of bugs in the system. A Ubiquitous Language, while no guarantor of success, places the right emphasis on eliminating translation and cementing understanding, both of which will drive down cost over time.

Next time, I’ll talk about accuracy and relevance, and how the importance of each in problem and solution spaces underscores the need for a Ubiquitous Language even further.

Tags: , , ,

architecture | ddd | ubiquitous language

Ubiquitous Language – Communication Vs. Jargon

by bsatrom February 09, 2010 15:55

Words have meaning. Language is important.

These statements are true, and we tend to pay them their proper lip service in both life and in the realm of software development. Sometimes, we even recognize the importance of language in software, and we seek to canonize our internal vernacular through the creation of lexicons, data dictionaries, service catalogs, SLAs, OLAs or wikis.

More often than not, though, these artifacts serve more as historical proof of our best intentions than as living documents that anchor a software development effort. The canon of our language, at least as represented on paper, falls out of phase with the realities of our software and, as a result, collects dust, only warranting mention when someone on the team recalls how useful such a resource might have been to resolve their current struggles with ambiguous and conflicting knowledge.

We know that language is important in software, or we’d never spend the time early on in our efforts to tame it. But do we know how important it is? Do we believe that success in codifying a language is key to success in the creation of a software-intensive system?

Communication

Let’s consider the difference between Communication and Jargon. Communication is the art of using language to convey meaning consistently and clearly. The goal of communication is shared understanding through unambiguous meaning. Consider the following:

Domain expert: When a check payment is sent in, we need verify that the check is legit and then send it to the bank for processing.

Technical expert: What makes it legit?

Domain expert: Valid routing number. Valid account number scheme. And it has to have a signature.

Technical expert: Ok, so we check to make sure those things exist. Then we send to the bank.

Domain expert: Yeah, though I think they only process once per day. So can we hold onto these and only send them once a day?

Technical expert: Sure. We’ll collect these in a batch and fire them off at a set time each day. When do they process?

In the conversation above, the domain expert is attempting to explain a set of needs in their area of concern, the problem space. The technical expert is attempting to understand those needs--the nouns and verbs that “make up” how the domain expert delivers value to the business and their customers—and frame them into how technology will be brought to bear to better enable the domain expert, or the solution space.

Because shared understanding and clarity is a prerequisite to working software, communication is key to the success of any software-intensive system. Clear communication speeds up the creation of working software.

Jargon

Jargon, on the other hand, slows it down.image

Jargon, a style of communication, is the practice of using certain words and phrases in a way that assumes known context, and thus, can serve as a shortcut in communication. When both parties have a shared understanding of the terminology in play, jargon serves as a valuable shortcut for individuals short on time (read: everyone). The propensity of technologists for three-letter acronyms (TLAs) illustrates our tendency towards and the value of jargon. When it works, it works well.

The problem is, when it doesn’t work, it fails miserably. It necessitates translation, clarification and it slows down the whole process of communication. Here’s an example:

Domain Expert: We need to make sure that our support staff can change the rules that we use to create policies for customers.

Architect: ok, so we’ll use a Strategy pattern and make that config-driven…

Developer: we could just use IoC, build strategies for each implementation and let the users swap out implementations whenever they need to change them.

Architect: That’s an option too. We’ll figure it out offline.

Domain Expert: (confused) So will the support staff be able to change those?

Architect: Sure, they’ll change config and it will just work.

Developer: Or swap out an implementation for the container in config.

Expert: What’s IoC?

Architect: well…

When technical experts and domain experts come together to solve a business problem, each brings a certain amount of jargon from their vernacular. Each party is used to spending much of their time with other individuals who understand that jargon. But between domain and technical experts, there is often little overlap between the jargon of the business and the jargon of technology. As a result, when one party leans too heavily on the jargon of their concern, communication stalls.

To keep communication clear, we need a language that assigns meaning to the terminology we use in our contexts.

Ubiquitous Language – The Jargon Killer?

In Domain-Driven Design, Eric Evans advocates for the establishment of a Ubiquitous Language on any complex software project. According to Evans, a Ubiquitous Language is, “A language structured around the domain model and used by all team members to connect all the activities of the team with the software.” (DDD Community emphasis mine)

The purpose of that language is to provide clarity and consistency all the way down to the code. The language is continuously exercised, defined and refined through speech, documentation and, most importantly, code. Accuracy in speech is emphasized, because the words we use when sitting around the requirements table will be the same words that manifest the problem space in code.

So then how do we cope with jargon in our problem and solution spaces? Do we eliminate all jargon and force both parties to come up with new, creative ways to explain themselves and what they know?

Actually, no. I would argue that while some jargon should be jettisoned--especially that jargon that tends to be used as verbal filler (think empty business phraseology like “open the kimono” or “at the end of the day.”)—some should be embraced and formalized into our language.

The fact is that some jargon, technical and business, has the potential to be quite valuable and, once consistently established in the minds of both domain and technology experts, can continue to be a powerful shortcut while remaining clear and consistent.

For example, take Multimedia Messaging Service (MMS) and Short Message Service (SMS) in the context of a project with a mobile-marketing company. Both terms are technical in nature and filled with jargon, yet both domain and technical experts have some level of mainstream understanding of these terms, thanks to the popularity of mobile messaging. Ambiguities exist--many business experts might think, due to carrier branding, that MMS supports picture messages only, as opposed to other forms of multimedia like audio and video—but an overlap in understanding makes these terms perfect candidates for language adoption. Once formal meaning (in the context of the business domain) is brought to these terms, they can be used clearly, and provide the benefit of communicating additional details (acceptable message length, transport technologies, media types supported, etc.) to all parties.

Choosing which pieces of jargon are relevant, which are not, and then formalizing terminology is one of the many aspects of creating and growing a Ubiquitous Language.

The key is finding the valuable jargon, and then turning it into true communication.

Tags: , , ,

ddd | architecture | ubiquitous language

Keeping Architectures Relevant - ITARC Austin Presentation on Domain-Driven Design (DDD) and Emergent Architecture

by bsatrom February 08, 2010 00:53

Note: Cross-posed from Paul Rayner’s Blog.

Last week, I had the opportunity to co-present with IASA Denver chapter president Paul Rayner, at the IASA Austin ITARC Conference. Our presentation was titled “Keeping Architectures Relevant: Using Domain-Driven Design and Emergent Architecture” and is meant to be a helpful introduction to key ideas around DDD, Agile and Architecture, with an emphasis on how an architect can use principles and practices from each of these to keep themselves and their work relevant.

Our presentation was meant to be a brief overview and introduction to the ideas we’ll be covering in our upcoming article (by a similar name) in the Architecture Journal. See my last post for more information about that article. Watch for a link here in mid-March when the article is released.

As Paul states in his post, we really enjoyed presenting and got some great questions during and feedback after the session. We’re planning to give this presentation again soon, so if you were there and you have any additional feedback to offer, we’d love to hear it. We’ll be cross-posting additional content related to the paper and this presentation over the coming weeks, so keep an eye peeled here and Paul’s blog.

Tags: , , , , ,

architecture | agile | iasa

Upcoming Article in The Architecture Journal

by bsatrom January 12, 2010 02:42

Paul Rayner and I recently submitted (and had accepted) a proposal for an article in an upcoming issue of The Architecture Journal. The issue, #23, will center around Architecture Modeling and the tools, tactics and strategies an architect can leverage in modeling his or her architectures.

We’re knee-deep in drafting the paper right now, and it won’t come out until mid-March, but I did want to share the abstract we submitted so you can see what we’re scheming. We’d love to hear and thoughts, ideas or suggestions you might have. 

“Keeping Architectures Relevant: Using Domain-Driven Design and Emergent Architecture to Manage Complexity and Enable Change”

Abstract

Too many systems seem to become legacy upon release, while some never even have a chance to move into production before they are undermined by the calcification of unmet expectations and mismatched domain needs. Regardless of the design effort early in the lifecycle, neglecting the domain model and producing inflexible design results in the increasing irrelevance of the initial architecture of a system. The accidental complexity of that system rises and communication between developers and customers deteriorates. Changes and new features become more difficult to accommodate as the richness and value of the system's essential complexity is eroded. Sustainable and successful software development is all about managing complexity and enabling change, and successful architects create designs that clearly address both.

Architects, domain experts and developers collaborate to mitigate complexity through strategic modeling and design. This requires a focus on the core domain and the continuous application of germane design patterns. Ongoing effort should be expended on defining and refining the domain model through the establishment and exercise of a language that everyone shares. The development of this ubiquitous language, along with the use of domain-driven design techniques, enables business problems and their solutions to be expressed through rich domain models that are both meaningful to business experts and executable by the development team.

Keeping our architectures relevant also means enabling change. As architecture is allowed to emerge, evolve, and mature, it becomes a true reflection of the deep understanding of both domain experts and developers. Architects who expect their initial design to evolve, and who design with evolution in mind, create architectures that deliver a strong competitive advantage to the business.

Reader Takeaways

1) The establishment of a ubiquitous language, which removes the built-in translation layer between domain experts and the development team, is key to relevant modeling.

2) Domain-driven design enables the articulation of a distilled architecture through models that mitigates complexity while remaining relevant to the business and clear to the development team.

3) Architects must collaboratively drive architectures which emerge, evolve and mature in order to deliver systems that improve in their ability to respond to the changing needs of the business.

Tags: , , ,

agile | architecture | ddd | writing

Workflow Systems: Myths, Truths and Wishful Thinking

by bsatrom September 22, 2009 19:55

I had a great time at IASA Denver last night. My presentation included some great discussion among the group about workflow systems and the various challenges we all face when addressing a “workflow style” problem.IASA Denver is an amazing community and a real example of how a professional group should be run. Many thanks to Paul, Kevin and Tim for starting and leading such an amazing group. If you’re in CO, consider yourself an architect and aren’t an IASA Denver member, you’re missing out.

If you’re interested, I’ve posted the slides from my talk at SlideShare and have embedded them below. You can also get the slide deck and the code from both of my demos at http://github.com/bsatrom/WorkflowSystems

 

 

Now to continue a productive week in CO with the Thought Ascent crew!

Tags: , , ,

architecture | iasa | masstransit | wf | workflow

Workflow Systems: Myths, Truths and Wishful Thinking – Speaking at IASA Denver on Sept. 21st

by bsatrom September 04, 2009 20:31

In a couple of weeks, I’ll be heading back up to Colorado to do some planning and brainstorming with the Thought Ascent HQ guys and also to speak at the Denver chapter of IASA.

The topic: Workflow Systems.

I spoke at the RMTT back in February about Workflow, specifically Windows Workflow 3.5 (you can still find the slides and code here, btw).

This talk will be nothing like that one.

Different audience, different goals.

Here’s the abstract if you don’t believe me:

Workflow Systems: Myths, Truths and Wishful Thinking


"If workflow is simply about the coordination of work, why is it such a point of contention for most technologists? Do Workflow systems really enable a Business Analyst to change a production process, or are they a waste of time and resources, not to mention a problem that a solid developer could solve with a hundred lines of code? The goal of this talk is to demystify the idea of "workflow," and to discuss what place, if any, a Workflow system might have in your problem domain. We'll discuss Workflow Systems by example with Microsoft's Workflow Foundation tools (3.x and 4.0) and explore popular, low-ceremony options for doing "workflow" (NServiceBus, MassTransit, etc). We'll end the session with an open discussion on workflow tools and collaboratively craft some tactical recommendations on when and why to use workflow in your organization."

So not so much about WF as it is about Workflow in general. The aspects that are about WF don’t make the assumption that WF is a useful tool, or even a good solution, hence the time spent on other options like NServiceBus and MassTransit.

Look for the slides and code to be posted here shortly before or after the talk, along with a couple of follow-up posts (perhaps even a series) that will dive deeper into the main points from my talk.

And if you’re in Colorado, I hope to see you there (click here for meeting details, times and a map)!

Tags: , , , , ,

masstransit | nservicebus | saga | service | speaking | wf

South By Southwest Interactive 2010 - Vote for Brilliant Life

by bsatrom August 29, 2009 00:12

Part of what I've been doing since changing jobs back in October 2008 is helping my boss move forward with a non-profit that he's been working on for the last few years. The name of the organization is Brilliant Life, and the goal of the organization is to improve lives and change technology by providing technology training and careers to individuals who aren't being given a chance to pursue those careers today. That includes juvenile and adult offenders, the homeless, displaced workers, etc. It's a great organization and I'm excited for the vision and what we know will come of it.

We're a young organization, but we've had success in CO already. In July, I moved to Austin with my family to both open the Texas branch of the consulting company at which I work (Thought Ascent) and to expand Brilliant Life into Texas. Part of that expansion is a push to get the word out, which is where South By Southwest (SXSW) and this post come in. SXSW is a music, film and interactive festival that takes place in Austin each year. The Interactive portion of the festival draws thousands of tech professionals to hear about subjects from social media to emerging technology to how technology is being used to make the world a better place (that’s us).

What's more, the public is given a role in helping to select the sessions that will be offered for each track.

This is where you come in. We need your vote. We have submitted a session for SXSW under the title: "Turning Criminals into Coders: The Brilliant Life Story." Here's the abstract:

"Can coding literally save someone's life? Can it change America's broken prison system? The non-profit, Brilliant Life, will discuss how they're teaching juvenile delinquents to code, how to work on a software development team, as well as how they’re providing opportunities to work after their prison time ends."



Voting is open to the public, and we've had a pretty good response so far. But we need your vote as well. So, please take a moment to go to the link below and vote for our session. You will have to register, but SXSW doesn't spam, so sign right up.

http://panelpicker.sxsw.com/ideas/view/4435

And leave a comment for us if you can.

Thanks for your support!

P.S. If you're interested in knowing more about Brilliant Life and what you can do to help, email me a brandon.satrom AT brilliantlife DOT org.

Tags: , ,

brilliantlife | causes | technology

User InExperience Now Powered by ASP.NET MVC and Oxite!

by bsatrom May 26, 2009 16:07

Over the last few months, I’ve been knee-deep in ASP.NET MVC for a client mobile web application. All in all, I’m really impressed with what Microsoft turned out in the 1.0 release of the bits. I have a few posts in the hopper about how we (Thought Ascent) are using MVC to target mobile devices with views customized to platform capabilities, and will be posting those in the coming weeks.

While wandering around ASP.NET MVC-land, I was directed to Oxite, a blogging/CMS platform built on ASP.NET MVC and which leveraged the broad expertise of the guys responsible for Channel 8, Channel 9, Channel 10 and MIX Online. Oxite also powered the sharp-looking Mix 2009 site.

So, after five years of hosting this blog in WordPress, I decided it was time to switch to .NET hosting and Oxite. So far, I love it. The transfer was quick and painless, other than some minor issues with BlogML and encodings on content from the WordPress blog, but everything made it over. I’m happy to finally be on a .NET blog engine and am glad I jumped into Oxite early. It’s an Alpha project as of now, but I’m impressed with the engine and the internals and am looking forward to diving in, tweaking the source on my end and perhaps even contributing to the mainline over time.

Many thanks to Tobin Titus for the sharp-looking theme. One of these days, I should skin my own site…

Links:

ASP.NET MVC

Oxite

Note: If you came here and found a broken link from a referrer, try the search box on the right. I promise everything is still here. I plan to implementing routing to tie those links back together soon. In the meantime, a keyword or two should get you to what you’re looking for.

Tags: , ,

mvc | net | oxite

The Future of Work and Workflow - RMTT Slides and Code Samples

by bsatrom February 23, 2009 19:02

Well, the Rocky Mountain Tech Trifecta has come and gone, and I think the event was a big success. There was a great turnout, and some really useful sessions.

I was pleased to have a full house in my WF talk, and I hope that it was a useful time for those that chose to listen to me drone over the other available options. There was some good interaction and good questions, both during and after the talk.

If you were there, I'd love to hear your feedback, good or bad. I can take, and I'm always looking for tips on how a technical talk can be more useful. If you have unabashed praise, I like that too.

If you would like to have the slides, I've embedded those below, or you can download them here. I have some notes of many of the slides if you're interested in more detail than I shared in the presentation. There are also a few slides at the end on .NET 4.0 improvements to WF that I didn't get to during the talk.

If you would like the code and demos I used during the presentation, you can find everything in a single Zip here. Most everything you need to run the demos should be here, but you will need to create the persistence and tracking databases if you want to use those pieces. Also, you'll need to have MSMQ installed and running on whichever machine you plan to use for these demos. There's a Powershell script to create the queues in the ConsoleWorkflowServiceHost project if you want to try out the MSMQ features.

There's also some unit tests if you want to try things out independent of the web app. You'll need to stage some data, but that's pretty easy. You'll notice that I also added a Test file to test the Custom WF activities I created for this demo separate from the WF itself. This is something I only mentioned in passing in the talk, but it's worth checking out as it's a useful way to really test your custom activities.

If anything else is gnarly, feel free to drop me a comment here or an email and I'd be happy to help you out.

Tags: , , ,

net | rmtt | speaking | wf

Debugging Workflows: WF Tracing - When Nothing Else Works, Try This...

by bsatrom February 17, 2009 01:02

If you've spent any time with Windows Workflow Foundation, you probably know that every possible thing you can do to enable logging and tracing of your workflows at runtime (Tracking, logging, Tracing) can save your butt when you just can't seem to find out why the heck your workflow is sitting idle after you've just thrown a few hundred concurrent requests at it.

Tracking is pretty well documented, and I would highly recommend it, along with a Monitoring tool that gives you a view into tracking results without needing to write queries against the tracking DB (I'll cover some minor enhancements I made to this tool in another post). Not that it's really that difficult, it's just not worth your time to figure out the ins and outs of the Tracking DB schema when Microsoft plans to greatly enhance it in .NET 4.0. (along with providing Tracking data views in IIS, which will be fantastic.)

Logging, whether via Enterprise Library or another tool like Log4Net, is also pretty well documented. If you're using Workflow Services, you'd also be wise to use Service logging as another source for Workflow forensics. This is also well documented.

Tracing, on the other hand -- which I consider to be the last line of defense when WF Runtime seems fine, Tracking data is clean, but the WF isn't completing as expected and/ or you're seeing intermittent socket exceptions in the svclogs -- is not so well documented. Perhaps this is because it need not be documented as it is simple and I am daft.

In any case, I thought it might be helpful to expound upon a few of the entries I have seen regarding Workflow Tracing.

When I first looked into adding tracing to my Workflow Host, I found several articles that recommended the following code in config:

   1:  <configuration>
   2:    <system.diagnostics>
   3:      <switches>
   4:        <add name="System.Workflow LogToTraceListeners" value="1" />
   5:        <add name="System.Workflow.Runtime.Hosting" value="Verbose" />
   6:        <add name="System.Workflow.Runtime" value="Verbose" />
   7:        <add name="System.Workflow.Runtime.Tracking" value="Verbose" />
   8:        <add name="System.Workflow.Activities" value="Verbose" />
   9:        <add name="System.Workflow.Activities.Rules" value="Verbose" />
  10:      </switches>
  11:    </system.diagnostics>
  12:  </configuration>

 

I found one example of this on MSDN. The guidance is spot on, but it is missing a few lines that I think would be helpful for a developer at his or her wits end with WF who is just trying to get logging up and running. It goes without saying that "LogToTraceListeners" assumes that one or more trace listeners already exist in your config. They don't exactly tell you that, do they? What's more, the self-contained config above would lead one to believe that you're all set this with this block of code.

Not so. At bare minimum, you'll need to add at least one of the listeners below (unless you wanted to use the EventLog listener, but you get the idea):  

   1:  <system.diagnostics>
   2:      <switches>
   3:        <add name="System.Workflow LogToTraceListeners" value="1" />
   4:        <add name="System.Workflow.Runtime" value="Error"/>
   5:        <add name="System.Workflow.Runtime.Hosting" value="Error"/>
   6:        <add name="System.Workflow.Runtime.Tracking" value="Error"/>
   7:        <add name="System.Workflow.Activities" value="Error"/>
   8:        <add name="System.Workflow.Activities.Rules" value="Off"/>
   9:      </switches>
  10:      <trace autoflush="true">
  11:        <listeners>
  12:          <add name="ConsoleTraceListener" 
                    type="System.Diagnostics.ConsoleTraceListener" />
  13:          <add name="TextWriterTraceListener" 
                    type="System.Diagnostics.TextWriterTraceListener" 
                    initializeData="System.Workflow.Trace.log" 
                    traceOutputOptions="DateTime" />
  14:        </listeners>
  15:      </trace>
  16:    </system.diagnostics>

Obvious? Maybe, but it's easy to miss in a rush. If that's you, I hope this helped.

You might find that adding those two lines did nothing to fix your issue, in which case I might have something else for you to try. I' have seen in some cases where listeners are already set up for other parts of the system (WCF logging, for example) that the code above still won't work. If that's you, try this:

   3:    <sources>
   4:      <source name="System.Workflow">
   5:        <listeners>
   6:          <add name="System.Workflow" />          
   7:        </listeners>
   8:      </source>
   9:      <source name="System.Workflow.Runtime">
  10:          <listeners>
  11:            <add name="System.Workflow" />
  12:          </listeners>
  13:        </source>
  14:        <source name="System.Workflow.Runtime.Hosting">
  15:          <listeners>
  16:            <add name="System.Workflow" />
  17:          </listeners>
  18:        </source>
  19:        <source name="System.Workflow.Runtime.Tracking">
  20:          <listeners>
  21:            <add name="System.Workflow" />
  22:          </listeners>
  23:        </source>
  24:        <source name="System.Workflow.Activities">
  25:          <listeners>
  26:            <add name="System.Workflow" />
  27:          </listeners>
  28:        </source>
  29:    </sources>
  30:    <sharedListeners>
  31:      <add name="System.Workflow" 
                type="System.Diagnostics.TextWriterTraceListener" 
                initializeData="c:\logs\System.Workflow.trace.log"  
                traceOutputOptions="DateTime" />
  32:    </sharedListeners>
  33:    <switches>
  34:      <add name="System.Workflow.Runtime" value="Error" />
  35:      <add name="System.Workflow.Runtime.Hosting" value="Error" />
  36:      <add name="System.Workflow.Runtime.Tracking" value="Error" />
  37:      <add name="System.Workflow.Activities" value="Error" />
  38:      <add name="System.Workflow.Activities.Rules" value="Off" />
  39:    </switches>          

Notice that live 4 in the first example is nowhere to be found here. I found I didn't need it. You'll also note that I had to add a source and listener for each Namespace in System.Workflow that I wanted to trace. I can't say why this works in cases where existing sources cause the "LogToTraceListeners" switch to hit the fritz, but I thought it was worth sharing. If it gets you our of a jam, then I'm happy to have shared it.

Tags: , ,

wf | workflow

Powered by BlogEngine.NET 1.6.0.0
Theme by Mads Kristensen | Modified by Mooglegiant

About me

I am the Chief Architect for Thought Ascent, President of IASA Austin, and a software developer interested in agile, architecture, craftsmanship, ddd and a variety of other topics. Join me as I explore them here.