LSPS documentation logo
LSPS Documentation
Tasks

Core

CreateModelInstance

Creates a new model instance and waits until it receives a confirmation message with the model instance ID. Note that the message is sent asynchronously when the interpretation of the new model instance starts. Hence the task becomes finished even though the first transaction of the new model instance failed and was rolled back.

<pre>//example task parameters: model -> getModel("registration"), properties -> [ "customer" -> "John Doe"], modelInstance -> &modelInstanceVar</pre>

model : Model

Model to be instantiated.

properties : Map<String, String>

Map of model instance initialization properties. If null, an empty properties map is created in the instantiated model.

modelInstance : Reference<ModelInstance>

Reference to the created model instance. If the created model instance throws a runtime exception during its initialization, it is set to null.

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • ModelInstaniationError if the model instance did not start due to an internal initiation error, not due to a model interpretation error
TerminateModelInstance

Terminates a running model instance which becomes finished. <pre>//example task parameters: modelInstance -> getModelInstance(25009)</pre>

modelInstance : ModelInstance

Model instance to be terminated.

Throws:

  • NullParameterError if a mandatory parameter is not specified
DeleteModelInstanceLogs

Permanently removes process logs of the specified model instances from the database. All model instances must be finished. Note that process logs hold data on each changes of model, process, and element instances. Other data, such as the logs created by the instance, its properties, entry on the fiinished model instance, the model-instance update log, etc. remain unchanged. <pre>//example task parameters: modelInstances -> {getModelInstance(8000)}</pre>

modelInstances : Set<ModelInstance>

A set of finished model instances whose logs are deleted.

Throws:

  • NullParameterError if mandatory parameter is null
  • ModelInstanceNotFinishedError if at least one of the specified model instances is not finished
Activate

(Re)activates an inactive or finished goal. An active goal remains unchanged. <pre>//example task parameter: goal -> booking::BookedOnlineGoal</pre>

goal : Goal

Goal to be (re)activated.

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • FinishedProcessInstanceError if the process instance of the activated goal is finished
Deactivate

Deactivates an unfinished goal. If the goal is finished or the goal’s process is finished, the task type does nothing. <pre>//example task parameter: goal -> booking::BookedOnlineGoal</pre>

goal : Goal

Goal to be deactivated.

Throws:

  • NullParameterError if a mandatory parameter is not specified
RepeatGoals

Repeats a set of goals: It deactivates and reactivates the specified achieve goals. If the list includes a pair of achieve goals with one being the subgoal of the other or the process instance of any of the goals is finished, a runtime exception is thrown. <pre>//example task parameter: goals -> [booking::BookedOnlineGoal]</pre>

goals : List<RepeatedGoal>

Achieve goals to deactivate and reactivate.

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • FinishedProcessInstanceError if the process instance of the activated goal is finished
  • ParentGoalError if the goals list contains a pair of goals from which one goal is a subgoal of the other
DeleteSharedRecords

Deletes the specified shared records and all related (by data relationships) shared records from the database. Note that it is not possible to delete system shared records. <pre>//example task parameter: data -> {getApplicantByName("John")}</pre>

data : Set<Object>

Set of shared records to delete.

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • IncompatibleTypeError if the data parameter contains an object which is not a shared record
  • RecordNotFoundError if the data parameter contains a shared record with an incorrect reference to a database record
RemoveBinaryDataDEPRECATED

Permanently removes the specified binary data from the database. The fields of the handle are cleaned up as well (set to the default values). The execution of the task required the Binary:Delete security right.

handle : BinaryHandle

Binary handle pointing to the binary data to be removed. The fields of the handle are cleaned up as well (set to the default values).

Throws:

  • NullParameterError if a mandatory parameter is not specified
Lock

Creates a model instance-independent lock. The result is stored in the <i>result</i> slot. The lock can be removed byt the Unlock task.

lockName : String

Name (identifier) of the lock.

message : String

Description of the lock.

result : Reference<Boolean>

If true, a new lock was successfully created. If false, a lock with the same name already exists.

existingMessage : Reference<String>

If the result is true, the value of the referred string is not changed. If the result is false, the value of the referred string is replaced with the message of the already existing lock with the same name.

Throws:

  • NullParameterError if a mandatory parameter is not specified
Unlock

Removes a lock created by a Lock task, possibly from another model instance.

lockName : String

Name of the lock to be removed.

Throws:

  • NullParameterError if a mandatory parameter is not specified
ParseXmlDEPRECATED

