Job.changeFirstState (jobID, None, “Creating”, string workflow)

This call starts the job on its specified workflow. In addition, this call copies the source files into the spool directory and gives them spool file names. It helps move a job created with the Job.create(string workflow {srcfile : spoolfile, ...}) call through the right workflow.


Parameter Description
Job ID The ID number of the job
None The original state of the job
Creating First state of the job in the workflow
workflow Name of the workflow the job goes through


Although this call does not display a return, it does move the job through workflow steps and processes the files in the spool directory.


The example below shows the Job.create(string workflow {srcfile : spoolfile, ...}) and Job.changeFirstState (jobID, None, “Creating”, string workflow) calls used together.

from ConnectDefs import * 
import xmlrpclib

myProxy = None

   myProxy = connectLogin("AcmeServer", "aiw", "password")
   jobType = "AFP"
   myJobId = myProxy.Job.create(jobType, {"/aiw/aiw1/testfiles/
                                  Demo.afp" : "print.afp"})
   myProxy.Job.changeFirstState(myJobId, None, "Creating", jobType)
   myJobData = myProxy.Job.get(myJobId)
   print myJobData

except xmlrpcFault, err:
    print err.faultString + " (" + str(err.faultCode) + ")"
    connectLogout(myProxy, "aiw")

{'Job.State': 'Queued', 'Job.JobType': 'AFP', 'Job.PLE.Staple': [], 
'Job.Line2AFP.EXTENSIONS': [], 'Job.Line2AFP.RESTYPE': [], 'Type': 
'Job', 'Job.Phase': 'Receive', 'Job.Insert.Iteration': 1, 'Job.Modi
fiedBy': 'aiw', 'Job.Process': 'AFP', 'Job.Normalized.ID': '10000026', 
'Job.SubmitTime': <DateTime '20131231T00:05:28' at 2c35260>, 'Job.
StapleRequired': 'No', 'Job.ID': '10000026', 'Job.JobType.History': 
[], 'Job.SpoolFileStem': '/aiw/aiw1/spool/default/10000026/', 'Job.
PLE.Media': [], 'Job.Instance': 'System', 'Job.MediaRequired': [], 
'Job.RowType.Job': 'Job', 'Job.Line2AFP.ValidRCs': '0', 'Job.Reprint
Group': [], 'Job.JobSize': 0, 'Job.Step': 'SetJobPropsFromTextFile', 
'Job.PhaseProgress': 'Staging', 'Job.RestartSteps': []}