CreateJob - Obsolete

Description

This method is used to create a job based on the details provided and generate a job document by combining all the documents. It generates a job document based on the two documents provided for chapter two and three and the stored default document for chapter one. It returns the Url and Id of the generated document and the list of devices created.

A sample job document contains five main sections.

  1. Cover page – This is the first page of the generated document and will contain the property and company information. If companies have uploaded the company logo and description to the Boligmappa Bedrift system then it is also included in the cover page. If they are not provided them, relevant spaces will keep empty so that users can include the logo and description manually.
  2. Table of Contents – The description for Chapter one too can be customized in the Boligmappa Bedrift admin's company profile page. If this value is not set in the profile page, a default description ("Generell brukerveiledning for elektriske installasjoner") will be used.
  3. Chapter 1 –  Companies are provided the possibility to upload company default chapter one document to Boligmappa Bedrift. For the companies who have uploaded a default chapter one document, it will be used as the chapter one of job documents generated by that particular company. The companies also have the option of using the ‘Default Boligmappa chapter one document’ by selecting it in the Boligmappa Bedrift admin page. If this is not provided a page with a help text will be added under ChapterOne.  View the Chapter one help text.  
  4. Chapter 2 – This section of the document contains all the work documents supplied by the user. If this is not provided a page with help text is added under ChapterTwo.  View the Chapter two help text.
  5. Chapter 3 – This section contains all the product documents and device manuals supplied by the user.


Note 

Jobs cannot be created for plants associated to buildings. 

Request

ParameterTypeMandatory/OptionalMaximum character length/limitDescription
plantIdlongMandatoryNot relevant

plantId to which the job should be associated

jobJobMandatoryNot relevantDetails of the job 
chapterOneDocumentId int Optional  Not relevantId of the company document
workDocumentsList<FileOptional  Not relevantList of documents listing the details of the job
productDocuments List<File>  Optional Not relevantList of manuals of devices that are already installed
devices List<DeviceInputOptional Not relevantList of newly installed devices
documentName string Mandatory Not relevantName of the document. (A job document is getting created when creating a job. This name is used as the file name with .pdf extension)
applicationName stringMandatory Should be less than or equal to 10 characters

The name of the integration partner


Note 

In order to create a job, at least one document should be attached.


Request - sample input

<CreateJob>
  <MethodParameters>
    <UserAuthentication>
      <UserName>username</UserName>
      <Password>password</Password>
      <AnyAttr attr0="XmlAttributeArray" isNull="false">
        <XmlAttributeArray0>System.Xml.XmlAttribute</XmlAttributeArray0>
      </AnyAttr>
    </UserAuthentication>
    <plantId>6731</plantId>
    <job>
      <Title>New job title</Title>
      <Description>Job description</Description>
      <WorkTypeId>2</WorkTypeId>
      <ProfessionId>2</ProfessionId>
    </job>
    <chapterOneDocumentId>0</chapterOneDocumentId>
    <workDocuments attr0="FileArray" isNull="false">
      <FileArray0>
        <Url>http://imgsv.imaging.nikon.com/lineup/dslr/d600/img/sample01/img_05_l.jpg</Url>
        <Data isNull="false" />
      </FileArray0>
    </workDocuments>
    <productDocuments attr0="FileArray" isNull="false">
      <FileArray0>
        <Url>http://foersom.com/net/HowTo/data/OoPdfFormExample.pdf</Url>
        <Data isNull="false" />
      </FileArray0>
    </productDocuments>
    <devices isNull="true" />
    <documentName>testjob document</documentName>
    <applicationName>test</applicationName>
  </MethodParameters>
</CreateJob>

Response

TypeDescription
JobCreateStatusStatus of the job created


Respnse - sample output

<CreateJob>
  <MethodParameters>
    <JobCreateStatus>
      <JobId>150</JobId>
      <Title>New job title</Title>
      <JobDocumentId>57797</JobDocumentId>
      <JobDocumentUrl>http://172.20.1.183:8080/Document/DownloadDocumentWebService/DownloadDocWithSessionKey?sessionKey=rl%2fL3WDK6Fs%2bCIaABAaVX8sX9yyK%2bcspOfDT60r7lscBpTyzZRxTepBAxQR4epJL</JobDocumentUrl>
      <DeviceCreateStatuses attr0="DeviceCreateStatusArray" isNull="false" />
    </JobCreateStatus>
  </MethodParameters>
</CreateJob>


Exceptions

Error CodeDescription
115

Given professionId(s) are not valid 

123  

An exception occured while processing your request 

133  

Url or Data must be provided to create a document file 

138

applicationName length has exceeded the maximum character limit allowed (10) 

146 

The applicationName is not set

148 

The documentName cannot be empty

152 

No property is connected to the given plantId

167 

You are not authorized to use this method 

183

Invalid WorkTypeId 

184 

Job is not set 

185 

To create a job there should be atleast one document in the WorkDocuments, ProductDocuments or deviceManuals inputs

186

ProductName is not provided

193 

Maintenance task must contain a description  

196 

Url or Data must be provided to create a device manual 

202 

This operation can only be done on plants connected to properties  

204 

Entered month is not valid. The range is from 1-12  

206 

Invalid building element  

207

RoomId does not exist or belong to the given plant 

210The DeviceId type provided is not valid
216 

Maintenance description length has exceeded the maximum character limit allowed (70)  

219 

Job title cannot be empty