{"action":"created","issue":{"url":"https://api.github.com/repos/common-workflow-language/common-workflow-language/issues/144","labels_url":"https://api.github.com/repos/common-workflow-language/common-workflow-language/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/common-workflow-language/common-workflow-language/issues/144/comments","events_url":"https://api.github.com/repos/common-workflow-language/common-workflow-language/issues/144/events","html_url":"https://github.com/common-workflow-language/common-workflow-language/issues/144","id":111543437,"number":144,"title":"What is the order of applying engines/JsonPointer ?","user":{"login":"portah","id":2335092,"avatar_url":"https://avatars.githubusercontent.com/u/2335092?v=3","gravatar_id":"","url":"https://api.github.com/users/portah","html_url":"https://github.com/portah","followers_url":"https://api.github.com/users/portah/followers","following_url":"https://api.github.com/users/portah/following{/other_user}","gists_url":"https://api.github.com/users/portah/gists{/gist_id}","starred_url":"https://api.github.com/users/portah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portah/subscriptions","organizations_url":"https://api.github.com/users/portah/orgs","repos_url":"https://api.github.com/users/portah/repos","events_url":"https://api.github.com/users/portah/events{/privacy}","received_events_url":"https://api.github.com/users/portah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-15T04:34:16Z","updated_at":"2015-10-26T17:38:40Z","closed_at":null,"body":"I have next code:\r\n```\r\nclass: CommandLineTool\r\n      requirements:\r\n        - import: node-engine.cwl\r\n      inputs:\r\n        - id: \"#genome1\"\r\n          type: string\r\n\r\n        - id: \"#genome2\"\r\n          type: string\r\n\r\n        - id: \"#downloadtemplate\"\r\n          type: string\r\n          default: \"http://hgdownload.cse.ucsc.edu/goldenPath/{genome1}/liftOver/{genome1}To{genome2}.over.chain.gz\"\r\n          inputBinding:\r\n            position: 2\r\n            #prefix: \"-o\"\r\n            valueFrom:\r\n              engine: node-engine.cwl\r\n              script: |\r\n                {\r\n                  var temp=$self.replace(/{genome1}/g,$job['genome1']).replace(\"{genome2}\",$job['genome2']);\r\n                  return temp;\r\n                }\r\n\r\n        - id: \"outfilename\"\r\n          type: string\r\n          default: \"{genome1}To{genome2}.over.chain.gz\"\r\n          inputBinding:\r\n            position: 1\r\n            prefix: \"-o\"\r\n            valueFrom:\r\n              engine: node-engine.cwl\r\n              script: |\r\n                {\r\n                  var temp=$self.replace(\"{genome1}\",$job['genome1']).replace(\"{genome2}\",$job['genome2']);\r\n                  return temp;\r\n                }\r\n\r\n      outputs:\r\n        - id: \"#overchain\"\r\n          type: File\r\n          outputBinding:\r\n            glob:\r\n              engine: cwl:JsonPointer\r\n              script: /job/outfilename\r\n```\r\n\r\n\"#overchain\" is equal to \"{genome1}To{genome2}.over.chain.gz\" not a replaced one.\r\n"},"comment":{"url":"https://api.github.com/repos/common-workflow-language/common-workflow-language/issues/comments/151220373","html_url":"https://github.com/common-workflow-language/common-workflow-language/issues/144#issuecomment-151220373","issue_url":"https://api.github.com/repos/common-workflow-language/common-workflow-language/issues/144","id":151220373,"user":{"login":"tetron","id":1316612,"avatar_url":"https://avatars.githubusercontent.com/u/1316612?v=3","gravatar_id":"","url":"https://api.github.com/users/tetron","html_url":"https://github.com/tetron","followers_url":"https://api.github.com/users/tetron/followers","following_url":"https://api.github.com/users/tetron/following{/other_user}","gists_url":"https://api.github.com/users/tetron/gists{/gist_id}","starred_url":"https://api.github.com/users/tetron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tetron/subscriptions","organizations_url":"https://api.github.com/users/tetron/orgs","repos_url":"https://api.github.com/users/tetron/repos","events_url":"https://api.github.com/users/tetron/events{/privacy}","received_events_url":"https://api.github.com/users/tetron/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T17:38:39Z","updated_at":"2015-10-26T17:38:39Z","body":"From the spec: \"The order in which expressions are evaluated within a process or workflow is undefined.\"\r\n\r\nTo clarify, expressions only get the input object; valueFrom only applies to command line building.\r\n\r\nYou can use `engineConfig` to include code that is evaluated before the expression so if you have a common function you only have to write it once.\r\n\r\nHowever, this specific example would probably be better served by #137."}}