Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel3
outlinetrue
stylenone

make <Field f>,<Closure behaviour> on <Transition t> when <Closure<Boolean> condition>

Changes behaviour of given data field f on transition t, iff condition returns true. Behaviour can be one of:

...

change <Field f> value <Closure calculation> 
Anchor
change_value
change_value

Sets new value to data field f returned by calculation closure. If the returned value is null, fields value is set to default value. If the returned value is unchanged, fields value is unchanged and actions with a trigger set on given field are not triggered.

...

Sets a new set of choices to data field f.

Example
Code Block
languagexml
other: f.410001,
field: f.this;
change field choices {
    if (other.value == "Nehnutelnost")
        return field.choices + ["rozostavaná stavba"];
    return field.choices;
}

...

Calls method and saves generated value into data field f. The field can be only of type Text or File. If repeat is equal to always new value is generated on each run of action. If repeat is equal to once new value is generated only if fields value is null.

...

Changes the property of the current case, the new value is generated by the supplier.

...

Case createCase(String identifier, String title = null, String color = "", User author = userService.loggedOrSystem)

Creates a new instance of the newest version of net identified by the identifier. If the title is not specified, nets default case name is used. If the colour is null, the default colour is used (black at the moment). 

...

Case createCase(PetriNet net, String title = net.defaultCaseName.defaultValue, String color = "", User author = userService.loggedOrSystem)

Creates a new instance of the given net. If the title is not specified, nets default case name is used. If the colour is null, the default colour is used (black at the moment). 

...

List<Case> findCases(Closure<Predicate> predicate)

Finds all the cases that match the given predicate. The predicate is a groovy closure that accepts QCase object and returns QueryDSL Predicate.

...

List<Case> findCases(Closure<Predicate> predicate, Pageable page) 

Finds all the cases that match the given predicate. The predicate is a groovy closure that accepts QCase object and returns QueryDSL Predicate. Pageable determines the requested page number, page size, sort fields, and sort direction.

...

Case findCase(Closure<Predicate> predicate)

Finds the first case that matches the given predicate. The predicate is a groovy closure that accepts QCase object and returns QueryDSL Predicate.

Example
Code Block
languagexml
Case useCase = findCase( { it.title.eq("Case 1") & it.processIdentifier.eq("insurance") } );
...
Case useCase = findCase( { it.dataSet.get("name").value.eq("Jozko") & it.processIdentifier.eq("insurance") } );

List<Task> findTasks(Closure<Predicate> predicate)

Finds all tasks that match the given predicate. The predicate is a groovy closure that accepts QCase object and returns QueryDSL Predicate.

...

List<Task> findTasks(Closure<Predicate> predicate, Pageable page) 

Finds all tasks that match the given predicate. The predicate is a groovy closure that accepts QCase object and returns QueryDSL Predicate. Pageable determines the requested page number, page size, sort fields, and sort direction.

...

Code Block
languagexml
// find 10 tasks sorted by priority
def newTasks = findTasks( { it.transitionId.eq("new_task") }, new PageRequest(0, 10, Sort.by("priority").descending() ) )

Task findTask(Closure<Predicate> predicate)

Finds the first task that matches the given predicate. The predicate is a groovy closure that accepts QCase object and returns QueryDSL Predicate.

Example
Code Block
languagexml
List<Task> tasks = findTasks( { it.transitionId.eq("edit_limit") } )
...
def useCase = findCase(...)
List<Task> tasks = findTasks( { it.caseId.eq(useCase.stringId) } );

...

Task assignTask(String transitionId, Case aCase = useCase, User user = userService.loggedOrSystem) 

Assign the task in current case with given transitionId. Optional parameter aCase identifies case which the task belongs to. Optional parameter user identifies actor who will perform assign.

...

Task assignTask(Task task, User user = userService.loggedOrSystem)

Assign the task to user. Optional parameter user identifies actor who will perform assign.

...

assignTasks(List<Task> tasks, User assignee = userService.loggedOrSystem)

Assign the tasks to user. Optional parameter user identifies actor who will perform assign.

...

cancelTask(String transitionId, Case aCase = useCase, User user = userService.loggedOrSystem) 
Anchor
cancel_task
cancel_task

Cancels the task in current case with given transitionId. Optional parameter aCase identifies case which the task belongs to. Optional parameter user identifies actor who will perform cancel.

...

cancelTask(Task task, User user = userService.loggedOrSystem)

Cancels the provided task. Optional parameter user identifies actor who will perform cancel.

...

Cancels all the provided tasks. Optional parameter user identifies actor who will perform cancel.

...

finishTask(String transitionId, Case aCase = useCase, User user = userService.loggedOrSystem)

...

Finish the task in current case with given transitionId. Optional parameter aCase identifies case which the task belongs to. Optional parameter user identifies actor who will perform cancel.

...

finishTask(Task task, User user = userService.loggedOrSystem)

Finish the provided task. Optional parameter user identifies actor who will perform cancel.

...

finishTasks(List<Task> tasks, User user = userService.loggedOrSystem)

Finish all the provided tasks. Optional parameter user identifies actor who will perform cancel.

...

setData(Task task, Map dataSet)

Sets values of data fields on given task. Values are mapped to data fields in dataSet using data fields import Id as key.

Example
Code Block
languagexml
def usecase = findCase({ it.title.eq("Limits") }).first()
def task = findTask({ it.caseId.eq(usecase.stringId & it.transitionId.eq("edit_limit")) })
setData(task, [
    "new_limit": [
        "value": "10000",
        "type" : "number"
    ],
])

setData(Transition transition, Map dataSet)

Sets values of data fields on taskof transition in current case. Values are mapped to data fields in dataSet using data fields import Id as key.

...

setData(String transitionId, Case useCase, Map dataSet)

Sets values of data fields on task identified by transitionId of given case. Values are mapped to data fields in dataSet using data fields import Id as key.

...

Map<String, Field> getData(Task task)

Gets all data fields on given task, mapped by its import Id.

...

Map<String, Field> getData(Transition transition)

Gets all data fields on the task of transition in the current case, mapped by its import Id.

...

Map<String, Field> getData(String transitionId, Case useCase)

Gets all data fields on the task defined by its transitionId in given case, mapped by its import Id.

...