1

我在该位置有一个 STAXnew15.xml工作/home/dharm/staf/services/stax/samplesnew15.xml有两个功能 mainreadFile

 file_name = '/home/dharm/datafiles/ReadData3.txt'

readFileis 的必需参数file_name

我想使用命令行执行这个命令,但我也想提供所需的参数来readFile运行。

staf local execute file /home/dharm/staf/services/stax/samples/new15.xml wait return result

我应该在命令中进行哪些修改才能使其正常工作。

“我有什么尝试”

第一的

dharm@ubuntu:~$ staf local stax execute file /home/dharm/staf/services/stax/samples/new15.xml ARGS file_name="'/home/dharm/datafiles/ReadData3.txt'" wait returnresult
Response
--------
{
  Job ID         : 3
  Start Date-Time: 20130418-23:54:39
  End Date-Time  : 20130418-23:54:40
  Status         : Terminated
  Result         : None
  Job Log Errors : [
    {
      Date-Time: 20130418-23:54:40
      Level    : Error
      Message  : STAXPythonEvaluationError signal raised. Terminating job. 

===== XML Information =====

File: /home/dharm/staf/services/stax/samples/new15.xml, Machine: local://local
Line <Error in ARGS option>: Error in element type "<External>".

===== Python Error Information =====

com.ibm.staf.service.stax.STAXPythonEvaluationException: 

Python object evaluation failed for:
file_name='/home/dharm/datafiles/ReadData3.txt'

SyntaxError: ("mismatched input '=' expecting EOF", ('<pyEval string>', 1, 9, "file_name='/home/dharm/datafiles/ReadData3.txt'\n"))

===== Call Stack for STAX Thread 1 =====

[]
    }
  ]
  Testcase Totals: {
    Tests : 0
    Passes: 0
    Fails : 0
  }
}

“第二条命令”

dharm@ubuntu:~$ staf local stax execute file /home/dharm/staf/services/stax/samples/new15.xml SCRIPT file_name="'/home/dharm/datafiles/ReadData3.txt'" wait returnresult
Response
--------
{
  Job ID         : 4
  Start Date-Time: 20130418-23:56:01
  End Date-Time  : 20130418-23:56:02
  Status         : Terminated
  Result         : None
  Job Log Errors : [
    {
      Date-Time: 20130418-23:56:02
      Level    : Error
      Message  : STAXFunctionArgValidate signal raised. Terminating job. 

===== XML Information =====

File: /home/dharm/staf/services/stax/samples/new15.xml, Machine: local://local
Line 20: Error in element type "call".

Required argument "file_name" is not provided in the call to function "readFile".

===== Call Stack for STAX Thread 1 =====

[
  function: main (Line: 19, File: /home/dharm/staf/services/stax/samples/new15.xml, Machine: local://local)
]
    }
  ]
  Testcase Totals: {
    Tests : 0
    Passes: 0
    Fails : 0
  }
}
4

0 回答 0