IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 6 replies
  • Latest Post - ‏2012-10-24T14:41:49Z by SystemAdmin
SystemAdmin
SystemAdmin
7615 Posts

Pinned topic Timer problem during snapshot change

‏2012-07-18T15:58:07Z |
Hello Everyone,

I would like to ask one question, related to the processes migration between different snapshots.

Our case is the following:
1. We have one process, with an activity in it (of course it is more complicated .... but anyway).

In snapshot V1 this activity has one timer event, that is fired 20 days after the activity start
In snapshot V2 the same activity has another timer event (first one is deleted and new one is created), that is fired 1min after the task due date is reached.
Currently the problem is that all the running instances that were migrated from V1 to V2 and are on the mentioned activity are failing when we complete the activity.
The reason is because the timer that was available in V1 version is not currently available and the process fails with "Cannot find object with id BPDObjectIdImpl ...... in diagram .....".

I've tried the following things:
Using REST API - moveToken & deleteToken to remove the token that is not present in V2 snapshot - with both of them I don't succeeded. Even that the token exist in V1, I'm not able to move or delete the token.
Suspend -> Resume is also not working.
Process diagram cannot be displayed.
While trying all the steps above, no errors were thrown in SystemOut.log

The only way that I've managed to workaround this issue is to switch back all the processes to snapshot V1, then retry the failed steps and after that to switch back to the new snapshot - this way everything is OK, but this is working only for the instances that have passed this activity and have failed, but I have around 1000 that are still on this task and I can not do anything with them until they are finished and fail.
My questions are actually 2:
Have anyone know a way, with which I can move the current activity? (I've also tried to use the process diagram (svg) but It is not working for this specific process - it shows only blank screen)?
If the answer to the previous question is negative, do you know a way with which I can migrate only specific instances to specific snapshot? (because migrate inflight data from process admin is working for all processes)?

I forget to mention, we are using BPM 7.5.1 Std on AIX with Oracle.

Best Regards,
Ivo
Updated on 2012-10-24T14:41:49Z at 2012-10-24T14:41:49Z by SystemAdmin
  • Arjunvs
    Arjunvs
    33 Posts

    Re: Timer problem during snapshot change

    ‏2012-10-08T07:21:49Z  
    Any solutions for this? I am stuck with a similar problem.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Timer problem during snapshot change

    ‏2012-10-08T07:28:15Z  
    • Arjunvs
    • ‏2012-10-08T07:21:49Z
    Any solutions for this? I am stuck with a similar problem.
    Hi Arjunvs,
    I fixed the problem moving the application to the previous snapshot.

    There is no official way of moving the token.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Timer problem during snapshot change

    ‏2012-10-08T12:49:19Z  
    Hi Arjunvs,
    I fixed the problem moving the application to the previous snapshot.

    There is no official way of moving the token.
    One of the questions in the first post was "Is there a way to migrate specific instances?" The JS-API has a call "migrateTo()" on the TWProcessInstance object.

    Andrew Paier | Director of Special Operations | BP3 Global, Inc. www.bp-3.com
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Timer problem during snapshot change

    ‏2012-10-08T13:00:56Z  
    One of the questions in the first post was "Is there a way to migrate specific instances?" The JS-API has a call "migrateTo()" on the TWProcessInstance object.

    Andrew Paier | Director of Special Operations | BP3 Global, Inc. www.bp-3.com
    Hi,
    Yes, this is exactly what I'm using.
    
    var targetSnapshot = tw.system.model.processApp.findSnapshotByID(tw.local.targetSnapshot); 
    // some code ...   var process = tw.system.findProcessInstanceByID(tw.local.bpdInstances[i].bpdInstanceId); 
    
    if(process == 
    
    null || process == undefined)
    { log.error(
    "Process instance: " + tw.local.bpdInstances[i].bpdInstanceId + 
    " not found!"); 
    
    continue; 
    } log.info(
    "Change Process " + tw.local.bpdInstances[i].bpdInstanceId + 
    " snapshot from: " + process.snapshot.id + 
    " to " + targetSnapshot.id); 
    
    try 
    { process.migrateTo(targetSnapshot); 
    } 
    
    catch (e)
    { log.error(
    "Problem when changing process " + tw.local.bpdInstances[i].bpdInstanceId + 
    " snapshot!"); 
    }
    
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Timer problem during snapshot change

    ‏2012-10-22T16:26:22Z  
    Hi,
    Yes, this is exactly what I'm using.
    <pre class="jive-pre"> var targetSnapshot = tw.system.model.processApp.findSnapshotByID(tw.local.targetSnapshot); // some code ... var process = tw.system.findProcessInstanceByID(tw.local.bpdInstances[i].bpdInstanceId); if(process == null || process == undefined) { log.error( "Process instance: " + tw.local.bpdInstances[i].bpdInstanceId + " not found!"); continue; } log.info( "Change Process " + tw.local.bpdInstances[i].bpdInstanceId + " snapshot from: " + process.snapshot.id + " to " + targetSnapshot.id); try { process.migrateTo(targetSnapshot); } catch (e) { log.error( "Problem when changing process " + tw.local.bpdInstances[i].bpdInstanceId + " snapshot!"); } </pre>
    Hi Ivo Kotec !

    There is a video showing how to move a token in IBM BPM 7.5.1...

    http://vimeo.com/groups/ibmbpm/videos/30820510

    I hope it helps
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Timer problem during snapshot change

    ‏2012-10-24T14:41:49Z  
    Hi Ivo Kotec !

    There is a video showing how to move a token in IBM BPM 7.5.1...

    http://vimeo.com/groups/ibmbpm/videos/30820510

    I hope it helps
    Tokens are associated with the System IDs of the components that we use on the process. In your case you had a token 1 associated with Timer 1 in V1 of snapshot. Now in V2 you have deleted timer 1. Since as a part of migration of snapshot the System tries to assign the token to Timer 1 and it does not find timer 1, it throws the current error.

    Workaround :
    Take an export of V1 version of the code. This is a series of XML files.
    Search for your timer name in these files and take a note of the System ID associated with it.

    Take an export V2 version of the code to a TWX file.
    Search for the system Id of the new timer in V2 and replace it with the system ID of the timer in V1 version.

    Import the modified TWX to an environment where you do not have the V2 snapshot ID. Recreate a new Snapshot e.g. v3. Bring this version back into your dev environment. And promote your code.

    Now your instances will migrate without any issue.