public class ProcessDefinitionBuilder extends Object implements DescriptionBuilder, ContainerBuilder
Modifier and Type | Field and Description |
---|---|
protected org.bonitasoft.engine.bpm.process.impl.internal.DesignProcessDefinitionImpl |
process |
Constructor and Description |
---|
ProcessDefinitionBuilder() |
protected org.bonitasoft.engine.bpm.process.impl.internal.DesignProcessDefinitionImpl process
public ProcessDefinitionBuilder createNewInstance(String name, String version)
DesignProcessDefinition
with the given name and version. This method is the entry point of this builder. It must
be called before any other method. The DesignProcessDefinition
building will be completed when the method done()
or
getProcess()
is called.name
- the process nameversion
- the process versionpublic DesignProcessDefinition done() throws InvalidProcessDefinitionException
InvalidProcessDefinitionException
- when the process definition is inconsistent. The exception contains causespublic BusinessDataDefinitionBuilder addBusinessData(String name, String className, Expression defaultValue)
BusinessDataDefinition
on this process.name
- The name of the new BusinessDataDefinition
className
- The complete name of class defining the new BusinessDataDefinition
typedefaultValue
- The expression representing the default valueBusinessDataDefinitionBuilder
containing the new BusinessDataDefinition
protected void validateBusinessData()
protected void addError(String error)
public DocumentDefinitionBuilder addDocumentDefinition(String name)
ContainerBuilder
Must add also the content if the document is not external. This can be done using
BusinessArchiveBuilder.addDocumentResource(org.bonitasoft.engine.bpm.bar.BarResource)
addDocumentDefinition
in interface ContainerBuilder
name
- name of the document definitionpublic DocumentListDefinitionBuilder addDocumentListDefinition(String name)
ContainerBuilder
addDocumentListDefinition
in interface ContainerBuilder
name
- the name of the listpublic ProcessDefinitionBuilder addDescription(String description)
DescriptionBuilder
addDescription
in interface DescriptionBuilder
description
- the description to set on this element.DescriptionBuilder
, to allow to chain the calls.public ProcessDefinitionBuilder addDisplayName(String name)
name
- display namepublic ProcessDefinitionBuilder addDisplayDescription(String description)
description
- display descriptionpublic void checkName(String name)
public ConnectorDefinitionBuilder addConnector(String name, String connectorId, String version, ConnectorEvent activationEvent)
FlowElementBuilder
Must also add connector dependencies and connector implementation descriptor
addConnector
in interface FlowElementBuilder
name
- The name the connector instance will useconnectorId
- The id of the Connector definition (connector implementation added in BusinessArchive
must match this id in
definitionIdversion
- The version of the Connector definitionactivationEvent
- ConnectorEvent
on which the connector will be triggeredBusinessArchiveBuilder.addClasspathResource(org.bonitasoft.engine.bpm.bar.BarResource)
,
BusinessArchiveBuilder.addConnectorImplementation(org.bonitasoft.engine.bpm.bar.BarResource)
public UserTaskDefinitionBuilder addUserTask(String taskName, String actorName)
FlowElementBuilder
UserTaskDefinition
on this elementaddUserTask
in interface FlowElementBuilder
taskName
- The task nameactorName
- The name of the actor that will perform this taskpublic AutomaticTaskDefinitionBuilder addAutomaticTask(String taskName)
FlowElementBuilder
addAutomaticTask
in interface FlowElementBuilder
taskName
- The task namepublic ReceiveTaskDefinitionBuilder addReceiveTask(String taskName, String messageName)
FlowElementBuilder
ReceiveTaskDefinition
on this elementaddReceiveTask
in interface FlowElementBuilder
taskName
- The task namemessageName
- The name of message to be receivedpublic SendTaskDefinitionBuilder addSendTask(String taskName, String messageName, Expression targetProcess)
FlowElementBuilder
SendTaskDefinition
on this elementaddSendTask
in interface FlowElementBuilder
taskName
- The task namemessageName
- The name of message to be senttargetProcess
- The expression representing the target process namepublic ManualTaskDefinitionBuilder addManualTask(String name, String actorName)
FlowElementBuilder
ManualTaskDefinition
on this elementaddManualTask
in interface FlowElementBuilder
name
- The task nameactorName
- The name of the actor that will perform this taskpublic TransitionDefinitionBuilder addTransition(String source, String target)
FlowElementBuilder
addTransition
in interface FlowElementBuilder
source
- The source element nametarget
- The target element namepublic TransitionDefinitionBuilder addTransition(String source, String target, Expression condition)
FlowElementBuilder
addTransition
in interface FlowElementBuilder
source
- The source element nametarget
- The target element namecondition
- The transition condition. The transition is taken if and only if the expression is evaluated to Boolean.TRUE
.public GatewayDefinitionBuilder addGateway(String name, GatewayType gatewayType)
FlowElementBuilder
GatewayDefinition
on this elementaddGateway
in interface FlowElementBuilder
name
- The gateway namegatewayType
- The gateway typepublic StartEventDefinitionBuilder addStartEvent(String name)
FlowElementBuilder
StartEventDefinition
on this elementaddStartEvent
in interface FlowElementBuilder
name
- The start event namepublic EndEventDefinitionBuilder addEndEvent(String name)
FlowElementBuilder
EndEventDefinition
on this elementaddEndEvent
in interface FlowElementBuilder
name
- The end event namepublic IntermediateCatchEventDefinitionBuilder addIntermediateCatchEvent(String name)
FlowElementBuilder
IntermediateCatchEventDefinition
on this elementaddIntermediateCatchEvent
in interface FlowElementBuilder
name
- The intermediate catch event namepublic IntermediateThrowEventDefinitionBuilder addIntermediateThrowEvent(String name)
FlowElementBuilder
IntermediateThrowEventDefinition
on this elementaddIntermediateThrowEvent
in interface FlowElementBuilder
name
- The intermediate throw event namepublic CallActivityBuilder addCallActivity(String name, Expression callableElement, Expression callableElementVersion)
FlowElementBuilder
CallActivityDefinition
on this elementaddCallActivity
in interface FlowElementBuilder
name
- The call activity namecallableElement
- The expression representing the name of process to be calledcallableElementVersion
- The expression representing the version of process to be calledpublic SubProcessActivityDefinitionBuilder addSubProcess(String name, boolean triggeredByEvent)
FlowElementBuilder
SubProcessDefinition
on this elementaddSubProcess
in interface FlowElementBuilder
name
- The sub process nametriggeredByEvent
- true if it's an event sub-process; false if it's a subprocesspublic DataDefinitionBuilder addIntegerData(String name, Expression defaultValue)
FlowElementBuilder
addIntegerData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic DataDefinitionBuilder addLongData(String name, Expression defaultValue)
FlowElementBuilder
addLongData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic DataDefinitionBuilder addShortTextData(String name, Expression defaultValue)
FlowElementBuilder
addShortTextData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic TextDataDefinitionBuilder addLongTextData(String name, Expression defaultValue)
FlowElementBuilder
addLongTextData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic DataDefinitionBuilder addDoubleData(String name, Expression defaultValue)
FlowElementBuilder
addDoubleData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic DataDefinitionBuilder addFloatData(String name, Expression defaultValue)
FlowElementBuilder
addFloatData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic DataDefinitionBuilder addDateData(String name, Expression defaultValue)
FlowElementBuilder
addDateData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic XMLDataDefinitionBuilder addXMLData(String name, Expression defaultValue)
FlowElementBuilder
addXMLData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic DataDefinitionBuilder addBlobData(String name, Expression defaultValue)
FlowElementBuilder
addBlobData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic DataDefinitionBuilder addBooleanData(String name, Expression defaultValue)
FlowElementBuilder
addBooleanData
in interface FlowElementBuilder
name
- The data namedefaultValue
- The expression representing the default valuepublic DataDefinitionBuilder addData(String name, String className, Expression defaultValue)
FlowElementBuilder
addData
in interface FlowElementBuilder
name
- The data nameclassName
- The data type class name (i.e. java.lang.String)defaultValue
- The expression representing the default valuepublic ActorDefinitionBuilder addActor(String actorName)
actorName
- actor nameaddActor(String, boolean)
public ActorDefinitionBuilder addActor(String name, boolean initiator)
name
- actor nameinitiator
- defines whether it's the actor initiator (actor that's able to start the process)public ActorDefinitionBuilder setActorInitiator(String actorName)
actorName
- public TransitionDefinitionBuilder addDefaultTransition(String source, String target)
FlowElementBuilder
addDefaultTransition
in interface FlowElementBuilder
source
- The source element nametarget
- The target element namepublic DesignProcessDefinition getProcess() throws InvalidProcessDefinitionException
InvalidProcessDefinitionException
- when the process definition is inconsistent. The exception contains causespublic ParameterDefinitionBuilder addParameter(String parameterName, String type)
parameterName
- The name of the new ParameterDefinition
type
- The type of the new ParameterDefinition
(complete class name)ParameterDefinitionBuilder
containing the new ParameterDefinition
public ProcessDefinitionBuilder addContextEntry(String key, Expression expression)
public ContractDefinitionBuilder addContract()
Copyright © 2016 Bonitasoft S.A.. All rights reserved.