Topic
  • 5 replies
  • Latest Post - ‏2009-12-23T20:11:40Z by SystemAdmin
SystemAdmin
SystemAdmin
38 Posts

Pinned topic How Timestamp Utility Service works ?

‏2009-12-22T16:02:17Z |
Hello,\n\nI&apos;m want to format a date but I need some help. I don&apos;t understand why my exemple is not working. \nFor exemple, my date is formated like this : 2009-10-29 16:30:00 and I want this final date : 20091029.\n\nLook my test BP : \n\ncode\n<process name=\"ELV_test_bp\">\n <sequence name=\"Sequence Start\">\n <operation name=\"Timestamp Utility\">\n <participant name=\"TimestampUtilService\"/>\n <output message=\"TimestampUtilServiceTypeInputMessage\">\n <assign to=\"action\">format</assign>\n <assign to=\"baseTime\">2009-10-29 16:30:00</assign>\n <assign to=\"format\">yyyyMMdd</assign>\n <assign to=\".\" from=\"*\"></assign>\n </output>\n <input message=\"inmsg\">\n <assign to=\".\" from=\"*\"></assign>\n </input>\n </operation>\n </sequence>\n</process>\n[/code]\n\n\nI have this error in my BP : [b]Error parsing baseTime from BPML.[/b]\n\nWhat is my error ?\n\nThank for your help
Updated on 2009-12-23T20:11:40Z at 2009-12-23T20:11:40Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    38 Posts

    RE: How Timestamp Utility Service works ?

    ‏2009-12-22T16:59:27Z  
    This may be because we are trying to pass a string in time. This may work. \n\ncode\n<operation> \n <participant name=\"TimestampUtilService\"/> \n <output message=\"xout\"> \n <assign to=\"action\" from=\"&apos;format&apos;\"/> \n <assign to=\"baseTime\" from=\"&apos;now&apos;\"/> \n <assign to=\"format\">yyyy.MM.dd G &apos;at&apos; hh:mm:ss z</assign> \n </output> \n <input message=\"in\"> \n <assign to=\".\" from=\"*\"/> \n </input> \n </operation> \n[/code]\n\nhttp://www.sterlingcommerce.com/Documentation/GIS43/Content/SvcAdpts/Timestamp%20Utility%20Service.html\n\nThanks\n\nNitin
  • SystemAdmin
    SystemAdmin
    38 Posts

    RE: How Timestamp Utility Service works ?

    ‏2009-12-22T17:03:42Z  
    This may be because we are trying to pass a string in time. This may work. \n\ncode\n<operation> \n <participant name=\"TimestampUtilService\"/> \n <output message=\"xout\"> \n <assign to=\"action\" from=\"&apos;format&apos;\"/> \n <assign to=\"baseTime\" from=\"&apos;now&apos;\"/> \n <assign to=\"format\">yyyy.MM.dd G &apos;at&apos; hh:mm:ss z</assign> \n </output> \n <input message=\"in\"> \n <assign to=\".\" from=\"*\"/> \n </input> \n </operation> \n[/code]\n\nhttp://www.sterlingcommerce.com/Documentation/GIS43/Content/SvcAdpts/Timestamp%20Utility%20Service.html\n\nThanks\n\nNitin
    Or we will need to express basetime in milliseconds or any other scale based on following two params. \n\nbaseTime\nString to use as the base time. Optional. Default time expression is milliseconds; used if no scale is supplied (see scale parameter, below).\n\nscale\nHow the parameter value is expressed in time scales. Valid values are msec, sec, min, hr, and day. Optional. If not set, the baseTime and offsetTime parameters are expressed in milliseconds.\n\nThanks\n\nNitin
  • SystemAdmin
    SystemAdmin
    38 Posts

    RE: How Timestamp Utility Service works ?

    ‏2009-12-22T18:33:41Z  
    Or we will need to express basetime in milliseconds or any other scale based on following two params. \n\nbaseTime\nString to use as the base time. Optional. Default time expression is milliseconds; used if no scale is supplied (see scale parameter, below).\n\nscale\nHow the parameter value is expressed in time scales. Valid values are msec, sec, min, hr, and day. Optional. If not set, the baseTime and offsetTime parameters are expressed in milliseconds.\n\nThanks\n\nNitin
    Thank for your answer but I always have the problem. \n\nIf I have understood, the parameter [i]baseTime[/i] must be filled with a timestamp in milliseconds. But how can I get this timestamp ? The date I attempt to format comes from a GetDocumentInfo service, for exemple in the ProcessData I have :\n\n<DocumentCreateTime>2009-12-22 11:05:40.319</DocumentCreateTime>\n<DocumentModifiedTime>2009-12-22 11:05:40.319</DocumentModifiedTime>\n\nSo how can I format my DocumentCreateTime in order to have : 20091222 ?\nSame question for my DocumentModifiedTime in order to hav : Dec 22 2009 11:05:40\n\n\nanother question : What is thue use of the parameters \"baseTimeFormat\" ? This param is not mentioned in the doc.\n\n\nThank you
    Updated on 2009-12-22T18:33:41Z at 2009-12-22T18:33:41Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    38 Posts

    RE: How Timestamp Utility Service works ?

    ‏2009-12-23T12:19:47Z  
    Thank for your answer but I always have the problem. \n\nIf I have understood, the parameter [i]baseTime[/i] must be filled with a timestamp in milliseconds. But how can I get this timestamp ? The date I attempt to format comes from a GetDocumentInfo service, for exemple in the ProcessData I have :\n\n<DocumentCreateTime>2009-12-22 11:05:40.319</DocumentCreateTime>\n<DocumentModifiedTime>2009-12-22 11:05:40.319</DocumentModifiedTime>\n\nSo how can I format my DocumentCreateTime in order to have : 20091222 ?\nSame question for my DocumentModifiedTime in order to hav : Dec 22 2009 11:05:40\n\n\nanother question : What is thue use of the parameters \"baseTimeFormat\" ? This param is not mentioned in the doc.\n\n\nThank you
    Hi Laurent, \n\nThanks for good clue. I didn&apos;t check the gbm till now.\n\nIt seems baseTimeFormat works only with add and subtract action. I have used workaround to achieve what we are trying. Please look for the following BPs. \n\n1) BP to format simple hardcoded date.\ncode\n<process name=\"TimestampUtilTest\">\n <sequence name=\"Sequence Start\">\n <operation name=\"Timestamp Utility\">\n <participant name=\"TimestampUtilService\"/>\n <output message=\"TimestampUtilServiceTypeInputMessage\">\n\t\t<assign to=\"action\">add</assign>\n\t\t<assign to=\"baseTimeFormat\">yyyy-MM-dd HH:mm:ss</assign>\n\t\t<assign to=\"baseTime\">2009-10-29 16:30:00</assign>\n\t\t<assign to=\"offsetTime\">0</assign>\n\t\t<assign to=\"scale\">sec</assign>\n\t\t<assign to=\"format\">yyyyMMdd</assign>\n\t\t<assign to=\".\" from=\"*\"></assign>\n </output>\n <input message=\"inmsg\">\n\t\t<assign to=\".\" from=\"*\"></assign>\n </input>\n </operation>\n </sequence>\n</process>\n\n[/code]\n\n2) BP to format the DocumentModifiedTime from getDocumentInfoService. \ncode\n<process name=\"TimestampUtilTest\">\n <sequence name=\"Sequence Start\">\n <operation name=\"getDocInfo\"> \n\t<participant name=\"GetDocumentInfoService\"/> \n\t<output message=\"xout\"> \n\t\t<assign to=\".\" from=\"*\"/> \n\t</output> \n\t<input message=\"xin\"> \n\t\t<assign to=\".\" from=\"*\"/> \n\t</input> \n\t</operation> \n <operation name=\"Timestamp Utility\">\n <participant name=\"TimestampUtilService\"/>\n <output message=\"TimestampUtilServiceTypeInputMessage\">\n\t\t<assign to=\"action\">add</assign>\n\t\t<assign to=\"baseTimeFormat\">yyyy-MM-dd HH:mm:ss.SSS</assign>\n\t\t<assign to=\"baseTime\" from=\"//DocumentModifiedTime/text()\" />\n\t\t<assign to=\"offsetTime\">0</assign>\n\t\t<assign to=\"scale\">sec</assign>\n\t\t<assign to=\"format\">yyyyMMdd</assign>\n\t\t<assign to=\".\" from=\"*\"></assign>\n </output>\n <input message=\"inmsg\">\n\t\t<assign to=\".\" from=\"*\"></assign>\n </input>\n </operation>\n </sequence>\n</process>\n\n[/code]\n\nFollowing is my processdata from the above BP. Please notice the formated time in bold.\ncode\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ProcessData>\n <PrimaryDocument SCIObjectID=\"--------------:node1:125b02ded79:314055\"/>\n <BodyName>Abc.txt</BodyName>\n <BodyLength>9</BodyLength>\n <DocumentBodyLength>9</DocumentBodyLength>\n <DocumentLength>9</DocumentLength>\n <DocumentName>Abc.txt</DocumentName>\n <DocumentId>--------------:node1:125b02ded79:314053</DocumentId>\n <DocumentSubject/>\n <DocumentCreateTime>2009-12-23 12:38:33.254</DocumentCreateTime>\n <DocumentModifiedTime>2009-12-23 12:38:33.254</DocumentModifiedTime>\n <DocumentLifeSpan>0 Minutes</DocumentLifeSpan>\n <DocumentInitialId>--------------:node1:125b02ded79:314053</DocumentInitialId>\n <DocumentMaxInlineBodySize>102400</DocumentMaxInlineBodySize>\n <DocumentPurgeAfter>2009-12-23 12:38:33.282</DocumentPurgeAfter>\n <DocumentStorageType>DATABASE</DocumentStorageType>\n <DocumentWorkflowId>329024</DocumentWorkflowId>\n <Encrypted>false</Encrypted>\n <DocumentType>0</DocumentType>\n <DocumentContentType>text/plain</DocumentContentType>\n <timeMillis>1261552113254</timeMillis>\n [b]size=6<time>20091223</time>[/size][/b]\n</ProcessData>\n\n[/code]\n\nYou may raise documentation bug with Support for documentation baseTimeFormat. And may be an enhancement / bug to allow usage of baseTimeFormat with format action. \n\nI hope it helps. \n\nThanks\n\nNitin
  • SystemAdmin
    SystemAdmin
    38 Posts

    RE: How Timestamp Utility Service works ?

    ‏2009-12-23T20:11:40Z  
    Hi Laurent, \n\nThanks for good clue. I didn&apos;t check the gbm till now.\n\nIt seems baseTimeFormat works only with add and subtract action. I have used workaround to achieve what we are trying. Please look for the following BPs. \n\n1) BP to format simple hardcoded date.\ncode\n<process name=\"TimestampUtilTest\">\n <sequence name=\"Sequence Start\">\n <operation name=\"Timestamp Utility\">\n <participant name=\"TimestampUtilService\"/>\n <output message=\"TimestampUtilServiceTypeInputMessage\">\n\t\t<assign to=\"action\">add</assign>\n\t\t<assign to=\"baseTimeFormat\">yyyy-MM-dd HH:mm:ss</assign>\n\t\t<assign to=\"baseTime\">2009-10-29 16:30:00</assign>\n\t\t<assign to=\"offsetTime\">0</assign>\n\t\t<assign to=\"scale\">sec</assign>\n\t\t<assign to=\"format\">yyyyMMdd</assign>\n\t\t<assign to=\".\" from=\"*\"></assign>\n </output>\n <input message=\"inmsg\">\n\t\t<assign to=\".\" from=\"*\"></assign>\n </input>\n </operation>\n </sequence>\n</process>\n\n[/code]\n\n2) BP to format the DocumentModifiedTime from getDocumentInfoService. \ncode\n<process name=\"TimestampUtilTest\">\n <sequence name=\"Sequence Start\">\n <operation name=\"getDocInfo\"> \n\t<participant name=\"GetDocumentInfoService\"/> \n\t<output message=\"xout\"> \n\t\t<assign to=\".\" from=\"*\"/> \n\t</output> \n\t<input message=\"xin\"> \n\t\t<assign to=\".\" from=\"*\"/> \n\t</input> \n\t</operation> \n <operation name=\"Timestamp Utility\">\n <participant name=\"TimestampUtilService\"/>\n <output message=\"TimestampUtilServiceTypeInputMessage\">\n\t\t<assign to=\"action\">add</assign>\n\t\t<assign to=\"baseTimeFormat\">yyyy-MM-dd HH:mm:ss.SSS</assign>\n\t\t<assign to=\"baseTime\" from=\"//DocumentModifiedTime/text()\" />\n\t\t<assign to=\"offsetTime\">0</assign>\n\t\t<assign to=\"scale\">sec</assign>\n\t\t<assign to=\"format\">yyyyMMdd</assign>\n\t\t<assign to=\".\" from=\"*\"></assign>\n </output>\n <input message=\"inmsg\">\n\t\t<assign to=\".\" from=\"*\"></assign>\n </input>\n </operation>\n </sequence>\n</process>\n\n[/code]\n\nFollowing is my processdata from the above BP. Please notice the formated time in bold.\ncode\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ProcessData>\n <PrimaryDocument SCIObjectID=\"--------------:node1:125b02ded79:314055\"/>\n <BodyName>Abc.txt</BodyName>\n <BodyLength>9</BodyLength>\n <DocumentBodyLength>9</DocumentBodyLength>\n <DocumentLength>9</DocumentLength>\n <DocumentName>Abc.txt</DocumentName>\n <DocumentId>--------------:node1:125b02ded79:314053</DocumentId>\n <DocumentSubject/>\n <DocumentCreateTime>2009-12-23 12:38:33.254</DocumentCreateTime>\n <DocumentModifiedTime>2009-12-23 12:38:33.254</DocumentModifiedTime>\n <DocumentLifeSpan>0 Minutes</DocumentLifeSpan>\n <DocumentInitialId>--------------:node1:125b02ded79:314053</DocumentInitialId>\n <DocumentMaxInlineBodySize>102400</DocumentMaxInlineBodySize>\n <DocumentPurgeAfter>2009-12-23 12:38:33.282</DocumentPurgeAfter>\n <DocumentStorageType>DATABASE</DocumentStorageType>\n <DocumentWorkflowId>329024</DocumentWorkflowId>\n <Encrypted>false</Encrypted>\n <DocumentType>0</DocumentType>\n <DocumentContentType>text/plain</DocumentContentType>\n <timeMillis>1261552113254</timeMillis>\n [b]size=6<time>20091223</time>[/size][/b]\n</ProcessData>\n\n[/code]\n\nYou may raise documentation bug with Support for documentation baseTimeFormat. And may be an enhancement / bug to allow usage of baseTimeFormat with format action. \n\nI hope it helps. \n\nThanks\n\nNitin
    Hi,\n\nThank for your exemple, it&apos;s working perfectly.\n\nIt&apos;s seems that with the Format parameter a bug occurs but if we use add parameter and we add 0sec, we can format the date like we want.