How to get Process startTimeString

Hi Guys,

I try to get the startTimeSting for a process instance. But all given services in the wmMonitor package only returns the auditTimeString which represents the date of the last change.

Have everyone an idea how I can get the startTimeString for a process instance.

Thanks for help.
Mario

I’d say you should retrieve all the steps of the process instance and then find the step with the earliest date. That will be the process start time. I don’t think the start time is available directly.

Thanks for reply. So I found a Service (ws.monitor.process.instance:getDetails) which returns the start Time as milliseconds.

To convert the milliseconds to a date string I have create a little Java service which I used as transformer in a mapping step.

Input: startTime as java.lang.long
Output: startTimeString as sting


public static final void convertJavaDate(IData pipeline)
			throws ServiceException {
		IDataCursor cursor = pipeline.getCursor();
		
		long startTime = 0;
		long startTimeTemp = 0;
		String startTimeString = null;
					
		try {
				startTimeTemp = IDataUtil.getLong(cursor, "startTime", startTime);
		
				startTimeString = new SimpleDateFormat("dd.MM.yyyy HH:mm").format(new Date(startTimeTemp));
			
				IDataUtil.put(cursor, "startTimeString", startTimeString);
			
			} catch (Exception e) {
				throw new ServiceException(e);
			} finally {
				cursor.destroy();
			}
	}

Hope this will help anyone;)
Mario

YES, Thanks for sharing.

Use it at your own risk. It’s an internal service and is subject to change without notice. I wouldn’t use it if there is an official way to achieve the goal.