How to synchrorise two workflow tasks/calls?

Hi all,
We are writing a Workflow client application (in Java) and having problem getting valid state of the workflow because of the delay in PL/SQL API.
Here's are two example:
1) First we respond to a notification (using WF_Notification.Respond). After the Respond call has returned, we use a new transaction to scan the table for open notification for the user.
We got back the responded notification as open notification as the table values have not been changed.
We found that the table values will only change after a certain period.
2) Expedite the process
First we call the handleError API. Then read the table for activity statuses. Again, the table values are not updated even the handleError API has returned. We need to wait for 1 or 2 sec before the table are in valid states.
Anyone know how can we synchorise these? May be there's a flag we can set to force the API blocks until it completed processing or a flag we can check to find out the status of the last API call.
Thanks.

I had similar issues when I developed a workflow portlet. I maintained a record of recently actioned notifications and hid them from the user for the next few requests.
Regards,
Mark

Similar Messages

  • How to reassign a workflow task which has been already acquired

    Hi,
    I would be glad if anybody could explain how to reassign a workflow task which is been acquired by one user to another user. I am getting Worklist Service Task Update Error when I am trying to change acquired by field and update the task.
    Thanks,
    Mythili

    I can use delegateTask() if the context belongs to the person who acquired the task but I want to delegate a task to different person even if it is not me who acquired the task.
    My second question is when should I set Assignees for a task?Is it when a person acquires a task for the first time or do I need to specify it in some configuration file, so that every task that is created newly will have a set of assignees by default.
    Thanks,
    Mythili.

  • How to reassign a workflow task in SharePoint 2013?

    How can you reassign a workflow task in SharePoint 2013 (online)? I found some discussions online about how to do this, but I don't see this option using SP2013. Note the "Reassignment" checkbox from this screenshot (which I think is from 2010).

    Here is the link
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/fac7eb06-c42e-4f45-bcda-10df28879c1f/in-sharepoint-2013-workflows-can-a-task-be-reassigned?forum=sharepointgeneral
    Thanks!

  • How to edit/modify workflow task after it has been completed?

    My workflow spawns a couple tasks and once those tasks are completed, they become non-modifiable. If the user made a mistake by entering wrong details while completing the task and would like to change it later, he cannot do so once he hits the complete
    button. This is happening in SharePoint 2010.
    We were using SharePoint 2007 earlier when this wasn't the case. The tasks could be modified even after they were completed. I would like to have the same behavior in 2010 too. Please suggest how can I do it? There should be some task settings to enable
    modification but I just can't find them. 

    Hi,
    Thank you for your question. I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience. Thank you for your understanding and support.
    Thanks,
    Linda Li
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • How to get site workflow tasks not list workflow tasks in SharePoint 2013 programatically ?

    i want to customize wrkstat.aspx based on site workflow not list workflow, so i want to filter section of tasks view to filtering based on site workflow, i made this to list workflow and i cannot do that to site workflow.
    Please advise me.
    Thanks.

    Hi Ramakrishnan,
    you can use the below code to post comments in newsfeed. I think this will helps you.
    var feedManagerEndpoint;  
    // Get the SPAppWebUrl parameter from the query string and build  
    // the feed manager endpoint.  
    $(document).ready(function () {  
        var appweburl;  
        var params = document.URL.split("?")[1].split("&");  
        for (var i = 0; i < params.length; i = i + 1) {  
            var param = params[i].split("=");  
            if (param[0] === "SPAppWebUrl") appweburl = param[1];  
        feedManagerEndpoint = decodeURIComponent(appweburl)+ "/_api/social.feed";  
        postToMyFeed();  
    // Publish a post to the current user's feed by using the   
    // "<app web URL>/_api/social.feed/my/Feed/Post" endpoint.  
    function postToMyFeed() {  
        $.ajax( {  
            url: feedManagerEndpoint + "/my/Feed/Post",  
            type: "POST",  
            data: JSON.stringify( {   
                'restCreationData':{  
                    '__metadata':{   
                        'type':'SP.Social.SocialRestPostCreationData'  
                    'ID':null,   
                    'creationData':{   
                        '__metadata':{   
                            'type':'SP.Social.SocialPostCreationData'  
                    'ContentText':'This post was published using REST.',  
                    'UpdateStatusText':false  
            headers: {   
                "accept": "application/json;odata=verbose",  
                "content-type":"application/json;odata=verbose",  
                "X-RequestDigest": $("#__REQUESTDIGEST").val()  
            success: getMyFeed,  
            error: function (xhr, ajaxOptions, thrownError) {   
                alert("POST error:\n" + xhr.status + "\n" + thrownError);  

  • How to compare two workflow files?

    Hi All,
    Is there is any way to compare the two version of the workflow file to find out the exact differences?
    Thanks,
    Arun

    Hi Srini,
    The diff command is working but it is having its own issues.
    e.g. I compared 2 wft files but the output is having a glitch END ACTIVITY which must come at the end of the file is coming in between the file in which I am stroing the difference. (marked in bracket for your ref).
    Is there any way to overcome this issue.
    diff A.wft B.wft >> TESTDIFF.TXT
    3434,3443d3433
    <
    < BEGIN ITEM_ATTRIBUTE "TP"
    < PROTECT_LEVEL = "20"
    < CUSTOM_LEVEL = "20"
    < DISPLAY_NAME = "TP"
    < DESCRIPTION = "TP"
    < TYPE = "VARCHAR2"
    < FORMAT = "78"
    < VALUE_TYPE = "CONSTANT"
    < END ITEM_ATTRIBUTE
    38211,38225d38200
    < [END ACTIVITY]
    <
    < BEGIN ACTIVITY "POAPPRV" "MYFUNC"
    < PROTECT_LEVEL = "0"
    < CUSTOM_LEVEL = "0"
    < DISPLAY_NAME = "My Function"
    < DESCRIPTION = "My Function"
    < TYPE = "FUNCTION"
    < FUNCTION = "My Function"
    < RESULT_TYPE = "*"
    < RERUN = "RESET"
    < COST = "0"
    < ICON_NAME = "FUNCTION.ICO"
    < ERROR_ITEM_TYPE = "WFERROR"
    < RUNNABLE = "Y"

  • How to initiate two simultaneous tasks? First waits on second.

    I'm looking for guidance. I feel my problem is likely very common. It involves performing two tasks simultaneously.
    I have a digitizer (pxi5105) and a waveform generator (pxi5412). I need to generate a pulse and record the response simultaneously. My experiment basically works like this. Imagine that a hammer strikes an object causing it to vibrate. I need to record the resulting vibration beginning with the hammer strike. The generator is the hammer, it generates a pulse. The digitizer records the vibration.
    I can imagine a couple of ways to do this. One is to first initialize the digitizer (set it up to measure voltage), then start the generator. The rising generator signal would trigger the digitizer to take a reading. The reading would be returned to the program for processing.  I'm thinking the digitizer task would have to run in a separate thread. Upon completion, the digitizer task would invoke a callback function in the main program to process the data. I think there's an example program demonstrating this kind of threaded programming. Is this the best way?
    Another approach might be to first turn on the generator and let it run continuously. Then activate the digitizer to trigger off the generator signal as before. This would avoid the complexity of a separate thread. Is this a better approach?
    Is there a way to trigger generator and digitizer simulaneously?
    If there is documentation/example of this please point me there.
    Any recommendations are greatly appreciated.
    thanks!

    Hi,
    I do not think you have to use multiple threads.
    Being very expensive devices, the digitizer and the wave gen are capable of handling most of the stuff on their own.
    First, you configure the generator to generate and the digitizer to trigger and acquire.
    Then, you start the wave generation by software command (digitizer starts acquiring automatically after the waveform crosses the trigger level).
    Then, you wait for the acquisition to finish.
    Then, you read the samples from the digitizer into your array.
    Then, you process them.
    As you see the flow of operations that your program should implement are sequential, not parallel.
    So I do not see a point where you will need multiple threads.
    If the generated waveform is very slow and thus the acquisition is supposed to last too long,
    you can use a small timeout value for your "Fetch waveform" function and loop on it.
    This way, since you can process events within this loop, your program will keep being responsive.
    Hope this helps,
    S. Eren BALCI
    www.aselsan.com.tr

  • How to synchronized two Timer Task ?

    I need to execute 2 job
    job1 every sec
    job2 every min
    when one task is executing other task should wait
    so i created 2 timer
    timer1 will execute secjob every sec
    timer2 will execute minjob every min
    and one job object with synchronized execute method
    please see the code for further detail
    problem:
    before completion of secjob , minjob started excuting
    job Fired Fri Oct 10 20:45:16 IST 2008 by Timer-0 ID :7.....
    job Fired Fri Oct 10 20:45:21 IST 2008 by Timer-0 ID :7.....
    job Fired Fri Oct 10 20:45:26 IST 2008 by Timer-0 ID :7....{color:#ff0000}*job Fired Fri Oct 10 20:45:31 IST 2008 by Timer-1 ID :8*{color}*.*
    {color:#ff0000}*...*{color}
    job Fired Fri Oct 10 20:45:34 IST 2008 by Timer-0 ID :7.....
    job Fired Fri Oct 10 20:45:39 IST 2008 by Timer-0 ID :7.....
    public class Fire {
        static void secJob(Job job)  {
             Timer timer = new Timer();
             int delay = 0;  
             int period = 1000*1; 
             SecJob secJob = new SecJob(job);
             timer.schedule(secJob, delay, period);        
        static void minJob(Job job) {
             Timer timer = new Timer();
             int delay = 0;  
             int period = 1000*60; 
             MinJob minJob = new MinJob(job);
             timer.schedule(minJob, delay, period);
        public static void main(String[] args) {       
            final Job job = new Job();
            secJob(job);
            minJob(job);
    public class SecJob extends TimerTask{
        Job job;
        public SecJob(Job job) {
            this.job = job;
        public void run() {
            job.execute(SecJob.class);
    public class MinJob extends TimerTask{
        Job job;
        public MinJob(Job job) {
            this.job = job;
        public void run() {
            job.execute(MinJob.class);   
    public class Job {
        private void sleep(long count,PrintStream out) {
            try {
                for (int i = 0; i < count; i++) {
                    Thread.sleep(1000*1);
                    out.print(".");
                out.println();
            } catch (InterruptedException e) {
                e.printStackTrace();
        public synchronized void execute(Class c) {
            Thread t = Thread.currentThread();
            if(c == MinJob.class ) {
                System.err.print("job Fired "+new Date()+" by "+t.getName()+" ID :"+t.getId());
                sleep(3,System.err);
            }else if(c == SecJob.class ) {
                System.out.print("job Fired "+new Date()+" by "+t.getName()+" ID :"+t.getId());
                sleep(5,System.out);

    I'd only use one timer and write a dispatcher task that stores the time at which job2 is executed. If the last time is more than one minute past, execute job1, reset the time tracking field, and execute job2.

  • How to use two tasks in Workflow

    Hi Everybody !
    Can Any one tell me, How to use two tasks in one activity step type of  Workflow CRM?
    My requirement is... I have to execute two tasks in single activity step in Workflow. Is it possible.if it is possible tell me the flow Please.
    Thanks in advance.
    Raghava Vakada.

    You can define one as a "Before" or "After" method if that is usable for you. (defined in tab Methods for Activity steps)
    Otherwise there is also the step flag "Advance with dialog" (tab Details on Activity steps, but the tab it is found on depends on your version) which allows one user to seamlessly execute two consecutive tasks.
    So depending on your real need there may be several options available. If all that is needed is that the same user can execute the two tasks then Advance with Dialog is perhaps the best choice. If the user then cancels execution of the second activity the work item is available for execution. If you define an After method and the user cancels execution the work item has still been completed since its (main) method has been completed.

  • Calling workflow tasks in program

    Hi,
    I want to know how to call a workflow task in a ABAP program. This task is linked to a customised method.
    Thanks
    Ananth

    Hi Ananth
    You have two options to trigger a workflow task
    1> Attach a Business object and a particualr event in the
       triggering event of your task.
       Then in your ABAP pgm use FM SWE_EVENT_CREATE to raise
       the event for the Business object and the event which
       you attach in the task as trigerring event
    2> Else , you can make use of SWW_WI_START function module and pass pass parameter ( it will be the name of your workflow task , The workitem Type , creator etc .)
    Thanks
    Shovit

  • How to set a custom column in a workflow task.

    Hello,
    I'm looking for some assistance a bit with how to set a custom column in a Workflow Task.
    I have a List Workflow that starts when an item is created in a list. The workflow, platform type SharePoint 2013, starts a new task, Task1, with Content Type 1. This Content Type has a custom column called Age. Once the Task1 is completed a new task, Task2,
    with Content Type 2, starts and has the same column Age, as Task1.
    How can I populate the Age column in Task2 with the content of the Age column in Task1?
    Since I start the task by running "Assign a task to ..." Action I was thinking to copy the Age column from the Task1 to the list item that started Task1, which has a column Age as well, and then in Task2 to start another workflow - which is associated
    with the Content Type 2,  that would try to read the Age column from the list item that started Task2, which was set once Task1 was competed - I know it's complex but this is how I was thinking. 
    The problem with this approach is that I can't get a reference to the list item that started Task2 to read the Age from the list item.
    Is there a better approach? I use SharePoint Designer 2013 to design all this.
    Any assistance is appreciated.
    Thank you.

    Hello Sebastian,
    you can get the Age column from Task 1 and then update the Task 2 Age column with that value. I am not sure why you want to run another workflow on Task 2.
    You can perform below steps to set Age column from Task 1 to Task 2.
    1.  Create Task 1 using Assign a task , wait till the task is completed.
    2. Get the Age column value based on Task 1 once the task is completed.
    3.Create Task 2 using Assign a task ,  uncheck wait till the task is completed option.
    4. Update the Task 2 with Age column in Task1.
    5. Use Wait for the field to equal value , check for Task Status is completed or not.
    >>The problem with this approach is that I can't get a reference to the list item that started Task2 to read the Age from the list item.
    you can get the related item from task list item to get the main list item.
    Other option is, Use Javascript and CSOM  in task edit form to get the Age column from Task1 and prepoluate the Age value when Task2 is opened.
    Hope this helps.
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Calling Webdynpro application from Workflow Task

    Hi All,
    How do i call a custom Java WebDynPro Application from my task? How to pass the container values to the Webdynpro application.
    Can some one help me out?
    Thanks,
    Sarath

    Hi sarath,
    u see this thread, u get more information
    calling web dynpro from workflow - SWFVISU
    Calling Java code from Webdynpro Abap UI
    WebDynpro application that can work with SAP workflow work items?
    WebDynpro in Workflow
    Regards,
    vino

  • How to trigger a standard workflow task in customizing program?

    Hi experts,
    Does any1 have any ideas about how to trigger a standard workflow task in customizing program? Is there any FMs can be used to do this?
    Thx in advance. Points will be rewarded.
    Vincent

    will followiign Fms help -
    'SWE_EVENT_CREATE'
    SWR_START_WORKFLOW
    SWU_START_WORKFLOW

  • Call enhancement class method from Bus. workflow task

    Hi all,
    I recently enhanced a global class from SAP (add a new method). Now I would like to call it from a workflow task (ABAP Class object used in the task). So it seems that only "native" methods from the class itself can be selected for the object method of the task.
    Same issue if I try to call it via secondary methods options...
    Last idea I have before the repair is: retrieve the instance saved into the WF container via a custom class interfacing IF_IFS_SWF_CONTAINER_EXIT (program exit) and call the enhanced method from the method proposed in this interface.
    Maybe someone had the same issue? Anyone could help or propose solution?
    Many thanks in advance for your help,
    KR,
    Olivier

    I think it might qualify for an OSS message.
    There was simmilar note for BADIs which was corrected: https://service.sap.com/sap/support/notes/1156392
    CL_SWF_UTL_DEF_SERVICES which is used in PFTC to determine callable methods doesn't include enhancements when calling  function SEO_CLASS_TYPEINFO_GET (parameter WITH_ENHANCEMENTS is default FALSE)

  • How does the ADF support romote call method between two managed server ?

    How does the ADF support romote call method between two managed server ?

    You would usually use this as a WebService through the WSDL that is exposed.
    JDeveloper can help you create a Java Proxy to call the Web service if you point it to the WSDL file that was generated for your AM.
    Some other samples here:
    http://www.connotea.org/user/jdeveloper/tag/Service%20Interface

Maybe you are looking for