[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]
Artificial Intelligence (AI) agents have started becoming an integral part of our lives. Imagine asking…
In the ever-evolving landscape of agentic AI workflows and applications, understanding and leveraging design patterns…
In this blog, I aim to provide a comprehensive list of valuable resources for learning…
Have you ever wondered how systems determine whether to grant or deny access, and how…
What revolutionary technologies and industries will define the future of business in 2025? As we…
For data scientists and machine learning researchers, 2024 has been a landmark year in AI…