Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 28 Next »

Including process based services Emakin also provides infrastructure services to integrate with other applications.

Infrastructure services can be accessed from "http(s)://<mydomain>.emakin.com/rest.asmx" url. Depending on call style service methods can be called in soap or rest format. If you prefer the use SOAP related WSDL document can be accessed from http://<mydomain>.emakin.com/rest.asmx?WSDL

Authentication

Infrastructure service calls requires an API Key to execute and get be acquired from system administrator.

Some of methods requires "logonId" and "logonProvider" parameters to act as user's behalf. Logon provider specifies the registered open auth logon provider. If default emakin login system is used can be specified as "Organization". Depending on selected provider logon id can be changes, for example if you use active directory logon id can be specified as windows logon user.

Services

GetToken

Generates an authentication token to authorize users later. Generated token can be use to "auth" parameter to authorise users without login requirement.

Parameters

Parameter NameDescription
apiKeyCaller system identifier.
logonIdUser logon id
logonProviderUser logon provider.

Example Call

RequestResponse
POST http://ertan.emakin.com/rest.asmx/getToken HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ertan.emakin.com
Content-Length: 80
 
{
     "apiKey": "xxxx",
     "logonId": "user@emakin.com",
     "logonProvider": "Organization"
}
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Content-Length: 144
 
{"d":"41AA3CE3CAFB..............BF8114"}

GetWorklist

Returns the list of work items on user's worklist. Tag parameter specifies the identifier of which list should be return.

Parameters

Parameter NameDescription
apiKeyCaller system identifier.
logonIdUser logon id
logonProviderUser logon provider.
tagWorklist identifier. If set to null default inbox is returned.
startStart number of list. Use 0 to start from beginning.
maxLengthLimit of number of rows in list. Use -1 to get all rows.
queryXmlOptional query xml value. See Query for more details.

Example Call

RequestResponse
POST http://ertan.emakin.com/rest.asmx/getWorklist HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ertan.emakin.com
Content-Length: 91
 
{
     "apiKey": "xxxx",
     "logonId": "user@emakin.com",
     "logonProvider": "Organization",
     "tag": null,
     "start": 0,
     "maxLength": 30,
     "queryXml" : ""
}
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Content-Length: 1245
 
{
   "d":[
      {
         "Id":"e5134318-88bd-4a33-b561-4d78380734ce",
         "Caption":"A new task",
         "Start":"/Date(1445812020394)/",
         "End":null,
         "Instructions":"Please complete.",
         "State":"Waiting",
         "Number":12471
      },
      {
         "Id":"796a34c6-fd2e-450e-a2af-8124ea68f8ca",
         "Caption":"A new other task",
         "Start":"/Date(1445512843034)/",
         "End":null,
         "Instructions":"Please complete.",
         "State":"Waiting",
         "Number":12468
      }
   ]
}

GetWorklistCount

Returns number of records in worklist. You can use this method to specify paging parameters in GetWorkList method.

Parameters

Parameter NameDescription
apiKeyCaller system identifier.
logonIdUser logon id
logonProviderUser logon provider.
tagWorklist identifier. If set to null default inbox is returned.
queryXmlOptional query xml value. See Query for more details.

Example Call

RequestResponse
POST http://ertan.emakin.com/rest.asmx/getWorklistCount HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ertan.emakin.com
Content-Length: 91
 
{
     "apiKey": "xxxx",
     "logonId": "user@emakin.com",
     "logonProvider": "Organization",
     "tag": null,
     "queryXml" : ""
}
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Content-Length: 8
 
{
   "d":50
}

GetWorkItem

Gets workitem information to display or complete with action.

Parameters

Parameter NameDescription
apiKeyCaller system identifier.
logonIdUser logon id
logonProviderUser logon provider.
idWork item identifier.
readOnlySet true to fetch work item read only. Default is false.

Example Call

RequestResponse
POST http://ertan.emakin.com/rest.asmx/getWorkItem HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ertan.emakin2.com
Content-Length: 124

{
     "apiKey": "xxxx",
     "logonId": "user@emakin.com",
     "logonProvider": "Organization",
     "id": "e5134318-88bd-4a33-b561-4d78380734ce"
}
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Content-Length: 516

