Topic
  • 4 replies
  • Latest Post - ‏2013-09-09T14:06:16Z by Oleks Maistrenko
Tukin_Ivan
Tukin_Ivan
13 Posts

Pinned topic Get Last Modification Time of Process Instance using javascript API

‏2013-09-05T12:06:55Z |

Hello, everyone!

 

In REST API  response for GET http://<hostname>:9080/rest/bpm/wle/v1/process/<processId>?parts=header there is an "lastModificationTime"  field.

Is there any ways to get this field using javascript API.

 

Thanks in advance!

  • kolban
    kolban
    3316 Posts

    Re: Get Last Modification Time of Process Instance using javascript API

    ‏2013-09-09T03:32:10Z  

    I would have imagined that if the field was exposed, it would have been part of the TWProcessInstance object but I am unfortunately not seeing it there.  It is lamentable to me that we have distinctions in the REST APIs vs the JavaScript APIs and all I can really suggest is to create a new Request for Enhancement or vote up an existing enhancement request.

    Neil

  • Oleks Maistrenko
    Oleks Maistrenko
    7 Posts

    Re: Get Last Modification Time of Process Instance using javascript API

    ‏2013-09-09T11:59:23Z  
    • kolban
    • ‏2013-09-09T03:32:10Z

    I would have imagined that if the field was exposed, it would have been part of the TWProcessInstance object but I am unfortunately not seeing it there.  It is lamentable to me that we have distinctions in the REST APIs vs the JavaScript APIs and all I can really suggest is to create a new Request for Enhancement or vote up an existing enhancement request.

    Neil

    Hello Neil,

    I think that the JavaScript API allows the developers to access everything that is visible in the Inspector view of the Process Designer (correct me if I'm wrong). And as you can see the last modification date is not available in this view. However, there is a way to get an error of the step using the following JavaScript "tw.system.currentProcessInstance.tasks[2].processInstanceStep.error". It is an XMLElement, so you *should* be able to get the error and timestamp. But I get null for the failed step in the failed process. (When I try for a different task, e.g., for 1st, I get an exception.)

    Is there any other way to access the error of the step/process in JavaScript? (except for this one and 'tw.system.error' which also gives null in our case...)?

    Oleks

  • kolban
    kolban
    3316 Posts

    Re: Get Last Modification Time of Process Instance using javascript API

    ‏2013-09-09T13:13:20Z  

    Hello Neil,

    I think that the JavaScript API allows the developers to access everything that is visible in the Inspector view of the Process Designer (correct me if I'm wrong). And as you can see the last modification date is not available in this view. However, there is a way to get an error of the step using the following JavaScript "tw.system.currentProcessInstance.tasks[2].processInstanceStep.error". It is an XMLElement, so you *should* be able to get the error and timestamp. But I get null for the failed step in the failed process. (When I try for a different task, e.g., for 1st, I get an exception.)

    Is there any other way to access the error of the step/process in JavaScript? (except for this one and 'tw.system.error' which also gives null in our case...)?

    Oleks

    Hi Oleks,

    I think you have hijacked this thread for a new topic :-) .... Might I suggest that you create a new thread for your "error" discussion and we can have a look there?

    Neil

  • Oleks Maistrenko
    Oleks Maistrenko
    7 Posts

    Re: Get Last Modification Time of Process Instance using javascript API

    ‏2013-09-09T14:06:16Z  
    • kolban
    • ‏2013-09-09T13:13:20Z

    Hi Oleks,

    I think you have hijacked this thread for a new topic :-) .... Might I suggest that you create a new thread for your "error" discussion and we can have a look there?

    Neil

    Hello Neil,

    true. We are working together with Ivan, so I know a bit more about the context of this problem. :-)

    So far we are interested in the "Last Modification Time" for the failed process instances. Therefore my post was more about a workaround that doesn't work apparently. But we could also generalize the question (as Ivan did in the first post).

    Thanks for your time!

    Oleks