Changes behaviour of given data field f on transition t, iff condition returns true. Behaviour can be one of:
visible,
editable,
required,
optional,
hidden.
forbidden
garage_check: f.garage_check, garage_cost: f.garage_cost, garage: t.garage; make garage_cost,visible on garage when { return garage_check.value == true; } |
Deprecated See 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.
period: f.108001, sum: f.308011; change period value { def limit = 20.0; if (period.value == "polročná") limit = 40.0; if (period.value == "štvrťročná") limit = 80.0; if ((sum.value as Double) < (limit as Double)) return "ročná"; return unchanged; } |
Sets a new set of choices to data field f.
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.
self: f.this; generate "Insurance.offerPDF",always into self |
Changes the property of the current case, the new value is generated by the supplier.
trans: t.this; changeCaseProperty "icon" about { trans.icon } |
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).
createCase("create_case_net","Create Case Case","color-fg-amber-500", otherUser); createCase("create_case_net","Create Case Case","color-fg-amber-500"); createCase("create_case_net","Create Case Case"); createCase("create_case_net"); |
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).
def net = petriNetService.getNewestVersionByIdentifier("insurance") createCase(net) createCase(net, "My insurance") createCase(net, "My insurance", "color-fg-amber-500") createCase(net, "Other insurance", "color-fg-amber-500", otherUser) |
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> cases = findCases( { it.title.eq("Case 1") } ); ... List<Case> cases = findCases( { it.dataSet.get("name").value.eq("Jozko") } ); |
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.
// returns the first page of 5 cases sorted by the title List<Case> cases = findCases( { it.dataSet.get("name").value.eq("Jozko") }, new PageRequest(0, 10, Sort.by("title").ascending() ) ); ... // returns the second page of 5 cases sorted from the newest to oldest List<Case> cases = findCases( { it.dataSet.get("name").value.eq("Jozko") }, new PageRequest(1, 5, Sort.by("creationDate").descending() ) ); |
Finds the first case that matches the given predicate. The predicate is a groovy closure that accepts QCase object and returns QueryDSL Predicate.
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") } ); |
Finds all tasks that match the given predicate. The predicate is a groovy closure that accepts QCase object and returns QueryDSL Predicate.
def useCase = findCase(...) Task task = findTask( { it.caseId.eq(useCase.stringId) & it.transitionId.eq("edit_limit") } ); |
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.
// find 10 tasks sorted by priority def newTasks = findTasks( { it.transitionId.eq("new_task") }, new PageRequest(0, 10, Sort.by("priority").descending() ) ) |
Finds the first task that matches the given predicate. The predicate is a groovy closure that accepts QCase object and returns QueryDSL Predicate.
List<Task> tasks = findTasks( { it.transitionId.eq("edit_limit") } ) ... def useCase = findCase(...) List<Task> tasks = findTasks( { it.caseId.eq(useCase.stringId) } ); |
Deprecated See cancel. |
Executes all fireable transitions identified by the transitionId in all case where the predicate returns true. For each task following actions are called:
assign to the system user
save new data values
finish.
The predicate is a list of Querydsl queries. Every case property can be used in a query. For more info see querydsl doc and QCase javadoc.
field: f.field; execute "synchronized" where ([ "title eq Case 1" ] as List) with ([ "field": [ value: 128.0, type: "number" ] ] as Map) |
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.
selectedUser: f.select_controler; if (selectedUser.value) { def aCase = findCase({ it.author.id.eq(selectedUser.value.id) }) def user = userService.findById(selectedUser.value.id, false) assignTask("control", aCase, user); } |
Assign the task to user. Optional parameter user identifies actor who will perform assign.
selectedUser: f.select_controler; if (selectedUser.value) { def usecase = findCase({ it.title("Some case") }).first() def task = findTask({ it.importId.eq("control") & it.caseId.eq(usecase.stringId) }) def user = userService.findById(selectedUser.value.id, false) assignTask(task, user); } |
Assign the tasks to user. Optional parameter user identifies actor who will perform assign.
// find all my cases and assign all their control tasks to me def cases = findCases( { it.author.id.eq(loggedUser().id)) } ) def caseIds = cases.collect { it.stringId } def tasks = findTasks({ it.importId.eq("control") & it.caseId.in(cases) }) assignTasks(tasks) |
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.
def taskId = "work_task"; def aCase = findCase({ it.author.id.eq(loggedUser().id) }) cancelTask(taskId, aCase); |
Cancels the provided task. Optional parameter user identifies actor who will perform cancel.
// cancel the task "work_task", currently assigned to me, in the current case def task = findTask( { it.transitionId.eq("work_task") } ); cancelTask(task); |
Cancels all the provided tasks. Optional parameter user identifies actor who will perform cancel.
// cancel the task "work_task", currently assigned to me, in the current case def tasks = findTasks( { it.transitionId.eq("work_task") } ); cancelTasks(tasks); |
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.
// finish the task "work_task", currently assigned to me, in the current case def taskId = "work_task"; def aCase = findCase({ it.author.id.eq(loggedUser().id) }) finishTask(taskId, aCase); |
Finish the provided task. Optional parameter user identifies actor who will perform cancel.
// finish the task "work_task", currently assigned to me in current case def task = findTask( { it.transitionId.eq("work_task") & it.caseId.eq(useCase.stringId) & it.userId.eq(loggedUser().id) } ); finishTask(task); |
Finish all the provided tasks. Optional parameter user identifies actor who will perform cancel.
// finish all the tasks "work_task", currently assigned to me def tasks = findTasks( { it.transitionId.eq("work_task") & it.userId.eq(loggedUser().id) } ); finishTasks(tasks); |
Sets values of data fields on given task. Values are mapped to data fields in dataSet using data fields import Id as key.
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" ], ]) |
Sets values of data fields on task of transition in current case. Values are mapped to data fields in dataSet using data fields import Id as key.
transition: t.edit_limit; setData(transition, [ "new_limit": [ "value": "10000", "type" : "number" ], ]) |
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.
def usecase = findCase({ it.title.eq("Limits") }).first() setData("edit_limit", usecase, [ "new_limit": [ "value": "10000", "type" : "number" ], ]) |
Gets all data fields on given task, mapped by its import Id.
actual_limit: f.actual_limit; def usecase = findCase({ it.title.eq("Limits") }).first() def task = findTask({ it.transitionId.eq("view_limit") & it.caseId.eq(usecase.stringId) }) def data = getData(task) change actual_limit value { data["remote_limit"].value } |
Gets all data fields on the task of transition in the current case, mapped by its import Id.
view_limit: t.view_limit; actual_limit: f.actual_limit; def data = getData(view_limit) change actual_limit value { data["remote_limit"].value } |
Gets all data fields on the task defined by its transitionId in given case, mapped by its import Id.
view_limit: t.view_limit; def usecase = findCase({ it.title.eq("Limits") }).first() def data = getData("view_limit", usecase) change actual_limit value { data["remote_limit"].value } |
Assigns role identified by roleId to user. User is optional parameter, default value is currently logged user. Returns updated object of user.
transition: t.task; assignRole(transition.defaultRoleId); |
Returns currently logged user.
userField: t.user; change userField value { return loggedUser() } |