{
     "d": {
         "Id": "e5134318-88bd-4a33-b561-4d78380734ce",
         "Caption": "A new task",
         "Culture": "en-US",
         "Start": "/Date(1445812020394)/",
         "End": null,
         "DeadlineDate": null,
         "InstanceNumber": 12471,
         "IsReadOnly": false,
         "SelectedActionId": null,
         "Actions": [
             {
                 "Id": "2b0aa720-82f8-4a62-b7a1-2389203fa5e7",
                 "Name": "Complete",
                 "Color": "",
                 "BackgroundColor": "",
                 "Order": 1,
                 "Hidden" : false,
                 "RequireComment": false,
                 "ConfirmationMessage": "",
                 "ValidationGroup": ""
             },
             {
                 "Id": "c5350e5c-6e03-4b72-9522-49ab7f849b8a",
                 "Name": "Cancel",
                 "Color": "",
                 "BackgroundColor": "",
                 "Order": 2,
                 "Hidden" : false,
                 "RequireComment": true,
                 "ConfirmationMessage": "",
                 "ValidationGroup": ""
             }
         ]
     }
 }

GetWorkItemData

Gets the xml data of workitem.

Parameters

Parameter NameDescription
apiKeyCaller system identifier.
logonIdUser logon id
logonProviderUser logon provider.
idWork item identifier.

Example Call

RequestResponse
POST http://ertan.emakin.com/rest.asmx/getWorkItemData HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ertan.emakin2.com
Content-Length: 124

{
     "apiKey": "xxxx",
     "logonId": "user@emakin.com",
     "logonProvider": "Organization",
     "id": "e5134318-88bd-4a33-b561-4d78380734ce"
}
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Content-Length: 516

{
     "d": {
         "Data": "<xml><poolRoot>.....</poolRoot></xml>",
         "DataRoot": "poolRoot"
     }
 }

SelectAction

Selects an action on a work item and returns array of next work item identifiers.

Parameters

Parameter NameDescription
apiKeyCaller system identifier.
logonIdUser logon id
logonProviderUser logon provider.
idWork item identifier.
actionAction identifier.
data

XML data. Can be null. (There is no merge operation. Whole form data should be sent otherwise

the form data is replaced with the new data. The data can be retrieved by GetWorkItemData method.

The final data should be send inside of a form element. e.g. <form><Data>...</Data></form>)

commentsUser comments

Example Call

RequestResponse
POST http://ertan.emakin.com/rest.asmx/selectAction HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ertan.emakin2.com
Content-Length: 124

{
     "apiKey": "xxxx",
     "logonId": "user@emakin.com",
     "logonProvider": "Organization",
     "id": "e5134318-88bd-4a33-b561-4d78380734ce",
     "action": "c5350e5c-6e03-4b72-9522-49ab7f849b8a",
     "data": null
}
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Content-Length: 516
{
     "d": [ "716F8FCB-98C2-4591-8C43-043D54DEAADA" ]
}

 

InitiateByProcess

Initiates a new process instance with specified parameters and returns the Id number of work item.

When testing this method with Soap UI, you must include the xml for the data parameter inside <![CDATA[]]>, for example: <![CDATA[<pool><myField>ABC</myField></pool>]]>

Parameters

Parameter NameDescription
apiKeyCaller system identifier.
logonIdUser logon id
logonProviderUser logon provider.
processName or Id number of process
taskName or Id number of task
versionVersion number or id of process. Can be null.
dataXML data. Can be null.
cultureCulture preference. Can be null.

Example Call

RequestResponse
POST http://ertan.emakin.com/rest.asmx/initiateByProcess HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ertan.emakin2.com
Content-Length: 124

{
     "apiKey": "xxxx",
     "logonId": "user@emakin.com",
     "logonProvider": "Organization",
     "process": "e5134318-88bd-4a33-b561-4d78380734ce",
     "task": "c5350e5c-6e03-4b72-9522-49ab7f849b8a",
     "version": null,
     "data": "<pool><myField>ABC</myField></pool>",
     "culture": null
}
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Content-Length: 516
{
     "d": "716F8FCB-98C2-4591-8C43-043D54DEAADA"
}

 

