Hello Bonita friends,
we’re working on Bonita BPM adapter that should be able to communicate between two BPM worlds (Bonita BPM 6.3 and our BPM Inbox which is a BPM framework with its own API). Actually we have done Acitivi and Adobe LC adapters that both communicate with our BPM Inbox very well. Now we’re adding the third adapter - Bonita BPM.
We have a business requirement to create a UserTask and save it in Bonita world using Bonita BPM API 6.3. We have to create it from non-Bonita object UserTask (without ID). Once it’s created and saved in Bonita BPM, it’s converted to non-Bonita object UserTask and returned back with newly created ID.
To do this, we need to take all the parameters from this non-Bonita object and somehow pass them to the Bonita BPM infrastructure (some Bonita builders or whatever), call some Bonita API feature(s) that would return HumanTaskInstance or at least its ID.
Here’re some details on non-Bonita object that we need to pass to the Bonita BPM world and create HumanTaskInstance from it:
createTime (when the task was created),
delegationState,
description,
dueDate (when the task should be finished),
id (available only for persisted object),
name (name of the task),
priority (number value),
suspend (true or false),
subtasks (set of subtasks, it can be undefined),
parent (parent UserTask object),
starter (user who created the adhoc task, in other cases can be undefined),
assignee (user who compile the task),
owner (user to whom the task is delegated),
userCandidates (list of potential candidates of the task),
groupCandidates (list of groups of potential candidates of the task),
comment (an object that holds user’s comments),
attachments
Is something like this even possible?
We looked into the Bonita source code and found this: org.bonitasoft.engine.service.TenantServiceAccessor.getBPMInstancesCreator() that returns org.bonitasoft.engine.bpm.model.impl.BPMInstancesCreator. Once we would have this, we could call:
public SFlowNodeInstance toFlowNodeInstance(final long processDefinitionId, final long rootContainerId, final long parentContainerId, final SFlowElementsContainerType parentContainerType, final SFlowNodeDefinition sFlowNodeDefinition, final long rootProcessInstanceId, final long parentProcessInstanceId, final boolean createInnerActivity, final int loopCounter, final SStateCategory stateCategory, final long relatedActivityInstanceId, final Long tokenRefId) throws SActorNotFoundException, SActivityReadException { }
But this approach looks like not usable because mentioned calls are internal usable in Bonita engine only, so we cannot implement it this way.
Another reason could be (similar to Oracle BPEL) that there’s no ad hoc task (only task based on process) meaning that user task can only be created by a process and therefore there’s no external API for creating such task (HumanTaskInstance).
Can someone help on this?
Thanks in advance,
Majo