Workflow Soluiton

 View Only
  • 1.  Syncronous task execution

    Posted Jan 12, 2016 06:07 AM

    Hi,

    I want to execute an SMP Task with a workflow. To to this, I am using the 'Execute Task' component. It works, but the problem is that I want to execute this task in a syncronous way.

    The 'Execute Task' component launch the task but it does not waits until the process has finished. I need to be able to determine when the task has finished as other task needs to be executed after the first one. Besides, I need to get the result and the output of the first task to be shown to the user.

    Thanks and regards

     



  • 2.  RE: Syncronous task execution

    Posted Jan 12, 2016 12:22 PM

    Workflow comes with some prebuild ASDK Task comps that resumble "Execute X" and "Get X Results", where X are tasks. You can probably make use of one of these components, or, if yours is a custom task" query the GetResults method of ASDK Task web service directly to get the status of the task.
     



  • 3.  RE: Syncronous task execution

    Posted Jan 15, 2016 06:51 AM

    Thanks Reecardo for your quick answer (not like me).

    Finally we have tried to get the end of the Task by doing a query to NS database asking for the final state and another query to get the result (this is one of the queries wr are using)

    • select value from TaskOutputPropertyValue where TaskInstanceGuid in (select taskinstanceguid from TaskInstanceParents where ParentTaskInstanceGuid = @instancia)

    I am not entirely satisfied with this solution, so I will try to follow your suggestion.

    But the main problem is to execute the task synchronously, this is my main goal.

    Do you know if there is a way to execute an SMP task in a workflow in a way that the next task waits for the completion of first one?

    Thanks a lot.

    Regards

     

     



  • 4.  RE: Syncronous task execution

    Posted Jan 15, 2016 02:53 PM

    If this is part of a Workflow type project, you could put this on it's own thread. Have this component get the results, and if its not true, wait a few seconds or minutes and then retry. When completed, you can merge the thread back into the Workflow.
     



  • 5.  RE: Syncronous task execution

    Posted Jan 18, 2016 07:12 AM

    Hi Reecardo,

    Yes, this is the solution I am using. I have a loop to check periodically the state of the task and when it is completed, the next component of the workflow starts. I works but I think we can have a problem if more than one user starts the task at nearly the same time. We use task GUID to determine if the task has finished. So, if two or more users have started the task, we can get an error in the final state because several executions can be mixed.

    That was the reason I said I was not enterely satisfied with the solution.

    I would like to know if there is a reliable way of executing an SMP task without startintg the next component until the first one has finished.

    If there is some documentation or examples that can apply to my needs, I would be very grateful.

    Thanks for your interest and dedication.

    Regards