Parses XML document to data structures. <pre>xml -> "<?xml version=""1.0"" encoding=""UTF-8""?> <ns0:RegistrationData xmlns:ns0=""urn:lsps:common"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""> <ns0:id>3</ns0:id> <ns0:firstName>John</ns0:firstName> <ns0:lastName>Doe</ns0:lastName> </ns0:RegistrationData>", output -> &parsedXML, useDefaultMapping -> true, typesNamespace -> null</pre>

xml : String

XML document to parse.

output : Reference<Object>

Reference to where the result is stored. The type of reference provided determines which object is parsed from the XML. The referred object must be of a record type; otherwise an exception is thrown.

useDefaultMapping : Boolean

If true, the default LSPS XML mapping is used. Otherwise, the metadata defined on the record types are taken into account. If parsing types generated from XSD, this parameter must be set to false. The default value is false.

typesNamespace : String

If the default mapping is used, this parameter determines the XML namespace used for elements. If the default mapping is not used, this parameter is ignored. The default value is null.

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • IncompatibleTypeError if the type of the output is not record
  • UnableToParseXmlError if the specified xml cannot be parsed to output
ConvertToXmlDEPRECATED

Converts data structures to XML document. <pre>//example task parameters: object -> new RegistrationData(firstName -> "Ellen", lastName -> "Doe", approved -> true), output -> &varWithXml, useDefaultMapping -> false, typesNamespace -> null</pre>

object : Object

The instance of a record type to be converted to XML.

output : Reference<String>

Reference to where to store the output XML.

useDefaultMapping : Boolean

If true, the default LSPS XML mapping is used. Otherwise, the meta- data defined on record types are taken into account. If you are converting to XML an object of a type that was generated from XSD, the parameter must be set to false. The default value is false.

typesNamespace : String

If the default mapping is used, this parameter determines XML namespace used for elements. If the default mapping is not used, this parameter is ignored. The default value is null.

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • IncompatibleTypeError if the type of the object is not record
  • UnableToConvertToXmlError if an error occured during conversion
HttpCall

Performs an HTTP call and stores the response. <pre>httpMethod -> "GET", url -> "http://localhost.com:9500/myIndex/section/_search", request -> "{""query"":{""term"":{""title"":""search for me""}}}", requestContentType -> "application/json", isSynchronous -> true</pre>

httpMethod : String

Type of the method to be performed. Possible values are “GET”, “POST”, “PUT”, and “DELETE”.

url : String

Endpoint address of the target HTTP service.

request : Object

Request payload. Can be either String or core::BinaryHandle. All other objects are converted to String. String is converted to data stream in the charset specified in the requestContentType parameter. If the charset is not specified, UTF-8 is used. If core::BinaryHandle object is used, request payload will contain data from this handle.

requestContentType : String

Content type (MIME) of the request payload.

response : Reference<String>

Reference to where the response payload is stored.

responseCode : Reference<Integer>

Reference to where the response code is stored.

login : String

Login for the HTTP BASIC authentication.

password : String

Password for the HTTP BASIC authentication.

readTimeout : Integer

Socket timeout for the call.

requestHeaders : Map<String, String>

Map of the request HTTP headers to be sent together with the request.

responseHeaders : Reference<Map<String, String>>

Reference to the map of the HTTP response headers.

isSynchronous : Boolean

If true, the task is executed synchronously in the context of process instance. If false or null, the task is executed asynchronously, outside of the process context.

Throws:

  • NullParameterError if mandatory parameter is null
  • HttpCallError if an error occured during the HTTP call
Log

Logs a specified message to the application log at the specified log level. <pre>//example task parameters: message -> "The item was successfully created.", level -> 100</pre>

message : String

Message to be logged.

level : Integer

Log level. Unspecified level value logs at the “Info” level.

Throws:

  • NullParameterError if a mandatory parameter is not specified
AssignDEPRECATED

Writes the objects to the target slots: map keys define the target slots as references and values define the objects. References in the slots keys must not be null.

slots : Map<Reference<Object>, Object>

Map with references to target slots as keys and values to assign to the slots as map values.

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • IncompatibleTypeError if the type of the value is not compatible with the type of the target slot
Execute

Executes the specified activity. <pre>//example task parameter: activity -> new registration::Approval() //Approval is the Activity of a process with the <i>Create activity reflection type</i> flag</pre>

activity : Activity

Activity to execute.

Throws:

  • NullParameterError if a mandatory parameter is not specified
NoOperation
Task with no execution logic. It is intended for prototyping and logical structuring of BPMN processes.