Topic
  • 4 replies
  • Latest Post - ‏2010-07-09T19:09:38Z by SystemAdmin
SystemAdmin
SystemAdmin
38 Posts

Pinned topic XML BP to choose map based on document type

‏2010-07-07T15:41:32Z |
I have the following BP for inbound XML pidx \"OrderCreate\" files. However, how can I set it up so that a different map is chosen if the inbound document has a root element of \"OrderChange\" instead of \"OrderCreate\". I currently have the \"OrderCreate\" map listed under the TranslationService.\n\n<process name=\"jt_Inbound_XML\">\n <sequence name=\"Main\">\n\n <operation name=\"GetProcessInfo\">\n <participant name=\"BPMetaDataInfoService\"/>\n <output message=\"BPMetaDataServiceTypeInputMessage\">\n <assign to=\".\" from=\"*\"></assign>\n </output>\n <input message=\"inmsg\">\n <assign to=\"WORKFLOW_ID\" from=\"BPDATA/WORKFLOW_ID/text()\" append=\"true\"></assign>\n </input>\n </operation>\n\n <operation name=\"GetDateTime\">\n <participant name=\"TimestampUtilService\"/>\n <output message=\"TimestampUtilServiceTypeInputMessage\">\n <assign to=\".\" from=\"*\"></assign>\n <assign to=\"format\">yyyyMMdd_HHmmss</assign>\n </output>\n <input message=\"inmsg\">\n <assign to=\"DateTime\" from=\"string(time)\"></assign>\n </input>\n </operation>\n\n <operation name=\"File System Adapter\">\n <participant name=\"BaseEDI_FileSystemAdapter\"/>\n <output message=\"FileSystemInputMessage\">\n <assign to=\"appendOnExtract\">false</assign>\n <assign to=\"Action\">FS_EXTRACT</assign>\n <assign to=\"extractionFolder\" from=\"sci-get-property(&apos;base_edi&apos;,&apos;directory.archive.inbound.xml&apos;)\"></assign>\n <assign to=\"assignedFilename\" from=\"concat(/ProcessData/DateTime/text(), &apos;_&apos;, /ProcessData/WORKFLOW_ID/text(), &apos;.txt&apos;)\"></assign>\n <assign to=\".\" from=\"*\"></assign>\n </output>\n <input message=\"inmsg\">\n <assign to=\".\" from=\"*\"></assign>\n </input>\n </operation>\n\n <operation name=\"Translation\">\n <participant name=\"Translation\"/>\n <output message=\"TranslationTypeInputMescolor=#A40808[/color]sage\">\n <assign to=\".\" from=\"*\"></assign>\n <assign to=\"map_name\">Map_OrderCreate2_PIDX</assign>\n </output>\n <input message=\"inmsg\">\n <assign to=\".\" from=\"*\"></assign>\n </input>\n </operation>\n \n </sequence>\n </onFault>\n </sequence>\n</process>\n\n\nThank you for any help you can provide!\n\nJune
Updated on 2010-07-09T19:09:38Z at 2010-07-09T19:09:38Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    38 Posts

    RE: XML BP to choose map based on document type

    ‏2010-07-07T23:37:38Z  
    You can use the Typing Service to first parse the document and return to process data a value based on what the root tag is. The typing service allows you to pass multiple maps, so yo would have one for each different root tag. The output of a typig service map is in process data, allowing the business process to then assign the correct value for the subsequent translation service. Let me know if you need an example map!
  • SystemAdmin
    SystemAdmin
    38 Posts

    RE: XML BP to choose map based on document type

    ‏2010-07-08T12:53:29Z  
    You can use the Typing Service to first parse the document and return to process data a value based on what the root tag is. The typing service allows you to pass multiple maps, so yo would have one for each different root tag. The output of a typig service map is in process data, allowing the business process to then assign the correct value for the subsequent translation service. Let me know if you need an example map!
    Thanks for the info. If you have a sample map that would be great. I&apos;ve never worked with the typing service before.\n\nThanks again for your help!
  • SystemAdmin
    SystemAdmin
    38 Posts

    RE: XML BP to choose map based on document type

    ‏2010-07-09T06:27:31Z  
    Thanks for the info. If you have a sample map that would be great. I&apos;ve never worked with the typing service before.\n\nThanks again for your help!
    Not sure how to attach a map, so here goes to try and explain.\n\nYou will need two maps - one for each type of input. The input side is the input of the data. The output side is XML - structure\n\nOUTPUT\n Mandatory\n MapName\n\nOn the input side, create a new element at the end of the message, say called tmpMapName. Link this to MapName on the output.\n\nStill on the input, on the extended rule OnBegin of the root tag, put the following:\n\n$tmpMapName.#tmpMapName = \"Map_OrderCreate2_PIDX\";\n\nSame for the second map that has the root for OrderChange, with the value being the name of the order change map.\n\nThen, in your bp before the translation step, just put in a call to the typing service, e.g.\n\n<operation name=\"DetermineWhatTheDocumentIs\">\n\t<participant name=\"TypingService\"/>\n\t<output message=\"TypingServiceTypeInputMessage\">\n\t\t<assign to=\"typing_maplist\">Typing_OrderCreate Typing_OrderChange</assign>\n\t\t<assign to=\"required_parmlist\">MapName</assign>\n\t\t<assign to=\"validate_input_against_dtd\">NO</assign>\n\t\t<assign to=\".\" from=\"*\"/>\n\t</output>\n\t<input message=\"inmsg\">\n\t\t<assign to=\".\" from=\"*\"/>\n\t</input>\n</operation>\n\nThe values in the \"typing_maplist\" are the names of your two typing service maps created above.\nYou should now see the output in the process data of your map name, which you can then pass to the translation service.\nIf you know how to attach a map in the forum, let me know and I will send the dummy ones that I created.\nMargaret
  • SystemAdmin
    SystemAdmin
    38 Posts

    RE: XML BP to choose map based on document type

    ‏2010-07-09T19:09:38Z  
    Not sure how to attach a map, so here goes to try and explain.\n\nYou will need two maps - one for each type of input. The input side is the input of the data. The output side is XML - structure\n\nOUTPUT\n Mandatory\n MapName\n\nOn the input side, create a new element at the end of the message, say called tmpMapName. Link this to MapName on the output.\n\nStill on the input, on the extended rule OnBegin of the root tag, put the following:\n\n$tmpMapName.#tmpMapName = \"Map_OrderCreate2_PIDX\";\n\nSame for the second map that has the root for OrderChange, with the value being the name of the order change map.\n\nThen, in your bp before the translation step, just put in a call to the typing service, e.g.\n\n<operation name=\"DetermineWhatTheDocumentIs\">\n\t<participant name=\"TypingService\"/>\n\t<output message=\"TypingServiceTypeInputMessage\">\n\t\t<assign to=\"typing_maplist\">Typing_OrderCreate Typing_OrderChange</assign>\n\t\t<assign to=\"required_parmlist\">MapName</assign>\n\t\t<assign to=\"validate_input_against_dtd\">NO</assign>\n\t\t<assign to=\".\" from=\"*\"/>\n\t</output>\n\t<input message=\"inmsg\">\n\t\t<assign to=\".\" from=\"*\"/>\n\t</input>\n</operation>\n\nThe values in the \"typing_maplist\" are the names of your two typing service maps created above.\nYou should now see the output in the process data of your map name, which you can then pass to the translation service.\nIf you know how to attach a map in the forum, let me know and I will send the dummy ones that I created.\nMargaret
    Thanks for the info. I also don&apos;t see where you can attach a map to this forum. You can send it to jtebarts@dixonvalve.com if that&apos;s alright with you.\n\nThanks,\nJune