none
Recall a service in WF4 RRS feed

  • Question

  • Hi, is it possible to recall a past service in WF4?

    I have a scenario like this (sequence wf):

    a) Service1

    b) Service2

    c) Service3

     

    When i'm on service3 can i recall service2, or catch the error "out of order"?


    Thanks.

     

    Wednesday, May 12, 2010 1:07 PM

Answers

  • Hi Jeanson, you can achieve your scenario by changing your workflow.

    1. Add another branch in the Pick, and putting an While activity in the trigger.

    2. Putting the While.Condition = true.

    3. Putting your Operation2 in the While.Body.

    DONE. :)

    Hope it works for you.

    Monday, May 17, 2010 7:02 AM
    Moderator

All replies

  • Could you provide more details on your real scenario? Are you invoking external WCF services? What do you exactly mean by "on service3"?

    Thanks,

    Kenny

    Wednesday, May 12, 2010 1:19 PM
    Moderator
  • Do you mean you have a Sequence WF in which you have those three items in sequence, and after service3 is done, you want to call service2? If that's what you mean, you may want to use Flowchart instead of Sequence? Sequence executes its content in order, it doesn't go backward.
    Wednesday, May 12, 2010 1:25 PM
    Moderator
  • Hi kenny, thanks for you replay.

    So, i have this scenario:

     My sequence WF is like the one reported in the image http://k8jlfg.bay.livefilestore.com/y1pRQo4KsNTKGvIQ0Y0ZQnvBLbQ8l3wL8tvfTQCps6C2tKaIEQiDQRQFgAu1jDgJxfv4d_uXMtqjc4XBrJwp-UDH9esCLrtnpez/WorkflowService.jpg

    Init1 create instance of WF and init correlation.

    My questions are:

    1) If user call 2 times the Init with identical correlation data can i catch the error/exception directly in WF? Or only the client can catch it (normally it get an ABORT Message)?

    2) Il user call Operation2 when WF is in DoWhile cycle (so Operation2 has already been called), can i catch this error in WF in some way?

     

    What i would is that: when a client call my WF i would avoid FAULT message and replay at recalled operation with the message generated at first call of service.

    The only solution that i think is to crate a WCF wrapper that revice call from client, check if the service has already been called, and if so, replay with the correct message. If serice is not call, the wrapper call WF Service, reg the response and pass it to caller.

     

    Thanks

     

    Wednesday, May 12, 2010 1:44 PM
  • Hi all,

    I am not sure i understand your problem...

    Are you looking for something to ordering your contract like the OperationContract attributes in WCF ?

    Like this :

    [OperationContracts(IsInitiating=true)]

    [OperationContracts(IsInitiating=false)]

    [OperationContracts(IsInitiating=false, isTerminating=true)]


    Jérémy Jeanson MCP http://blogs.codes-sources.com/JeremyJeanson/ (French or English Spoken)
    Wednesday, May 12, 2010 2:04 PM
  • Hi Jeanson,

    thanks for your reply, but i'm asking for other question.

    I will use all WF features (persistence, availability, ecc) and make all operation based on external call (pratically WCF serivce) with Revice Activity. I would support my user so the can retry to call the same service (out-of-order if it has already been called) if they haven't recive response message.

    In my WF http://k8jlfg.bay.livefilestore.com/y1pRQo4KsNTKGvIQ0Y0ZQnvBLbQ8l3wL8tvfTQCps6C2tKaIEQiDQRQFgAu1jDgJxfv4d_uXMtqjc4XBrJwp-UDH9esCLrtnpez/WorkflowService.jpg  normal flow is:

    1) Initi -> 2) Operation2 -> 3) MakeDouble or Terminate

    Normally after i call Operation2, i can call MakeDouble or Terminate and if i recall Operation2 i get an error of "out-of-order" service. What i will do is that: when WF is in doWhile i would catch the eventually recall of Operation2/Init and response whit a custom message (in case of recall of Operation2 i would resend the same response message that i send in first call).

     

    I hope i was clear.

     

    Wednesday, May 12, 2010 2:17 PM
  • Hi Jeanson, you can achieve your scenario by changing your workflow.

    1. Add another branch in the Pick, and putting an While activity in the trigger.

    2. Putting the While.Condition = true.

    3. Putting your Operation2 in the While.Body.

    DONE. :)

    Hope it works for you.

    Monday, May 17, 2010 7:02 AM
    Moderator