Trigger

Triggers an event for listeners on all processes and returns array of id number of triggered work items. When there is no listener return value is a empty array.

Parameters

Parameter NameDescription
apiKeyCaller system identifier.
logonIdUser logon id
logonProviderUser logon provider.
eventNameName of event
testModeTrigger the test mode or not work items
inputDataEvent Data in XML can be null.
cultureCulture preference. Can be null.

Example Call

RequestResponse
POST http://ertan.emakin.com/rest.asmx/trigger HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ertan.emakin2.com
Content-Length: 124

{
     "apiKey": "xxxx",
     "logonId": "user@emakin.com",
     "logonProvider": "Organization",
     "eventName" : "myEvent",
     "inputData": "<pool><eventParameter>ABC</eventParameter></pool>",
     "testMode": false,
     "culture": null
}
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Content-Length: 516
{
     "d": ["716F8FCB-98C2-4591-8C43-043D54DEAADA"]
}


Query

Query is xml based string that specifies the requested result. If not specified default query is performed.

Query definition uses following column names to be specified as result set column name, criteria and order.

Worklist Columns

NameDescription
IdUnique work item identifier
NameName of work item
CaptionLocalized caption of work item.
StateState of work item.
StartStart date of work item
EndEnd date of work item. Can be null.
IsDeadlinedA boolean that specifies the deadline is occurred.
DeadlineDateDeadline date. Can be null.
NextReminderDateNext reminder date. Can be null.
SentRemindersNumber of sent reminders
InstructionsInstructions of work item
InstanceIdUnique instance identifier
PreviousWorkItemIdPrevious id number of work item. Can be null.
ActionIdUnique action identifier. Can be null.
CompletedByIdId number of completed by user. Can be null.
CompletedByDisplay name of completed by user. Can be null.
NumberInstance number
PriorityInstance priority
ProcessIdId number of process
ProcessNameName of process
FromIdId number of initiator user. Can be null.
FromDisplay name of initiator user. Can be null.
FolderIdId number of related folder id.
FolderNameName of related folder.
AssignedToList of assigned users
VersionNumberVersion number of related process
VersionIdId number of related process version
TestModeA boolean that specifies instance is in test mode or not.
Instance.StartStart date of instance
Instance.StateState of instance

Query contains the following sections;

Columns

List of column names that requested. 

Where

List of criteria to be performed. Criteria name can be specified from column names.

Order

List of order to be performed. Order name can be specified from column names.

Example Query Xml

<Query Start="" MaxLength="25">
    <Columns>
        <Column Expression="Id"/>
        <Column Expression="Instructions"/>
        <Column Expression="State"/>
        <Column Expression="FromId"/>
        <Column Expression="From"/>
        <Column Expression="SentReminders"/>
        <Column Expression="HasHistory"/>
        <Column Expression="Caption"/>
        <Column Expression="Start"/>
        <Column Expression="DeadlineDate"/>
        <Column Expression="End"/>
        <Column Expression="FolderName"/>
        <Column Expression="Number"/>
    </Columns>
    <Where>
        <Criteria>
            <Criteria Expression="Caption" Comparison="Like">
                <Value>My Task*</Value>
            </Criteria>
        </Criteria>
    </Where>
    <Order>
        <Order Expression="Start" Type="Descending" />
    </Order>
</Query>


Decision

Returns the decision result.

Parameters

Parameter NameDescription
apiKeyCaller system identifier.
logonIdUser logon id
logonProviderUser logon provider.
processName or Id number of process
modelName or Id number of decision model
decisionName or Id number of decision
inputDataDecision input data. Xml or Json string.

Example Call

RequestResponse
POST https://ertan.emakin.com/rest.asmx/decision HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ertan.emakin.com

{
     "apiKey": "",
     "logonId": "user@emakin.com",
     "logonProvider": "Organization",
     "process" : "Decision",
     "model" : "dinner",
     "decision" : "Dish",
     "inputData": "<pool><Season>Fall</Season><NumberOfGuests>2</NumberOfGuests></pool>"
}
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Content-Length: 26

{"d":{"Dish":"Spareribs"}}



  • No labels