[adsenseyu2]
Following are key source code blocks/classes/APIs to consider for you to get started with Bonita REST API implementation:
ProcessDefinitionUUID processDefinitionUUID = new ProcessDefinitionUUID(process, version); try { return runtimeAPI.instantiateProcess(processDefinitionUUID, params); } catch (ProcessNotFoundException e) { } catch (VariableNotFoundException e) { }
Following is the source code representing usage of above methods to create a task:
public void createTask(final String taskId, final Map<String, Object> taskVariables) { ActivityInstanceUUID activityUUID = new ActivityInstanceUUID(taskId); ProcessInstanceUUID processUUID; runtimeAPI = AccessorUtil.getRuntimeAPI(); queryRuntimeAPI = AccessorUtil.getQueryRuntimeAPI(); try { processUUID = queryRuntimeAPI.getLightTaskInstance(activityUUID).getProcessInstanceUUID(); LightProcessInstance lpInstance = queryRuntimeAPI.getLightProcessInstance(processUUID); runtimeAPI.startTask(activityUUID, true); runtimeAPI.setProcessInstanceVariables(lpInstance.getProcessInstanceUUID(), taskVariables); runtimeAPI.finishTask(activityUUID, true); } catch (TaskNotFoundException e) { } catch (InstanceNotFoundException e) { } catch (IllegalTaskStateException e) { } catch (VariableNotFoundException e) { } }
public LightTaskInstance getTask(final String taskId) { ActivityInstanceUUID activityInstanceUUID = new ActivityInstanceUUID(taskId); try { return queryRuntimeAPI.getLightTaskInstance(activityInstanceUUID); } catch (TaskNotFoundException e) { } return null; }
[adsenseyu1]
Last updated: 3rd May, 2024 Have you ever wondered why some machine learning models perform…
Last updated: 2nd May, 2024 The success of machine learning models often depends on the…
When working on a machine learning project, one of the key challenges faced by data…
Last updated: 1st May, 2024 The bias-variance trade-off is a fundamental concept in machine learning…
Last updated: 1st May, 2024 As a data scientist, understanding the nuances of various cost…
Last updated: 1st May, 2024 In this post, you will learn the concepts related to…