locked
Workflow 4.5 contract-first: can "import contract" functionality be reused? RRS feed

  • Question

  • Hi.

    I've been experimenting with contract-first workflow development and, while it's pretty useful, it appears that use of the the "import contract" functionality seems to limited to only from within a workflow service project; it's kind of annoying having to use a specific project-type just to get this to work.

    Does anybody out there know if there is a command-line tool or, even better, classes used by the "import contract" menu item that I can reuse to automatically generate the preconfigured send / receive activity XAML? I'd hate to have to roll my own...

    Thanks,

        Adam.


    • Edited by DD_AdamF Thursday, November 1, 2012 9:07 PM (typo)
    Thursday, November 1, 2012 9:06 PM

Answers

  • Hi Adam,

    Another aproach in your scenario is using an untyped message in your workflow declaration. The following screen snippet shows an example of the generating a message for web service:

     

    The custom activity CreateMessage during the design time will create a parametrized xslt template resource of the soap message. This xslt resource during the runtime time will generate a soap message for Send activity. The response message can be transformed in the custom activity Transform based on the needs.

    The following picture shows a concept of the CreateMessage custom activity:


    More details about this technique (Model-First, Contract-First, etc.) can be found in my articles:
    WF4 Custom activities for message mediation
    - Contract Model for Manageable Services
    - Manageable Services
    - Azure Virtual Bridge

    Thanks

    Roman


    Roman Kiss, MVP Connected System Developer

    • Marked as answer by LeoTang Sunday, November 11, 2012 9:06 AM
    Sunday, November 4, 2012 8:03 PM

All replies

  • Hi Adam,

    Another aproach in your scenario is using an untyped message in your workflow declaration. The following screen snippet shows an example of the generating a message for web service:

     

    The custom activity CreateMessage during the design time will create a parametrized xslt template resource of the soap message. This xslt resource during the runtime time will generate a soap message for Send activity. The response message can be transformed in the custom activity Transform based on the needs.

    The following picture shows a concept of the CreateMessage custom activity:


    More details about this technique (Model-First, Contract-First, etc.) can be found in my articles:
    WF4 Custom activities for message mediation
    - Contract Model for Manageable Services
    - Manageable Services
    - Azure Virtual Bridge

    Thanks

    Roman


    Roman Kiss, MVP Connected System Developer

    • Marked as answer by LeoTang Sunday, November 11, 2012 9:06 AM
    Sunday, November 4, 2012 8:03 PM
  • Thanks for a very detailed answer :)

    I'll have to think about that; not sure how well it fits with our existing model, but it's definitely an interesting approach.

    Wednesday, November 7, 2012 12:03 AM