├── .gitignore
├── CHANELOG-zh.md
├── CHANELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README-zh.md
├── README.md
├── core
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── com
│ │ └── alibaba
│ │ └── smart
│ │ └── framework
│ │ └── engine
│ │ ├── SmartEngine.java
│ │ ├── annotation
│ │ ├── Experiment.java
│ │ ├── Retryable.java
│ │ └── WorkAround.java
│ │ ├── behavior
│ │ ├── ActivityBehavior.java
│ │ ├── TransitionBehavior.java
│ │ ├── base
│ │ │ ├── AbstractActivityBehavior.java
│ │ │ └── AbstractTransitionBehavior.java
│ │ └── impl
│ │ │ ├── BusinessRuleTaskBehavior.java
│ │ │ ├── ManualTaskBehavior.java
│ │ │ ├── ReceiveTaskBehavior.java
│ │ │ ├── ScriptTaskBehavior.java
│ │ │ ├── SendTaskBehavior.java
│ │ │ ├── ServiceTaskBehavior.java
│ │ │ ├── TaskBehavior.java
│ │ │ ├── UserTaskBehavior.java
│ │ │ └── UserTaskBehaviorHelper.java
│ │ ├── bpmn
│ │ ├── assembly
│ │ │ ├── artifacts
│ │ │ │ ├── Association.java
│ │ │ │ ├── Category.java
│ │ │ │ ├── Group.java
│ │ │ │ ├── TextAnnotation.java
│ │ │ │ └── parser
│ │ │ │ │ ├── AssociationParser.java
│ │ │ │ │ ├── CategoryParser.java
│ │ │ │ │ ├── GroupParser.java
│ │ │ │ │ └── TextAnnotationParser.java
│ │ │ ├── callactivity
│ │ │ │ ├── CallActivity.java
│ │ │ │ └── parser
│ │ │ │ │ └── CallActivityParser.java
│ │ │ ├── common
│ │ │ │ ├── Documentation.java
│ │ │ │ ├── Incoming.java
│ │ │ │ ├── Outgoing.java
│ │ │ │ └── parser
│ │ │ │ │ ├── DocumentationParser.java
│ │ │ │ │ ├── IncomingParser.java
│ │ │ │ │ └── OutgoingParser.java
│ │ │ ├── diagram
│ │ │ │ ├── Diagram.java
│ │ │ │ └── parser
│ │ │ │ │ └── DiagramParser.java
│ │ │ ├── event
│ │ │ │ ├── AbstractEvent.java
│ │ │ │ ├── EndEvent.java
│ │ │ │ ├── StartEvent.java
│ │ │ │ └── parser
│ │ │ │ │ ├── EndEventParser.java
│ │ │ │ │ └── StartEventParser.java
│ │ │ ├── expression
│ │ │ │ ├── ConditionExpressionImpl.java
│ │ │ │ └── parser
│ │ │ │ │ └── ConditionExpressionParser.java
│ │ │ ├── extension
│ │ │ │ ├── ExtensionElementsImpl.java
│ │ │ │ └── parser
│ │ │ │ │ └── ExtensionElementsParser.java
│ │ │ ├── gateway
│ │ │ │ ├── AbstractGateway.java
│ │ │ │ ├── ExclusiveGateway.java
│ │ │ │ ├── InclusiveGateway.java
│ │ │ │ ├── ParallelGateway.java
│ │ │ │ └── parser
│ │ │ │ │ ├── ExclusiveGatewayParser.java
│ │ │ │ │ ├── InclusiveGatewayParser.java
│ │ │ │ │ └── ParallelGatewayParser.java
│ │ │ ├── multi
│ │ │ │ └── instance
│ │ │ │ │ ├── CompletionCondition.java
│ │ │ │ │ ├── InputDataItem.java
│ │ │ │ │ ├── LoopCardinality.java
│ │ │ │ │ ├── LoopDataInputRef.java
│ │ │ │ │ ├── MultiInstanceLoopCharacteristics.java
│ │ │ │ │ └── parser
│ │ │ │ │ ├── CompletionConditionParser.java
│ │ │ │ │ ├── InputDataItemParser.java
│ │ │ │ │ ├── LoopCardinalityParser.java
│ │ │ │ │ ├── LoopDataInputRefParser.java
│ │ │ │ │ └── MultiInstanceLoopCharacteristicsParser.java
│ │ │ ├── process
│ │ │ │ ├── ProcessDefinitionImpl.java
│ │ │ │ ├── ProcessDefinitionSourceImpl.java
│ │ │ │ ├── SequenceFlow.java
│ │ │ │ └── parser
│ │ │ │ │ ├── AbstractBpmnParser.java
│ │ │ │ │ ├── ProcessDefinitionParser.java
│ │ │ │ │ ├── ProcessDefinitionSourceParser.java
│ │ │ │ │ └── SequenceFlowParser.java
│ │ │ └── task
│ │ │ │ ├── BusinessRuleTask.java
│ │ │ │ ├── ManualTask.java
│ │ │ │ ├── ReceiveTask.java
│ │ │ │ ├── ScriptTask.java
│ │ │ │ ├── SendTask.java
│ │ │ │ ├── ServiceTask.java
│ │ │ │ ├── Task.java
│ │ │ │ ├── UserTask.java
│ │ │ │ └── parser
│ │ │ │ ├── BusinessRuleTaskParser.java
│ │ │ │ ├── ClassNameWorkAroundUtil.java
│ │ │ │ ├── ManualTaskParser.java
│ │ │ │ ├── ReceiveTaskParser.java
│ │ │ │ ├── ScriptTaskParser.java
│ │ │ │ ├── SendTaskParser.java
│ │ │ │ ├── ServiceTaskParser.java
│ │ │ │ ├── TaskParser.java
│ │ │ │ └── UserTaskParser.java
│ │ ├── behavior
│ │ │ ├── callactivity
│ │ │ │ └── CallActivityBehavior.java
│ │ │ ├── event
│ │ │ │ ├── EndEventBehavior.java
│ │ │ │ └── StartEventBehavior.java
│ │ │ ├── gateway
│ │ │ │ ├── ExclusiveGatewayBehavior.java
│ │ │ │ ├── InclusiveGatewayBehavior.java
│ │ │ │ ├── ParallelGatewayBehavior.java
│ │ │ │ ├── helper
│ │ │ │ │ ├── CommonGatewayHelper.java
│ │ │ │ │ └── InclusiveGatewayHelper.java
│ │ │ │ └── tree
│ │ │ │ │ └── ActivityTreeNode.java
│ │ │ └── process
│ │ │ │ └── SequenceFlowBehavior.java
│ │ └── constant
│ │ │ └── BpmnNameSpaceConstant.java
│ │ ├── common
│ │ ├── expression
│ │ │ ├── ExpressionUtil.java
│ │ │ └── evaluator
│ │ │ │ ├── ExpressionEvaluator.java
│ │ │ │ ├── LogEnhancedMvelExpressionEvaluator.java
│ │ │ │ ├── MvelExpressionEvaluator.java
│ │ │ │ └── TFormalExpressionExpressionEvaluator.java
│ │ └── util
│ │ │ ├── CollectionUtil.java
│ │ │ ├── DateUtil.java
│ │ │ ├── IdAndVersionUtil.java
│ │ │ ├── InstanceUtil.java
│ │ │ ├── MapUtil.java
│ │ │ ├── MarkDoneUtil.java
│ │ │ ├── MvelUtil.java
│ │ │ └── StringUtil.java
│ │ ├── configuration
│ │ ├── ConfigurationOption.java
│ │ ├── DelegationExecutor.java
│ │ ├── ExceptionProcessor.java
│ │ ├── IdGenerator.java
│ │ ├── InstanceAccessor.java
│ │ ├── ListenerExecutor.java
│ │ ├── LockStrategy.java
│ │ ├── MultiInstanceCounter.java
│ │ ├── OptionContainer.java
│ │ ├── ParallelServiceOrchestration.java
│ │ ├── ProcessEngineConfiguration.java
│ │ ├── PvmActivityTask.java
│ │ ├── PvmActivityTaskFactory.java
│ │ ├── TableSchemaNaming.java
│ │ ├── TableSchemaStrategy.java
│ │ ├── TaskAssigneeDispatcher.java
│ │ ├── VariablePersister.java
│ │ ├── aware
│ │ │ └── ProcessEngineConfigurationAware.java
│ │ ├── impl
│ │ │ ├── DefaultDelegationExecutor.java
│ │ │ ├── DefaultExceptionProcessor.java
│ │ │ ├── DefaultIdGenerator.java
│ │ │ ├── DefaultInstanceAccessor.java
│ │ │ ├── DefaultListenerExecutor.java
│ │ │ ├── DefaultParallelServiceOrchestration.java
│ │ │ ├── DefaultProcessEngineConfiguration.java
│ │ │ ├── DefaultPvmActivityTask.java
│ │ │ ├── DefaultPvmActivityTaskFactory.java
│ │ │ ├── DefaultSmartEngine.java
│ │ │ ├── DefaultTableSchemaStrategy.java
│ │ │ ├── DefaultVariablePersister.java
│ │ │ ├── DefaultXmlParserFacade.java
│ │ │ └── option
│ │ │ │ ├── DefaultOptionContainer.java
│ │ │ │ ├── DisabledOption.java
│ │ │ │ ├── EagerFlushEnabledOption.java
│ │ │ │ ├── ExpressionCompileResultCachedOption.java
│ │ │ │ ├── ProcessDefinitionMultiTenantShareOption.java
│ │ │ │ ├── ServiceOrchestrationEnabledOption.java
│ │ │ │ └── TransferEnabledOption.java
│ │ └── scanner
│ │ │ ├── AnnotationScanner.java
│ │ │ └── ExtensionBindingResult.java
│ │ ├── constant
│ │ ├── AdHocConstant.java
│ │ ├── AssigneeTypeConstant.java
│ │ ├── DeploymentStatusConstant.java
│ │ ├── ExtensionElementsConstant.java
│ │ ├── LogicStatusConstant.java
│ │ ├── ParallelGatewayConstant.java
│ │ ├── RequestMapSpecialKeyConstant.java
│ │ ├── SmartBase.java
│ │ └── TaskInstanceConstant.java
│ │ ├── context
│ │ ├── ExecutionContext.java
│ │ ├── factory
│ │ │ ├── ContextFactory.java
│ │ │ └── impl
│ │ │ │ └── DefaultContextFactory.java
│ │ └── impl
│ │ │ └── DefaultExecutionContext.java
│ │ ├── delegation
│ │ ├── ContextBoundedJavaDelegation.java
│ │ ├── JavaDelegation.java
│ │ ├── RootDelegation.java
│ │ ├── TccDelegation.java
│ │ └── TccResult.java
│ │ ├── deployment
│ │ ├── ProcessDefinitionContainer.java
│ │ └── impl
│ │ │ └── DefaultProcessDefinitionContainer.java
│ │ ├── exception
│ │ ├── ConcurrentException.java
│ │ ├── DeployException.java
│ │ ├── EngineException.java
│ │ ├── LockException.java
│ │ ├── ParseException.java
│ │ ├── SignalException.java
│ │ └── ValidationException.java
│ │ ├── extension
│ │ ├── annotation
│ │ │ └── ExtensionBinding.java
│ │ ├── constant
│ │ │ └── ExtensionConstant.java
│ │ ├── lookup
│ │ │ ├── AnnotationLookup.java
│ │ │ └── PlaceHolderAnnotationLookup.java
│ │ └── scanner
│ │ │ └── SimpleAnnotationScanner.java
│ │ ├── helper
│ │ └── ExecutionInstanceHelper.java
│ │ ├── hook
│ │ └── LifeCycleHook.java
│ │ ├── instance
│ │ ├── factory
│ │ │ ├── ActivityInstanceFactory.java
│ │ │ ├── DeploymentInstanceFactory.java
│ │ │ ├── ExecutionInstanceFactory.java
│ │ │ ├── ProcessInstanceFactory.java
│ │ │ ├── TaskInstanceFactory.java
│ │ │ ├── TransitionInstanceFactory.java
│ │ │ └── impl
│ │ │ │ ├── DefaultActivityInstanceFactory.java
│ │ │ │ ├── DefaultExecutionInstanceFactory.java
│ │ │ │ ├── DefaultProcessInstanceFactory.java
│ │ │ │ ├── DefaultTaskInstanceFactory.java
│ │ │ │ └── DefaultTransitionInstanceFactory.java
│ │ ├── impl
│ │ │ ├── AbstractInstance.java
│ │ │ ├── AbstractLifeCycleInstance.java
│ │ │ ├── DefaultActivityInstance.java
│ │ │ ├── DefaultDeploymentInstance.java
│ │ │ ├── DefaultExecutionInstance.java
│ │ │ ├── DefaultProcessInstance.java
│ │ │ ├── DefaultTaskAssigneeInstance.java
│ │ │ ├── DefaultTaskInstance.java
│ │ │ ├── DefaultTransitionInstance.java
│ │ │ └── DefaultVariableInstance.java
│ │ └── storage
│ │ │ ├── ActivityInstanceStorage.java
│ │ │ ├── DeploymentInstanceStorage.java
│ │ │ ├── ExecutionHistoryInstanceStorage.java
│ │ │ ├── ExecutionInstanceStorage.java
│ │ │ ├── ProcessInstanceStorage.java
│ │ │ ├── TaskAssigneeStorage.java
│ │ │ ├── TaskInstanceStorage.java
│ │ │ └── VariableInstanceStorage.java
│ │ ├── interceptor
│ │ ├── Interceptor.java
│ │ ├── InterceptorChain.java
│ │ └── InterceptorSupport.java
│ │ ├── listener
│ │ ├── Listener.java
│ │ └── ListenerAggregation.java
│ │ ├── model
│ │ ├── assembly
│ │ │ ├── Activity.java
│ │ │ ├── BaseElement.java
│ │ │ ├── ConditionExpression.java
│ │ │ ├── ExtensionDecorator.java
│ │ │ ├── ExtensionElementContainer.java
│ │ │ ├── ExtensionElements.java
│ │ │ ├── IdBasedElement.java
│ │ │ ├── NoneIdBasedElement.java
│ │ │ ├── ProcessDefinition.java
│ │ │ ├── ProcessDefinitionSource.java
│ │ │ ├── Transition.java
│ │ │ └── impl
│ │ │ │ ├── AbstractActivity.java
│ │ │ │ ├── AbstractTask.java
│ │ │ │ └── AbstractTransition.java
│ │ └── instance
│ │ │ ├── ActivityInstance.java
│ │ │ ├── DeploymentInstance.java
│ │ │ ├── ExecutionHistoryInstance.java
│ │ │ ├── ExecutionInstance.java
│ │ │ ├── Instance.java
│ │ │ ├── InstanceStatus.java
│ │ │ ├── LifeCycleInstance.java
│ │ │ ├── ProcessInstance.java
│ │ │ ├── TaskAssigneeCandidateInstance.java
│ │ │ ├── TaskAssigneeInstance.java
│ │ │ ├── TaskInstance.java
│ │ │ ├── TransitionInstance.java
│ │ │ └── VariableInstance.java
│ │ ├── pvm
│ │ ├── PvmActivity.java
│ │ ├── PvmElement.java
│ │ ├── PvmProcessDefinition.java
│ │ ├── PvmProcessInstance.java
│ │ ├── PvmTransition.java
│ │ ├── event
│ │ │ └── EventConstant.java
│ │ └── impl
│ │ │ ├── AbstractPvmActivity.java
│ │ │ ├── AbstractPvmElement.java
│ │ │ ├── DefaultPvmActivity.java
│ │ │ ├── DefaultPvmProcessDefinition.java
│ │ │ ├── DefaultPvmProcessInstance.java
│ │ │ └── DefaultPvmTransition.java
│ │ ├── service
│ │ ├── command
│ │ │ ├── DeploymentCommandService.java
│ │ │ ├── ExecutionCommandService.java
│ │ │ ├── ProcessCommandService.java
│ │ │ ├── RepositoryCommandService.java
│ │ │ ├── TaskCommandService.java
│ │ │ ├── VariableCommandService.java
│ │ │ └── impl
│ │ │ │ ├── CommonServiceHelper.java
│ │ │ │ ├── DefaultDeploymentCommandService.java
│ │ │ │ ├── DefaultExecutionCommandService.java
│ │ │ │ ├── DefaultProcessCommandService.java
│ │ │ │ ├── DefaultRepositoryCommandService.java
│ │ │ │ ├── DefaultTaskCommandService.java
│ │ │ │ └── DefaultVariableCommandService.java
│ │ ├── param
│ │ │ ├── command
│ │ │ │ ├── BaseCommand.java
│ │ │ │ ├── CreateDeploymentCommand.java
│ │ │ │ └── UpdateDeploymentCommand.java
│ │ │ └── query
│ │ │ │ ├── BaseQueryParam.java
│ │ │ │ ├── DeploymentInstanceQueryParam.java
│ │ │ │ ├── PaginateQueryParam.java
│ │ │ │ ├── PendingTaskQueryParam.java
│ │ │ │ ├── ProcessInstanceQueryParam.java
│ │ │ │ ├── TaskInstanceQueryByAssigneeParam.java
│ │ │ │ └── TaskInstanceQueryParam.java
│ │ └── query
│ │ │ ├── ActivityQueryService.java
│ │ │ ├── DeploymentQueryService.java
│ │ │ ├── ExecutionQueryService.java
│ │ │ ├── ProcessQueryService.java
│ │ │ ├── RepositoryQueryService.java
│ │ │ ├── TaskAssigneeQueryService.java
│ │ │ ├── TaskQueryService.java
│ │ │ ├── VariableQueryService.java
│ │ │ └── impl
│ │ │ ├── DefaultActivityQueryService.java
│ │ │ ├── DefaultDeploymentQueryService.java
│ │ │ ├── DefaultExecutionQueryService.java
│ │ │ ├── DefaultProcessQueryService.java
│ │ │ ├── DefaultRepositoryQueryService.java
│ │ │ ├── DefaultTaskAssigneeQueryService.java
│ │ │ ├── DefaultTaskQueryService.java
│ │ │ └── DefaultVariableQueryService.java
│ │ ├── smart
│ │ ├── CustomExtensionElement.java
│ │ ├── ExecutionListener.java
│ │ ├── Properties.java
│ │ ├── PropertiesElementMarker.java
│ │ ├── Property.java
│ │ ├── PropertyCompositeKey.java
│ │ ├── PropertyCompositeValue.java
│ │ ├── Value.java
│ │ └── parser
│ │ │ ├── ExecutionListenerParser.java
│ │ │ ├── PropertiesParser.java
│ │ │ ├── PropertyParser.java
│ │ │ └── ValueParser.java
│ │ ├── util
│ │ ├── ClassUtil.java
│ │ ├── CompletedFuture.java
│ │ ├── IOUtil.java
│ │ ├── InheritableTaskWithCache.java
│ │ ├── ObjectUtil.java
│ │ ├── ParallelGatewayUtil.java
│ │ └── ThreadPoolUtil.java
│ │ └── xml
│ │ ├── parser
│ │ ├── AbstractElementParser.java
│ │ ├── AttributeParser.java
│ │ ├── BaseXmlParser.java
│ │ ├── ElementParser.java
│ │ ├── ParseContext.java
│ │ └── XmlParserFacade.java
│ │ └── util
│ │ └── XmlParseUtil.java
│ └── test
│ ├── java
│ └── com
│ │ └── alibaba
│ │ └── smart
│ │ └── framework
│ │ └── engine
│ │ ├── comments
│ │ └── parser
│ │ │ └── CommentsTest.java
│ │ ├── extendsion
│ │ └── parser
│ │ │ ├── ExtensionNameSpaceParseTest.java
│ │ │ ├── ExtenstionTest.java
│ │ │ └── engine
│ │ │ ├── ProcessField.java
│ │ │ ├── StringField.java
│ │ │ └── parser
│ │ │ ├── ProcessFieldParser.java
│ │ │ └── StringFieldParser.java
│ │ └── extension
│ │ └── scanner
│ │ ├── A.java
│ │ ├── B.java
│ │ ├── BehaviorInternface.java
│ │ ├── ModelABehavior.java
│ │ ├── ModelAParser.java
│ │ ├── ModelBBehavior.java
│ │ ├── ModelBParser.java
│ │ ├── ParserInternface.java
│ │ ├── Root.java
│ │ └── SimpleAnnotationScannerTest.java
│ └── resources
│ ├── log4j.properties
│ └── process-def
│ ├── callactivity
│ ├── parent-process-parallel.bpmn20.xml
│ ├── sub-process-suspend.bpmn20.xml
│ └── sub-process.bpmn20.xml
│ ├── comments
│ └── comments.bpmn20.xml
│ ├── extend
│ └── extend.bpmn20.xml
│ └── extension
│ ├── camunda.bpmn20.xml
│ └── flowable.bpmn20.xml
├── docs
└── contact
│ ├── group.jpg
│ └── me.jpg
├── extension
├── retry
│ ├── retry-common
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── alibaba
│ │ │ └── smart
│ │ │ └── framework
│ │ │ └── engine
│ │ │ └── retry
│ │ │ ├── RetryExtensionPoint.java
│ │ │ ├── RetryListener.java
│ │ │ ├── impl
│ │ │ ├── DefaultListenerHook.java
│ │ │ ├── DefaultRetryPersistence.java
│ │ │ └── DefaultRetryService.java
│ │ │ ├── instance
│ │ │ └── storage
│ │ │ │ └── RetryRecordStorage.java
│ │ │ ├── model
│ │ │ └── instance
│ │ │ │ ├── DefaultRetryRecordInstance.java
│ │ │ │ └── RetryRecord.java
│ │ │ └── service
│ │ │ └── command
│ │ │ ├── RetryPersistence.java
│ │ │ └── RetryService.java
│ ├── retry-custom
│ │ ├── pom.xml
│ │ └── src
│ │ │ ├── main
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── alibaba
│ │ │ │ └── smart
│ │ │ │ └── framework
│ │ │ │ └── engine
│ │ │ │ └── persister
│ │ │ │ └── custom
│ │ │ │ ├── RetryRecordInstance.java
│ │ │ │ └── service
│ │ │ │ └── CustomRetryRecordStorage.java
│ │ │ └── test
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── alibaba
│ │ │ │ └── smart
│ │ │ │ └── framework
│ │ │ │ └── engine
│ │ │ │ └── retry
│ │ │ │ ├── RetryDelegation.java
│ │ │ │ ├── RetryTest.java
│ │ │ │ └── store
│ │ │ │ └── MemoryRetryRecordStorage.java
│ │ │ └── resources
│ │ │ ├── log4j.properties
│ │ │ └── retry-diagram.bpmn.xml
│ └── retry-mysql
│ │ ├── pom.xml
│ │ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── alibaba
│ │ │ └── smart
│ │ │ └── framework
│ │ │ └── engine
│ │ │ └── persister
│ │ │ └── database
│ │ │ ├── dao
│ │ │ └── RetryRecordDAO.java
│ │ │ ├── entity
│ │ │ └── RetryRecordEntity.java
│ │ │ └── service
│ │ │ └── RelationshipDatabaseRetryRecordStorage.java
│ │ └── resources
│ │ ├── mybatis
│ │ ├── mybatis-config.xml
│ │ └── sqlmap
│ │ │ └── retry_record.xml
│ │ └── sql
│ │ └── retry-schema.sql
└── storage
│ ├── storage-common
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── alibaba
│ │ └── smart
│ │ └── framework
│ │ └── engine
│ │ └── persister
│ │ └── common
│ │ ├── assistant
│ │ └── pojo
│ │ │ └── ThreadExecutionResult.java
│ │ └── constant
│ │ └── StorageConstant.java
│ ├── storage-custom
│ ├── pom.xml
│ ├── smart-engine.lock
│ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── alibaba
│ │ │ │ └── smart
│ │ │ │ └── framework
│ │ │ │ └── engine
│ │ │ │ └── persister
│ │ │ │ ├── custom
│ │ │ │ ├── CustomActivityInstanceStorage.java
│ │ │ │ ├── CustomExecutionInstanceStorage.java
│ │ │ │ ├── CustomProcessInstanceStorage.java
│ │ │ │ ├── CustomTaskAssigneeInstanceStorage.java
│ │ │ │ ├── CustomTaskInstanceStorage.java
│ │ │ │ ├── CustomVariableInstanceStorage.java
│ │ │ │ └── session
│ │ │ │ │ └── PersisterSession.java
│ │ │ │ └── util
│ │ │ │ ├── InstanceSerializer.java
│ │ │ │ ├── InstanceSerializerFacade.java
│ │ │ │ └── InstanceSerializerV1.java
│ │ └── test
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── alibaba
│ │ │ │ └── smart
│ │ │ │ └── framework
│ │ │ │ └── engine
│ │ │ │ ├── common
│ │ │ │ └── expression
│ │ │ │ │ └── evaluator
│ │ │ │ │ └── CustomExpressionEvaluator.java
│ │ │ │ ├── simulation
│ │ │ │ └── ProcessSimulation.java
│ │ │ │ └── test
│ │ │ │ ├── AliPayIdGenerator.java
│ │ │ │ ├── DoNothingLockStrategy.java
│ │ │ │ ├── EndListener.java
│ │ │ │ ├── HelloListener.java
│ │ │ │ ├── ProcessEndListener.java
│ │ │ │ ├── ProcessStartListener.java
│ │ │ │ ├── SimpleFileLockStrategy.java
│ │ │ │ ├── StartListener.java
│ │ │ │ ├── bechmark
│ │ │ │ └── SmartEngineBenchmark.java
│ │ │ │ ├── callcactivity1
│ │ │ │ ├── CallActivityJavaDelegation1.java
│ │ │ │ ├── CallActivityJavaDelegation2.java
│ │ │ │ ├── CallActivityJavaDelegation3.java
│ │ │ │ └── CallActivityParallelGateWayTest1.java
│ │ │ │ ├── callcactivity2
│ │ │ │ ├── CallActivityParallelGateWayTest2.java
│ │ │ │ ├── ParentDelegation1.java
│ │ │ │ ├── SubDelegation1.java
│ │ │ │ └── SubDelegation2.java
│ │ │ │ ├── cases
│ │ │ │ ├── AdvancedExclusvieGatewayProcessTest.java
│ │ │ │ ├── AllServiceTaskJumpFromTest.java
│ │ │ │ ├── BPMNDiagramParserTest.java
│ │ │ │ ├── BasicProcessTest.java
│ │ │ │ ├── CamundaEventTest.java
│ │ │ │ ├── CommonTestCode.java
│ │ │ │ ├── CompatiableOldVersionProcessDefinitionTest.java
│ │ │ │ ├── CustomBaseTestCase.java
│ │ │ │ ├── CustomCallActivityTest.java
│ │ │ │ ├── CustomPropertiesTest.java
│ │ │ │ ├── DefaultSequenceFlowTest.java
│ │ │ │ ├── DelegationAndListenerExecutorExtensionTest.java
│ │ │ │ ├── ExclusiveWithoutGatewayTest.java
│ │ │ │ ├── FirstBasicProcessTest.java
│ │ │ │ ├── MockProcessInstanceTest.java
│ │ │ │ ├── ProcessSimulationTest.java
│ │ │ │ ├── RetryServiceTaskTest.java
│ │ │ │ ├── UserTaskExtensionTest.java
│ │ │ │ └── extensions
│ │ │ │ │ ├── ActivitiDelegationAndExecutionListenerAndValueTest.java
│ │ │ │ │ ├── CamundaDelegationAndExecutionListenerAndValueTest.java
│ │ │ │ │ ├── CompositePropertiesTest.java
│ │ │ │ │ ├── CompositePropertyTest.java
│ │ │ │ │ ├── ExecutionListenerAndValueTest.java
│ │ │ │ │ ├── MultiValueAndHelloListenerTest.java
│ │ │ │ │ └── SmartPropertiesTest.java
│ │ │ │ ├── delegation
│ │ │ │ ├── BasicServiceTaskDelegation.java
│ │ │ │ ├── CommonGatewayDelegation.java
│ │ │ │ ├── CreateOrderDelegation.java
│ │ │ │ ├── ExceptionDelegation.java
│ │ │ │ ├── ExclusiveGatewayDelegation.java
│ │ │ │ ├── ExclusiveTaskDelegation.java
│ │ │ │ ├── MultiValueAndEventListenerDelegation.java
│ │ │ │ ├── OfcMarketPlaceJavaDelegation.java
│ │ │ │ ├── OrchestrationAdapter.java
│ │ │ │ ├── OrchestrationAdapterImplement.java
│ │ │ │ ├── RetryServiceTaskDelegation.java
│ │ │ │ ├── RightJavaDelegation.java
│ │ │ │ ├── ServiceTask0Delegation.java
│ │ │ │ ├── ServiceTask1Delegation.java
│ │ │ │ ├── ServiceTask2Delegation.java
│ │ │ │ ├── SimpleServiceTaskDelegation.java
│ │ │ │ ├── TccTracker.java
│ │ │ │ ├── Tracker.java
│ │ │ │ └── event
│ │ │ │ │ ├── ActivityEndListener.java
│ │ │ │ │ ├── ActivityStartListener.java
│ │ │ │ │ ├── ProcessEndListener.java
│ │ │ │ │ ├── ProcessStartListener.java
│ │ │ │ │ └── TakeEventListener.java
│ │ │ │ ├── demo
│ │ │ │ └── dto
│ │ │ │ │ └── OrderDTO.java
│ │ │ │ ├── jump
│ │ │ │ ├── JumpFreeNode1Test.java
│ │ │ │ └── JumpFreeNode2Test.java
│ │ │ │ ├── mvel
│ │ │ │ └── MvelTest.java
│ │ │ │ ├── orchestration
│ │ │ │ ├── ServiceOrchestrationJavaDelegation.java
│ │ │ │ ├── ServiceOrchestrationTest.java
│ │ │ │ └── SmartEngineFactoryBean.java
│ │ │ │ ├── parallelgateway
│ │ │ │ ├── CallActivityParallelGateWayTest.java
│ │ │ │ ├── EmbeddedParallelGatewayTest.java
│ │ │ │ ├── delegation
│ │ │ │ │ ├── ChildReceiveTaskDelegation.java
│ │ │ │ │ ├── ChildServiceTaskDelegation.java
│ │ │ │ │ ├── ParentReceiveTaskDelegation.java
│ │ │ │ │ └── ParentServiceTaskDelegation.java
│ │ │ │ ├── deprecated
│ │ │ │ │ ├── ParallelGateWayListenerIssueConfiguration.java
│ │ │ │ │ └── ParallelGateWayListenerIssueTest.java
│ │ │ │ ├── multi
│ │ │ │ │ └── thread
│ │ │ │ │ │ └── ConcurrentParallelGatewayTest.java
│ │ │ │ ├── orchestration
│ │ │ │ │ ├── ExceptionOrchestrationDelegation.java
│ │ │ │ │ ├── ServiceOrchestrationParallelGatewayTest.java
│ │ │ │ │ └── delegation
│ │ │ │ │ │ ├── AServiceTaskOrchestrationDelegation.java
│ │ │ │ │ │ ├── BServiceTaskOrchestrationDelegation.java
│ │ │ │ │ │ ├── ServiceTaskTimeoutOrchestrationDelegation.java
│ │ │ │ │ │ ├── ServiceTaskTimeoutOrchestrationDelegationOne.java
│ │ │ │ │ │ └── ServiceTaskTimeoutOrchestrationDelegationTwo.java
│ │ │ │ └── single
│ │ │ │ │ └── thread
│ │ │ │ │ ├── BasicParallelGatewayTest.java
│ │ │ │ │ └── ServiceTaskDelegation.java
│ │ │ │ └── thread
│ │ │ │ └── CountDownTest.java
│ │ │ └── resources
│ │ │ ├── BPMNDiagramParserTest.bpmn.xml
│ │ │ ├── CompositePropertyTest.bpmn.xml
│ │ │ ├── DelegationAndListenerExecutorExtensionTest.xml
│ │ │ ├── EmbeddedParallelGateway.xml
│ │ │ ├── MagicSignalCompositePropertyTest.bpmn.xml
│ │ │ ├── MultiValueAndEventListenerTest.bpmn.xml
│ │ │ ├── ServiceOrchestrationExceptionParallelGatewayTest.xml
│ │ │ ├── ServiceOrchestrationParallelGatewayRaceTimeout.xml
│ │ │ ├── ServiceOrchestrationParallelGatewayRaceTimeoutIgnore.xml
│ │ │ ├── ServiceOrchestrationParallelGatewayRunFirstTest.xml
│ │ │ ├── ServiceOrchestrationParallelGatewayTest.xml
│ │ │ ├── ServiceOrchestrationSkipTimeoutParallelGatewayTest.xml
│ │ │ ├── ServiceOrchestrationTimeoutParallelGatewayTest.xml
│ │ │ ├── activiti.bpmn.xml
│ │ │ ├── advanced-exclusviegateway-process.bpmn.xml
│ │ │ ├── all-retry-servicetask.bpmn.xml
│ │ │ ├── all-simple-servicetask.bpmn.xml
│ │ │ ├── basic-process.bpmn.xml
│ │ │ ├── call-activity1
│ │ │ ├── call_act_parent.bpmn
│ │ │ └── call_act_sub.bpmn
│ │ │ ├── call-activity2
│ │ │ ├── call_act_parent1.bpmn
│ │ │ ├── call_act_sub_1.bpmn
│ │ │ └── call_act_sub_2.bpmn
│ │ │ ├── callactivity-servicetask-process.bpmn20.xml
│ │ │ ├── camunda-event-test.bpmn.xml
│ │ │ ├── camunda.bpmn.xml
│ │ │ ├── child-callactivity-process.bpmn20.xml
│ │ │ ├── child-receivetask-process.bpmn20.xml
│ │ │ ├── child-servicetask-process.bpmn20.xml
│ │ │ ├── compatiable-1.x-test.bpmn.xml
│ │ │ ├── custom-properties.bpmn.xml
│ │ │ ├── default-sequence-flow.bpmn.xml
│ │ │ ├── exclusive-without-gateway.bpmn.xml
│ │ │ ├── execution_listener_and_value_test.bpmn20.xml
│ │ │ ├── first-smart-editor.xml
│ │ │ ├── log4j.properties
│ │ │ ├── mockProcessInstance.bpmn.xml
│ │ │ ├── parent-callactivity-process.bpmn20.xml
│ │ │ ├── parent-process-parallel.bpmn20.xml
│ │ │ ├── simple-process-simulation.bpmn.xml
│ │ │ ├── smart-engine
│ │ │ ├── ServiceTaskTest.bpmn20.xml
│ │ │ ├── jump1.bpmn20.xml
│ │ │ ├── jump2.bpmn20.xml
│ │ │ └── lazada.bpmn.xml
│ │ │ ├── smartPropertiesTest.bpmn.xml
│ │ │ ├── spring
│ │ │ └── service-orchestration-test.xml
│ │ │ ├── subprocess
│ │ │ ├── child.xml
│ │ │ └── parent.xml
│ │ │ ├── test-all-servicetask-parallel-gateway.bpmn20.xml
│ │ │ ├── test-receivetask-parallel-gateway.bpmn20.xml
│ │ │ ├── test-servicetask-parallel-gateway.bpmn20.xml
│ │ │ └── user-task-extension-test.xml
│ └── test.txt
│ └── storage-mysql
│ ├── pom.xml
│ └── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── alibaba
│ │ │ └── smart
│ │ │ └── framework
│ │ │ └── engine
│ │ │ └── persister
│ │ │ └── database
│ │ │ ├── builder
│ │ │ ├── ActivityInstanceBuilder.java
│ │ │ ├── DeploymentInstanceBuilder.java
│ │ │ ├── ExecutionInstanceBuilder.java
│ │ │ ├── ProcessInstanceBuilder.java
│ │ │ ├── TaskAssigneeInstanceBuilder.java
│ │ │ ├── TaskInstanceBuilder.java
│ │ │ └── VariableInstanceBuilder.java
│ │ │ ├── dao
│ │ │ ├── ActivityInstanceDAO.java
│ │ │ ├── DeploymentInstanceDAO.java
│ │ │ ├── ExecutionInstanceDAO.java
│ │ │ ├── ProcessInstanceDAO.java
│ │ │ ├── TaskAssigneeDAO.java
│ │ │ ├── TaskInstanceDAO.java
│ │ │ └── VariableInstanceDAO.java
│ │ │ ├── entity
│ │ │ ├── ActivityInstanceEntity.java
│ │ │ ├── BaseProcessEntity.java
│ │ │ ├── DeploymentInstanceEntity.java
│ │ │ ├── ExecutionInstanceEntity.java
│ │ │ ├── ProcessInstanceEntity.java
│ │ │ ├── TaskAssigneeEntity.java
│ │ │ ├── TaskInstanceEntity.java
│ │ │ └── VariableInstanceEntity.java
│ │ │ └── service
│ │ │ ├── RelationshipDatabaseActivityInstanceStorage.java
│ │ │ ├── RelationshipDatabaseDeploymentInstanceStorage.java
│ │ │ ├── RelationshipDatabaseExecutionInstanceStorage.java
│ │ │ ├── RelationshipDatabaseProcessInstanceStorage.java
│ │ │ ├── RelationshipDatabaseTaskAssigneeInstanceStorage.java
│ │ │ ├── RelationshipDatabaseTaskInstanceStorage.java
│ │ │ └── RelationshipDatabaseVariableInstanceStorage.java
│ └── resources
│ │ ├── mybatis
│ │ ├── mybatis-config.xml
│ │ └── sqlmap
│ │ │ ├── activity_instance.xml
│ │ │ ├── deployment_instance.xml
│ │ │ ├── execution_instance.xml
│ │ │ ├── process_instance.xml
│ │ │ ├── task_assignee_instance.xml
│ │ │ ├── task_instance.xml
│ │ │ └── variable_instance.xml
│ │ └── sql
│ │ ├── index.sql
│ │ ├── schema-h2-only-for-test.sql
│ │ └── schema.sql
│ └── test
│ ├── java
│ └── com
│ │ └── alibaba
│ │ └── smart
│ │ └── framework
│ │ └── engine
│ │ ├── persister
│ │ └── database
│ │ │ └── dao
│ │ │ ├── ActivityInstanceDAOTest.java
│ │ │ ├── ActivityInstanceDAOWithTenantIdTest.java
│ │ │ ├── BaseElementTest.java
│ │ │ ├── DeploymentInstanceDAOTest.java
│ │ │ ├── DeploymentInstanceDAOWithTenantIdTest.java
│ │ │ ├── ExecutionInstanceDAOTest.java
│ │ │ ├── ExecutionInstanceDAOWithTenantIdTest.java
│ │ │ ├── ProcessInstanceDAOTest.java
│ │ │ ├── ProcessInstanceDAOWithTenantIdTest.java
│ │ │ ├── TaskAssigneeInstanceDAOTest.java
│ │ │ ├── TaskAssigneeInstanceDAOWithTenantIdTest.java
│ │ │ ├── TaskInstanceDAOTest.java
│ │ │ ├── TaskInstanceDAOWithTenantIdTest.java
│ │ │ ├── VariableInstanceDAOTest.java
│ │ │ └── VariableInstanceDAOWithTenantIdTest.java
│ │ └── test
│ │ ├── DatabaseBaseTestCase.java
│ │ ├── process
│ │ ├── CommonParallelGatewayTest.java
│ │ ├── CommonParallelGatewayWithTenantIdTest.java
│ │ ├── CompatibleActivitiAndCustomExtensionProcessTest.java
│ │ ├── CompatibleActivitiAndCustomExtensionProcessWithTenantTest.java
│ │ ├── ConcurrentParallelGatewayDBTest.java
│ │ ├── ConcurrentParallelGatewayDBWithTenantIdTest.java
│ │ ├── DataBaseAuditProcessExample.java
│ │ ├── DataBaseAuditProcessWithTenantIdExample.java
│ │ ├── DataBaseCallActivityTest.java
│ │ ├── DataBaseCallActivityWithTenantIdTest.java
│ │ ├── H2ConsoleDebugTest.java
│ │ ├── InclusiveGatewayThreadMultiTest.java
│ │ ├── InclusiveGatewayThreadMultiWithTenantIdTest.java
│ │ ├── InclusiveGatewayWithLoopTest.java
│ │ ├── InclusiveGatewayWithLoopWithTenantIdTest.java
│ │ ├── MixedAuditProcessTest.java
│ │ ├── MixedAuditProcessWithTenantIdTest.java
│ │ ├── MultiInstanceCompatibleAllModelFailFastTest.java
│ │ ├── MultiInstanceCompatibleAllModelFailFastWithTenantIdTest.java
│ │ ├── MultiInstanceCompatibleAllModelPassedTest.java
│ │ ├── MultiInstanceCompatibleAllModelPassedWithTenantIdTest.java
│ │ ├── MultiInstanceCompatibleAnyModelAbortTest.java
│ │ ├── MultiInstanceCompatibleAnyModelAbortWithTenantIdTest.java
│ │ ├── MultiInstanceCompatibleAnyModelFailedFastTest.java
│ │ ├── MultiInstanceCompatibleAnyModelFailedFastWithTenantIdTest.java
│ │ ├── MultiInstanceCompatibleAnyModelPassedTest.java
│ │ ├── MultiInstanceCompatibleAnyModelPassedWithTenantIdTest.java
│ │ ├── MultiInstanceTest.java
│ │ ├── MultiInstanceWithTenantIdTest.java
│ │ ├── MysqlTransactionTest.java
│ │ ├── MysqlTransactionWithTenantIdTest.java
│ │ ├── ParaGatewayUserTaskProcessTest.java
│ │ ├── ParaGatewayUserTaskProcessWithTenantIdTest.java
│ │ ├── ParallelGatewayThreadMultiTest.java
│ │ ├── ParallelGatewayThreadMultiWithTenantIdTest.java
│ │ ├── ParallelGatewayThreadSingleTest.java
│ │ ├── ParalleyGatewayAndCallActivityTest.java
│ │ ├── ParalleyGatewayAndCallActivityWithTenantIdTest.java
│ │ ├── TransactionTest.java
│ │ ├── VariableInstanceAndMultiInstanceTest.java
│ │ ├── bean
│ │ │ ├── Order.java
│ │ │ └── TestUser.java
│ │ ├── delegation
│ │ │ ├── AuditProcessServiceTaskDelegation.java
│ │ │ ├── DataBaseCreateOrderDelegation.java
│ │ │ ├── MyExceptionOrderDelegation.java
│ │ │ ├── ReceiverTaskDelegation.java
│ │ │ ├── ServiceTaskDelegation.java
│ │ │ ├── ThrowExceptionTaskDelegation.java
│ │ │ └── UserTaskTestDelegation.java
│ │ └── helper
│ │ │ ├── CustomExceptioinProcessor.java
│ │ │ ├── CustomVariablePersister.java
│ │ │ ├── DefaultMultiInstanceCounter.java
│ │ │ ├── DoNothingLockStrategy.java
│ │ │ ├── ListReverseTest.java
│ │ │ ├── TimeBasedIdGenerator.java
│ │ │ ├── TransactionHelper.java
│ │ │ ├── dispatcher
│ │ │ ├── DefaultTaskAssigneeDispatcher.java
│ │ │ └── IdAndGroupTaskAssigneeDispatcher.java
│ │ │ └── sequece
│ │ │ └── RandomIdGenerator.java
│ │ └── service
│ │ ├── DeploymentServiceTest.java
│ │ ├── DeploymentServiceWithTenantIdTest.java
│ │ ├── ProcessServiceTest.java
│ │ ├── ProcessServiceWithTenantIdTest.java
│ │ ├── RepositoryServiceTest.java
│ │ ├── RepositoryServiceWithTenantIdTest.java
│ │ ├── SimpleIntegrationTest.java
│ │ ├── SimpleIntegrationWithTenantTest.java
│ │ ├── TaskServiceTest.java
│ │ ├── TaskServiceWithTenantTest.java
│ │ ├── VariableServiceTest.java
│ │ └── VariableServiceWithTenantTest.java
│ └── resources
│ ├── child-callactivity-process.bpmn20.xml
│ ├── compatible-activiti-and-custom-extension-process-test.bpmn20.xml
│ ├── compatible-all-passed.bpmn20.xml
│ ├── compatible-any-abort.bpmn20.xml
│ ├── compatible-any-passed.bpmn20.xml
│ ├── complex
│ ├── child-receiveTaskCallActivity.bpmn20.xml
│ ├── child-serviceTaskCallActivity.bpmn20.xml
│ └── parent-callactivity-process.bpmn20.xml
│ ├── database
│ ├── ComplexEmbeddedParallelGateway.xml
│ ├── InclusiveGatewayAllBranchesTest.xml
│ ├── InclusiveGatewayAllServiceNestedTest.xml
│ ├── InclusiveGatewayAllServiceTaskTest.xml
│ ├── InclusiveGatewayDefaultBranchesTest.xml
│ ├── InclusiveGatewayNestedTest.xml
│ ├── InclusiveGatewayServiceAndReceiveTest.xml
│ ├── InclusiveGatewayServiceAndUserTaskTest.xml
│ ├── InclusiveGatewayUnbalancedTest.xml
│ ├── InclusiveGatewayWithLoopTest.xml
│ ├── ParallelGatewayAllServiceTaskTest.xml
│ ├── ParallelGatewayScenario2Test.xml
│ ├── ParallelGatewayScenario3Test.xml
│ ├── ParallelGatewayScenario4Test.xml
│ ├── ParallelGatewayScenario5Test.xml
│ └── SimpleEmbeddedParallelGateway.xml
│ ├── datasource.properties
│ ├── failed-test-usertask-and-servicetask-exclusive.bpmn20.xml
│ ├── log4j.properties
│ ├── message-queue-receive-task.bpmn20.xml
│ ├── multi-instance-activiti-compatiable-test.bpmn20.xml
│ ├── multi-instance-test.bpmn20.xml
│ ├── mybatis
│ └── mybatis-test-config.xml
│ ├── new-compatiable.bpmn20.xml
│ ├── parallel-gateway-usertask-process.bpmn.xml
│ ├── parent-callactivity-process.bpmn20.xml
│ ├── spring
│ └── application-test.xml
│ ├── test-receivetask-parallel-gateway.bpmn20.xml
│ ├── test-usertask-and-servicetask-exclusive.bpmn20.xml
│ ├── user-task-id-and-group-test.bpmn20.xml
│ └── usertask-servicetask-rollback.bpmn20.xml
└── pom.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | *.class
3 | *.classpath
4 | *.project
5 | *.iml
6 | *.idea
7 | .idea
8 | *.swp
9 | *.swo
10 | bin
11 | .settings/
12 | test-output/
13 | src/generated/*
14 | logs/
15 | .DS_Store
16 | pom.xml.versionsBackup
17 | release.properties
18 | **.xml.releaseBackup
19 |
20 | # VS Code
21 | .vscode/
22 |
23 |
24 | #lock file using for test
25 | smart-engine.lock
--------------------------------------------------------------------------------
/README-zh.md:
--------------------------------------------------------------------------------
1 | # SmartEngine
2 |
3 | SmartEngine 是一款轻量级业务编排引擎,在阿里巴巴集团内部广泛使用。
4 | 它可用于微服务架构中的多服务编排,以高性能、低存储成本的方式启动/触发流程实例,同时也能应用于传统审批流程场景。
5 |
6 | [English](./README.md)
7 |
8 | ## 设计理念
9 |
10 | 0. KISS 原则(保持简单)
11 | 1. 标准化:遵循 BPMN2.0 规范,统一领域语言
12 | 2. 可扩展性:支持解析器、行为、存储、用户集成等模块的灵活扩展
13 | 3. 高性能:针对简单流程场景提供优化方案,提升性能并降低存储成本
14 | 4. 低依赖:从设计之初就极力避免 JAR 地狱问题
15 |
16 | ## 核心特性
17 |
18 | 0. 采用 CQRS 风格的 API 来启动、触发、查询流程实例、任务和活动
19 | 1. 支持基础 BPMN 元素:开始事件/结束事件/顺序流/独占网关/并行网关/包容网关/服务任务/接收任务
20 | 2. 针对简单流程场景提供性能优化和存储成本降低方案
21 | 3. 其他功能:流程跳转、变量持久化、任务分配器、会签
22 |
23 | ## 文档
24 |
25 | - [文档首页](https://github.com/alibaba/SmartEngine/wiki)
26 |
27 | ## 开源协议
28 |
29 | SmartEngine 采用 Apache 2.0 协议开源
30 |
31 | ## 联系我们
32 |
33 | | 微信交流群 | 个人微信号 |
34 | |-------------------------------------------------------------|-------------------------------------------------------------|
35 | |
|
|
36 |
37 | ## 致谢
38 |
39 | 受 Activiti、MyBatis、Netty 等项目启发
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/annotation/Experiment.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * Created by 高海军 帝奇 74394 on 2019-11-12 16:07.
11 | *
12 | * 用于标记这段代码可能是实验特性.
13 | */
14 | @Target({ElementType.METHOD})
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Documented
17 | public @interface Experiment {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/annotation/Retryable.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.annotation;
2 |
3 | import java.lang.annotation.*;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2019-11-12 16:07.
7 | *
8 | *
9 | */
10 | @Target({ElementType.TYPE})
11 | @Retention(RetentionPolicy.RUNTIME)
12 | @Documented
13 | public @interface Retryable {
14 |
15 | int maxAttempts() default 3;
16 |
17 |
18 | // delay 1000ms
19 | long delay() default 1000;
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/annotation/WorkAround.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * Created by 高海军 帝奇 74394 on 2019-11-12 16:07.
11 | *
12 | * 用于标记这段代码可能是临时性方案,目前特别好的处理方法。相当于 WONT FIX .
13 | */
14 | @Target({ElementType.METHOD})
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Documented
17 | public @interface WorkAround {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/ActivityBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.pvm.PvmActivity;
5 |
6 | /**
7 | * @author 高海军 帝奇 2016.11.11
8 | * @author ettear 2016.04.13
9 | */
10 | public interface ActivityBehavior {
11 |
12 |
13 | /**
14 | * 仅创建 ei 等相关对象,
15 | * @param context
16 | * @param pvmActivity
17 | * @return
18 | */
19 | boolean enter(ExecutionContext context, PvmActivity pvmActivity);
20 |
21 | /**
22 | *
23 | * 更新 ei 对象,
24 | * @param context
25 | * @param pvmActivity
26 | * @return
27 | */
28 | void execute(ExecutionContext context, PvmActivity pvmActivity);
29 |
30 | /**
31 | * 在 leave 时,判断如何创建后续节点
32 | * @param context
33 | * @param pvmActivity
34 | * @return
35 | */
36 | void leave(ExecutionContext context, PvmActivity pvmActivity);
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/TransitionBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.model.assembly.Transition;
5 |
6 | /**
7 | * @author 高海军 帝奇 2016.11.11
8 | * @author ettear 2016.04.13
9 | */
10 | public interface TransitionBehavior {
11 |
12 | boolean match(ExecutionContext context, Transition model);
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/base/AbstractTransitionBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior.base;
2 |
3 | import com.alibaba.smart.framework.engine.behavior.TransitionBehavior;
4 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
5 | import com.alibaba.smart.framework.engine.model.assembly.Transition;
6 | import com.alibaba.smart.framework.engine.pvm.PvmTransition;
7 |
8 | /**
9 | * @author 高海军 帝奇 2016.11.11
10 | * @author ettear 2016.04.13
11 | */
12 | public abstract class AbstractTransitionBehavior implements TransitionBehavior {
13 |
14 | private PvmTransition runtimeTransition;
15 |
16 |
17 |
18 | @Override
19 | public boolean match(ExecutionContext context, Transition model) {
20 | return false;
21 | }
22 |
23 |
24 |
25 | protected T getModel() {
26 | return (T)this.runtimeTransition.getModel();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/impl/BusinessRuleTaskBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior.impl;
2 |
3 | import com.alibaba.smart.framework.engine.behavior.base.AbstractActivityBehavior;
4 | import com.alibaba.smart.framework.engine.bpmn.assembly.task.BusinessRuleTask;
5 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
6 | import com.alibaba.smart.framework.engine.extension.constant.ExtensionConstant;
7 |
8 | import org.slf4j.Logger;
9 | import org.slf4j.LoggerFactory;
10 |
11 | @ExtensionBinding(group = ExtensionConstant.ACTIVITY_BEHAVIOR, bindKey = BusinessRuleTask.class)
12 | /**
13 | * @author zilong.jiangzl 2020-07-17
14 | */
15 | public class BusinessRuleTaskBehavior extends AbstractActivityBehavior {
16 |
17 | private static final Logger LOGGER = LoggerFactory.getLogger(BusinessRuleTaskBehavior.class);
18 |
19 | public BusinessRuleTaskBehavior() {
20 | super();
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/impl/ManualTaskBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior.impl;
2 |
3 | import com.alibaba.smart.framework.engine.behavior.base.AbstractActivityBehavior;
4 | import com.alibaba.smart.framework.engine.bpmn.assembly.task.ManualTask;
5 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
6 | import com.alibaba.smart.framework.engine.extension.constant.ExtensionConstant;
7 |
8 | import org.slf4j.Logger;
9 | import org.slf4j.LoggerFactory;
10 |
11 | @ExtensionBinding(group = ExtensionConstant.ACTIVITY_BEHAVIOR, bindKey = ManualTask.class)
12 | /**
13 | * @author zilong.jiangzl 2020-07-17
14 | */
15 | public class ManualTaskBehavior extends AbstractActivityBehavior {
16 |
17 | private static final Logger LOGGER = LoggerFactory.getLogger(ManualTaskBehavior.class);
18 |
19 | public ManualTaskBehavior() {
20 | super();
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/impl/ReceiveTaskBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior.impl;
2 |
3 | import com.alibaba.smart.framework.engine.behavior.base.AbstractActivityBehavior;
4 | import com.alibaba.smart.framework.engine.bpmn.assembly.task.ReceiveTask;
5 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
6 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
7 | import com.alibaba.smart.framework.engine.extension.constant.ExtensionConstant;
8 | import com.alibaba.smart.framework.engine.pvm.PvmActivity;
9 |
10 | @ExtensionBinding(group = ExtensionConstant.ACTIVITY_BEHAVIOR, bindKey = ReceiveTask.class)
11 | public class ReceiveTaskBehavior extends AbstractActivityBehavior {
12 |
13 | public ReceiveTaskBehavior() {
14 | super();
15 | }
16 |
17 | @Override
18 | public boolean enter(ExecutionContext context, PvmActivity pvmActivity) {
19 |
20 | super.enter(context, pvmActivity);
21 |
22 | return true;
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/impl/ScriptTaskBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior.impl;
2 |
3 | import com.alibaba.smart.framework.engine.behavior.base.AbstractActivityBehavior;
4 | import com.alibaba.smart.framework.engine.bpmn.assembly.task.ScriptTask;
5 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
6 | import com.alibaba.smart.framework.engine.extension.constant.ExtensionConstant;
7 |
8 | import org.slf4j.Logger;
9 | import org.slf4j.LoggerFactory;
10 |
11 | @ExtensionBinding(group = ExtensionConstant.ACTIVITY_BEHAVIOR, bindKey = ScriptTask.class)
12 | /**
13 | * @author zilong.jiangzl 2020-07-17
14 | */
15 | public class ScriptTaskBehavior extends AbstractActivityBehavior {
16 |
17 | private static final Logger LOGGER = LoggerFactory.getLogger(ScriptTaskBehavior.class);
18 |
19 | public ScriptTaskBehavior() {
20 | super();
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/impl/SendTaskBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior.impl;
2 |
3 | import com.alibaba.smart.framework.engine.behavior.base.AbstractActivityBehavior;
4 | import com.alibaba.smart.framework.engine.bpmn.assembly.task.SendTask;
5 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
6 | import com.alibaba.smart.framework.engine.extension.constant.ExtensionConstant;
7 |
8 | import org.slf4j.Logger;
9 | import org.slf4j.LoggerFactory;
10 |
11 | @ExtensionBinding(group = ExtensionConstant.ACTIVITY_BEHAVIOR, bindKey = SendTask.class)
12 | /**
13 | * @author zilong.jiangzl 2020-07-17
14 | */
15 | public class SendTaskBehavior extends AbstractActivityBehavior {
16 |
17 | private static final Logger LOGGER = LoggerFactory.getLogger(SendTaskBehavior.class);
18 |
19 | public SendTaskBehavior() {
20 | super();
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/impl/ServiceTaskBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior.impl;
2 |
3 | import com.alibaba.smart.framework.engine.behavior.base.AbstractActivityBehavior;
4 | import com.alibaba.smart.framework.engine.bpmn.assembly.task.ServiceTask;
5 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
6 | import com.alibaba.smart.framework.engine.extension.constant.ExtensionConstant;
7 |
8 | import org.slf4j.Logger;
9 | import org.slf4j.LoggerFactory;
10 |
11 | @ExtensionBinding(group = ExtensionConstant.ACTIVITY_BEHAVIOR, bindKey = ServiceTask.class)
12 | public class ServiceTaskBehavior extends AbstractActivityBehavior {
13 |
14 | private static final Logger LOGGER = LoggerFactory.getLogger(ServiceTaskBehavior.class);
15 |
16 |
17 | //public ServiceTaskBehavior(ExtensionPointRegistry extensionPointRegistry, PvmActivity runtimeActivity) {
18 | // super(extensionPointRegistry, runtimeActivity);
19 | //}
20 |
21 | public ServiceTaskBehavior() {
22 | super();
23 | }
24 |
25 |
26 |
27 |
28 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/behavior/impl/TaskBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.behavior.impl;
2 |
3 | import com.alibaba.smart.framework.engine.behavior.base.AbstractActivityBehavior;
4 | import com.alibaba.smart.framework.engine.bpmn.assembly.task.Task;
5 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
6 | import com.alibaba.smart.framework.engine.extension.constant.ExtensionConstant;
7 | import org.slf4j.Logger;
8 | import org.slf4j.LoggerFactory;
9 |
10 | @ExtensionBinding(group = ExtensionConstant.ACTIVITY_BEHAVIOR, bindKey = Task.class)
11 | public class TaskBehavior extends AbstractActivityBehavior {
12 |
13 | private static final Logger LOGGER = LoggerFactory.getLogger(TaskBehavior.class);
14 |
15 |
16 |
17 |
18 | public TaskBehavior() {
19 | super();
20 | }
21 |
22 |
23 |
24 |
25 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/artifacts/Association.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.artifacts;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | import lombok.Data;
9 |
10 | /**
11 | * @author guoxing 2020年11月24日14:07:14
12 | */
13 | @Data
14 | public class Association implements NoneIdBasedElement {
15 |
16 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE,
17 | "association");
18 | private static final long serialVersionUID = 6357539757300185621L;
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/artifacts/Category.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.artifacts;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | import lombok.Data;
9 |
10 | /**
11 | * @author guoxing 2020年12月14日13:47:49
12 | */
13 | @Data
14 | public class Category implements NoneIdBasedElement {
15 |
16 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE,
17 | "category");
18 | private static final long serialVersionUID = 6357539757300185621L;
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/artifacts/Group.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.artifacts;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | import lombok.Data;
9 |
10 | /**
11 | * @author guoxing 2020年12月14日13:47:49
12 | */
13 | @Data
14 | public class Group implements NoneIdBasedElement {
15 |
16 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE,
17 | "group");
18 | private static final long serialVersionUID = 6357539757300185621L;
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/artifacts/TextAnnotation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.artifacts;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | import lombok.Data;
9 |
10 | /**
11 | * @author guoxing 2020年11月24日14:07:14
12 | */
13 | @Data
14 | public class TextAnnotation implements NoneIdBasedElement {
15 |
16 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE,
17 | "textAnnotation");
18 | private static final long serialVersionUID = -143532614365524757L;
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/callactivity/CallActivity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.callactivity;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractActivity;
7 |
8 | import lombok.Data;
9 | import lombok.EqualsAndHashCode;
10 |
11 | /**
12 | *
13 | * @author 高海军 帝奇 74394
14 | * @date 2017 May 14:30
15 | */
16 |
17 | @EqualsAndHashCode(callSuper = true)
18 | @Data
19 | public class CallActivity extends AbstractActivity {
20 |
21 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "callActivity");
22 |
23 | private String calledElement;
24 |
25 | private String calledElementVersion;
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/common/Documentation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.common;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2017 August 10:02.
10 | */
11 | public class Documentation implements NoneIdBasedElement {
12 |
13 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "documentation");
14 |
15 | private static final long serialVersionUID = -2660788294142169268L;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/common/Incoming.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.common;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2017 August 10:02.
10 | */
11 | public class Incoming implements NoneIdBasedElement {
12 |
13 |
14 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "incoming");
15 |
16 | private static final long serialVersionUID = -2660788294142169268L;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/common/Outgoing.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.common;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2017 August 10:02.
10 | */
11 | public class Outgoing implements NoneIdBasedElement {
12 |
13 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "outgoing");
14 |
15 | private static final long serialVersionUID = -2660788294142169268L;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/diagram/Diagram.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.diagram;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2017 August 10:02.
10 | */
11 | public class Diagram implements NoneIdBasedElement {
12 |
13 | public final static QName qtype = new QName(BpmnNameSpaceConstant.BPMNDI_NAME_SPACE, "BPMNDiagram");
14 |
15 | private static final long serialVersionUID = -2660788294142169268L;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/event/AbstractEvent.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.event;
2 |
3 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractActivity;
4 |
5 | /**
6 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
7 | */
8 | public abstract class AbstractEvent extends AbstractActivity {
9 |
10 | private static final long serialVersionUID = 5371998393204140551L;
11 | }
12 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/event/EndEvent.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.event;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 |
7 | import lombok.Data;
8 | import lombok.EqualsAndHashCode;
9 |
10 | /**
11 | * @author 高海军 帝奇 Apr 14, 2016 2:51:07 PM
12 | */
13 | @EqualsAndHashCode(callSuper = true)
14 | @Data
15 | public class EndEvent extends AbstractEvent {
16 |
17 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "endEvent");
18 |
19 | private static final long serialVersionUID = 3529827842581828898L;
20 |
21 | private String className;
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/event/StartEvent.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.event;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 |
7 | import lombok.Data;
8 | import lombok.EqualsAndHashCode;
9 |
10 | /**
11 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
12 | */
13 | @EqualsAndHashCode(callSuper = true)
14 | @Data
15 | public class StartEvent extends AbstractEvent {
16 |
17 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "startEvent");
18 |
19 | private static final long serialVersionUID = 8769494440379002970L;
20 |
21 | @Override
22 | public boolean isStartActivity() {
23 | return true;
24 | }
25 |
26 | @Override
27 | public String toString() {
28 | return super.getId();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/expression/ConditionExpressionImpl.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.expression;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.ConditionExpression;
7 |
8 | import lombok.Data;
9 |
10 | /**
11 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
12 | */
13 | @Data
14 | public class ConditionExpressionImpl implements ConditionExpression {
15 |
16 |
17 | private static final long serialVersionUID = -6152070683207905381L;
18 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "conditionExpression");
19 |
20 | private String expressionType;
21 | private String expressionContent;
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/gateway/AbstractGateway.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.gateway;
2 |
3 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractActivity;
4 |
5 | /**
6 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
7 | */
8 | public abstract class AbstractGateway extends AbstractActivity {
9 |
10 | /**
11 | *
12 | */
13 | private static final long serialVersionUID = 2096892589768688904L;
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/gateway/ExclusiveGateway.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.gateway;
2 | import javax.xml.namespace.QName;
3 |
4 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
5 |
6 | import lombok.Data;
7 | import lombok.EqualsAndHashCode;
8 |
9 | /**
10 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
11 | */
12 |
13 | @Data
14 | @EqualsAndHashCode(callSuper = true)
15 | public class ExclusiveGateway extends AbstractGateway {
16 |
17 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "exclusiveGateway");
18 | /**
19 | *
20 | */
21 | private static final long serialVersionUID = 5754815434014251702L;
22 |
23 | @Override
24 | public String toString() {
25 | return super.getId();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/gateway/InclusiveGateway.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.gateway;
2 |
3 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
4 | import lombok.Data;
5 | import lombok.EqualsAndHashCode;
6 |
7 | import javax.xml.namespace.QName;
8 |
9 | /**
10 | * @author 高海军 帝奇 Apr 24, 2024 09:25:01 AM
11 | */
12 |
13 | @Data
14 | @EqualsAndHashCode(callSuper = true)
15 | public class InclusiveGateway extends AbstractGateway {
16 |
17 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "inclusiveGateway");
18 | /**
19 | *
20 | */
21 | private static final long serialVersionUID = 5754815434014251702L;
22 |
23 | @Override
24 | public String toString() {
25 | return super.getId();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/gateway/ParallelGateway.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.gateway;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 |
7 | import lombok.Data;
8 | import lombok.EqualsAndHashCode;
9 |
10 | /**
11 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
12 | */
13 | @EqualsAndHashCode(callSuper = true)
14 | @Data
15 | public class ParallelGateway extends AbstractGateway {
16 |
17 | private static final long serialVersionUID = 4234776128556310813L;
18 |
19 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "parallelGateway");
20 |
21 | @Override
22 | public String toString() {
23 | return super.getId();
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/multi/instance/CompletionCondition.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.multi.instance;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.ConditionExpression;
7 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
8 |
9 | import lombok.Data;
10 |
11 | /**
12 | * Created by 高海军 帝奇 74394 on 2017 September 21:27.
13 | */
14 |
15 | @Data
16 | public class CompletionCondition implements NoneIdBasedElement {
17 | public final static String ACTION_ABORT="abort";
18 | public final static String ACTION_CONTINUE="continue";
19 |
20 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "completionCondition");
21 | private String action;
22 | private ConditionExpression expression;
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/multi/instance/InputDataItem.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.multi.instance;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | /**
9 | * @author ettear
10 | * Created by ettear on 16/10/2017.
11 | */
12 | public class InputDataItem implements NoneIdBasedElement {
13 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "inputDataItem");
14 |
15 | private String name;
16 |
17 | public String getName() {
18 | return name;
19 | }
20 |
21 | public void setName(String name) {
22 | this.name = name;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/multi/instance/LoopCardinality.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.multi.instance;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.ConditionExpression;
7 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
8 |
9 | /**
10 | * @author ettear
11 | * Created by ettear on 15/10/2017.
12 | */
13 | public class LoopCardinality implements NoneIdBasedElement {
14 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "loopCardinality");
15 |
16 | private ConditionExpression cardinalityExpression;
17 |
18 | public ConditionExpression getCardinalityExpression() {
19 | return cardinalityExpression;
20 | }
21 |
22 | public void setCardinalityExpression(
23 | ConditionExpression cardinalityExpression) {
24 | this.cardinalityExpression = cardinalityExpression;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/multi/instance/LoopDataInputRef.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.multi.instance;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | /**
9 | * @author ettear
10 | * Created by ettear on 16/10/2017.
11 | */
12 | public class LoopDataInputRef implements NoneIdBasedElement {
13 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "loopDataInputRef");
14 | private String reference;
15 |
16 | public String getReference() {
17 | return reference;
18 | }
19 |
20 | public void setReference(String reference) {
21 | this.reference = reference;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/multi/instance/MultiInstanceLoopCharacteristics.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.multi.instance;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.ConditionExpression;
7 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
8 |
9 | import lombok.Data;
10 |
11 | /**
12 | * Created by 高海军 帝奇 74394 on 2017 September 21:03.
13 | */
14 |
15 | @Data
16 | public class MultiInstanceLoopCharacteristics implements NoneIdBasedElement {
17 |
18 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "multiInstanceLoopCharacteristics");
19 |
20 | private boolean sequential;
21 |
22 | private ConditionExpression completionCondition;
23 | private ConditionExpression abortCondition;
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/process/ProcessDefinitionSourceImpl.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.process;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import javax.xml.namespace.QName;
7 |
8 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
9 | import com.alibaba.smart.framework.engine.model.assembly.ProcessDefinition;
10 | import com.alibaba.smart.framework.engine.model.assembly.ProcessDefinitionSource;
11 |
12 | import lombok.Data;
13 |
14 | @Data
15 | public class ProcessDefinitionSourceImpl implements ProcessDefinitionSource {
16 |
17 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "definitions");
18 |
19 | private static final long serialVersionUID = -7973338663278156625L;
20 |
21 | private List processDefinitionList = new ArrayList();
22 |
23 | private String tenantId;
24 |
25 | @Override
26 | public ProcessDefinition getFirstProcessDefinition() {
27 | return processDefinitionList.get(0);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/task/BusinessRuleTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.task;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractTask;
7 |
8 | import lombok.Data;
9 | import lombok.EqualsAndHashCode;
10 |
11 | /**
12 | * @author zilong.jiangzl 2020-07-17
13 | */
14 | @EqualsAndHashCode(callSuper = true)
15 | @Data
16 | public class BusinessRuleTask extends AbstractTask {
17 |
18 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "businessRuleTask");
19 | private static final long serialVersionUID = -8909338035013543508L;
20 |
21 | @Override
22 | public String toString() {
23 | return super.getId();
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/task/ManualTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.task;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractTask;
7 |
8 | import lombok.Data;
9 | import lombok.EqualsAndHashCode;
10 |
11 | /**
12 | * @author zilong.jiangzl 2020-07-17
13 | */
14 | @EqualsAndHashCode(callSuper = true)
15 | @Data
16 | public class ManualTask extends AbstractTask {
17 |
18 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "manualTask");
19 | private static final long serialVersionUID = 2130902428481945847L;
20 |
21 | @Override
22 | public String toString() {
23 | return super.getId();
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/task/ReceiveTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.task;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractTask;
7 |
8 | import lombok.Data;
9 | import lombok.EqualsAndHashCode;
10 |
11 | @EqualsAndHashCode(callSuper = true)
12 | @Data
13 | public class ReceiveTask extends AbstractTask {
14 |
15 | /**
16 | *
17 | */
18 | private static final long serialVersionUID = 5926063576480176197L;
19 |
20 |
21 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "receiveTask");
22 |
23 | @Override
24 | public String toString() {
25 | return super.getId();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/task/ScriptTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.task;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractTask;
7 |
8 | import lombok.Data;
9 | import lombok.EqualsAndHashCode;
10 |
11 | /**
12 | * @author zilong.jiangzl 2020-07-17
13 | */
14 | @EqualsAndHashCode(callSuper = true)
15 | @Data
16 | public class ScriptTask extends AbstractTask {
17 |
18 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "scriptTask");
19 | private static final long serialVersionUID = 2155118199015424897L;
20 |
21 | @Override
22 | public String toString() {
23 | return super.getId();
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/task/SendTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.task;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractTask;
7 |
8 | /**
9 | * @author zilong.jiangzl 2020-07-17
10 | */
11 | public class SendTask extends AbstractTask {
12 |
13 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "sendTask");
14 | private static final long serialVersionUID = 4322119220754998002L;
15 |
16 | @Override
17 | public String toString() {
18 | return super.getId();
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/task/ServiceTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.task;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractTask;
7 |
8 | import lombok.Data;
9 | import lombok.EqualsAndHashCode;
10 |
11 | /**
12 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
13 | */
14 | @EqualsAndHashCode(callSuper = true)
15 | @Data
16 | public class ServiceTask extends AbstractTask {
17 |
18 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "serviceTask");
19 | private static final long serialVersionUID = 2900871220232200586L;
20 |
21 |
22 |
23 | @Override
24 | public String toString() {
25 | return super.getId();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/task/Task.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.task;
2 |
3 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
4 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractTask;
5 | import lombok.Data;
6 | import lombok.EqualsAndHashCode;
7 |
8 | import javax.xml.namespace.QName;
9 |
10 | /**
11 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
12 | */
13 | @EqualsAndHashCode(callSuper = true)
14 | @Data
15 | public class Task extends AbstractTask {
16 |
17 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "task");
18 | private static final long serialVersionUID = 2900871220232200586L;
19 |
20 |
21 |
22 | @Override
23 | public String toString() {
24 | return super.getId();
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/assembly/task/UserTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.assembly.task;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.bpmn.assembly.multi.instance.MultiInstanceLoopCharacteristics;
6 | import com.alibaba.smart.framework.engine.bpmn.constant.BpmnNameSpaceConstant;
7 | import com.alibaba.smart.framework.engine.model.assembly.impl.AbstractTask;
8 |
9 | import lombok.Data;
10 | import lombok.EqualsAndHashCode;
11 |
12 | /**
13 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
14 | */
15 | @EqualsAndHashCode(callSuper = true)
16 | @Data
17 | public class UserTask extends AbstractTask {
18 |
19 | private static final long serialVersionUID = 2241766485621486315L;
20 |
21 |
22 | public final static QName qtype = new QName(BpmnNameSpaceConstant.NAME_SPACE, "userTask");
23 |
24 | private MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics;
25 |
26 | @Override
27 | public String toString() {
28 | return super.getId();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/behavior/gateway/tree/ActivityTreeNode.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.behavior.gateway.tree;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 |
7 | public class ActivityTreeNode {
8 | private String activityId;
9 | private List children;
10 | private ActivityTreeNode parent;
11 |
12 | public ActivityTreeNode(String activityId) {
13 | this.activityId = activityId;
14 | this.children = new ArrayList<>();
15 | this.parent = null;
16 | }
17 |
18 | public String getActivityId() {
19 | return activityId;
20 | }
21 |
22 | public List getChildren() {
23 | return children;
24 | }
25 |
26 | public ActivityTreeNode getParent() {
27 | return parent;
28 | }
29 |
30 | public void setParent(ActivityTreeNode parent) {
31 | this.parent = parent;
32 | }
33 |
34 | public void addChild(ActivityTreeNode child) {
35 | children.add(child);
36 | child.setParent(this);
37 | }
38 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/bpmn/constant/BpmnNameSpaceConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.bpmn.constant;
2 |
3 | public interface BpmnNameSpaceConstant {
4 |
5 | String NAME_SPACE = "http://www.omg.org/spec/BPMN/20100524/MODEL";
6 |
7 | String BPMNDI_NAME_SPACE = "http://www.omg.org/spec/BPMN/20100524/DI";
8 |
9 | /**
10 | * camunda 命名空间
11 | */
12 | String CAMUNDA_NAME_SPACE = "http://camunda.org/schema/1.0/bpmn";
13 | /**
14 | * flowable
15 | */
16 | String FLOWABLE_NAME_SPACE = "http://flowable.org/bpmn";
17 | /**
18 | * activiti
19 | */
20 | String ACTIVITI_NAME_SPACE = "http://activiti.org/bpmn";
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/common/expression/evaluator/ExpressionEvaluator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.common.expression.evaluator;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2017 February 15:43.
7 | */
8 | public interface ExpressionEvaluator {
9 | Object eval(String expression, Map vars, boolean needCached);
10 | }
11 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/common/expression/evaluator/MvelExpressionEvaluator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.common.expression.evaluator;
2 |
3 | import java.util.Map;
4 |
5 | import com.alibaba.smart.framework.engine.common.util.MvelUtil;
6 |
7 | /**
8 | * Created by 高海军 帝奇 74394 on 2017 February 15:51.
9 | */
10 | public class MvelExpressionEvaluator implements ExpressionEvaluator {
11 |
12 | @Override
13 | public Object eval(String expression, Map vars,boolean needCached) {
14 | return MvelUtil.eval(expression,vars, needCached);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/common/expression/evaluator/TFormalExpressionExpressionEvaluator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.common.expression.evaluator;
2 |
3 | /**
4 | * @author ettear
5 | * Created by ettear on 15/10/2017.
6 | */
7 | //兼容 Activiti
8 | public class TFormalExpressionExpressionEvaluator extends MvelExpressionEvaluator {
9 | }
10 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/common/util/CollectionUtil.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.common.util;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Collection;
5 | import java.util.List;
6 |
7 | /**
8 | * Created by 高海军 帝奇 74394 on 2018 November 16:20.
9 | */
10 | public abstract class CollectionUtil {
11 |
12 | public static List newArrayList (){
13 | return new ArrayList();
14 | }
15 |
16 |
17 | public static boolean isNotEmpty(Collection collection){
18 | return null != collection && !collection.isEmpty();
19 | }
20 |
21 | public static boolean isEmpty(Collection collection){
22 | return !isNotEmpty(collection);
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/common/util/DateUtil.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.common.util;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2016 November 17:18.
7 | */
8 | public abstract class DateUtil {
9 |
10 | public static Date getCurrentDate() {
11 | return new Date();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/common/util/IdAndVersionUtil.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.common.util;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-11-17 15:55.
5 | */
6 | public abstract class IdAndVersionUtil {
7 |
8 | public static String buildProcessDefinitionKey(String processDefinitionId, String version) {
9 |
10 | StringBuilder uriBuilder = new StringBuilder();
11 | uriBuilder.append(processDefinitionId);
12 | uriBuilder.append(":").append(version);
13 |
14 | return uriBuilder.toString();
15 | }
16 |
17 | public static String buildProcessDefinitionUniqueKey(String processDefinitionId, String version, String tenantId) {
18 |
19 | if (StringUtil.isEmpty(tenantId)) {
20 | return buildProcessDefinitionKey(processDefinitionId, version);
21 | } else {
22 | return buildProcessDefinitionKey(processDefinitionId, version) + ":" + tenantId;
23 | }
24 | }
25 |
26 |
27 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/common/util/MapUtil.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.common.util;
2 |
3 | import java.util.HashMap;
4 | import java.util.LinkedHashMap;
5 | import java.util.Map;
6 |
7 | public class MapUtil {
8 |
9 | public static LinkedHashMap newLinkedHashMap (){
10 | return new LinkedHashMap();
11 | }
12 |
13 | public static HashMap newHashMap (){
14 | return new HashMap();
15 | }
16 |
17 | public static boolean isNotEmpty(Map map) {
18 | return null != map && !map.isEmpty();
19 | }
20 |
21 | public static boolean isEmpty(Map map) {
22 | return !isNotEmpty(map);
23 | }
24 |
25 | public static Object safeGet(Map map,String key){
26 | if (null == map) {
27 | return null;
28 | }
29 | return map.get(key);
30 | }
31 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/DelegationExecutor.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 |
4 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
5 | import com.alibaba.smart.framework.engine.model.assembly.Activity;
6 |
7 | /**
8 | * Created by 高海军 帝奇 74394 on 2019 December 14:45.
9 | */
10 | public interface DelegationExecutor {
11 |
12 | void execute(ExecutionContext context,Activity activity);
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/ExceptionProcessor.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | /**
4 | *
5 | */
6 | public interface ExceptionProcessor {
7 |
8 | void process(Exception exception,Object context);
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/IdGenerator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.Instance;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2017 February 23:17.
7 | */
8 | public interface IdGenerator {
9 |
10 | void generate(Instance instance);
11 | }
12 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/InstanceAccessor.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | /**
4 | *
5 | * @author 高海军 帝奇 74394
6 | * @date 2017 May 20:52
7 | */
8 | public interface InstanceAccessor {
9 |
10 | Object access(String classNameOrBeanName);
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/ListenerExecutor.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.model.assembly.ExtensionElementContainer;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 |
7 | /**
8 | * Created by 高海军 帝奇 74394 on 2020 August 17:42.
9 | */
10 | public interface ListenerExecutor {
11 |
12 | void execute(EventConstant event, ExtensionElementContainer extensionElementContainer, ExecutionContext context);
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/LockStrategy.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.exception.LockException;
5 |
6 | /**
7 | * Created by 高海军 帝奇 74394 on 2017 October 06:20.
8 | * @Deprecated The granularity of the LockStrategy is too small,should NOT use anymore.
9 | */
10 |
11 | @Deprecated
12 | public interface LockStrategy {
13 |
14 | void tryLock(String processInstanceId, ExecutionContext context) throws LockException;
15 |
16 | void unLock(String processInstanceId, ExecutionContext context) throws LockException;
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/MultiInstanceCounter.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | import com.alibaba.smart.framework.engine.SmartEngine;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2017 October.14 10:41.
7 | */
8 | public interface MultiInstanceCounter {
9 |
10 | Integer countPassedTaskInstanceNumber(String processInstanceId, String activityInstanceId,
11 | SmartEngine smartEngine);
12 |
13 | Integer countRejectedTaskInstanceNumber(String processInstanceId, String activityInstanceId,
14 | SmartEngine smartEngine);
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/OptionContainer.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2020-02-15 21:40.
5 | */
6 | public interface OptionContainer {
7 |
8 |
9 |
10 | void put(ConfigurationOption configurationOption);
11 |
12 | ConfigurationOption get(String id);
13 |
14 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/ParallelServiceOrchestration.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.pvm.PvmActivity;
5 |
6 | /**
7 | * Created by 高海军 帝奇 74394 on 2020-09-21 17:54.
8 | */
9 | public interface ParallelServiceOrchestration {
10 |
11 | void orchestrateService(ExecutionContext context, PvmActivity pvmActivity);
12 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/PvmActivityTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 |
4 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
5 | import com.alibaba.smart.framework.engine.pvm.PvmActivity;
6 |
7 | import java.util.concurrent.Callable;
8 |
9 | public interface PvmActivityTask extends Callable {
10 |
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/PvmActivityTaskFactory.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 |
4 |
5 | public interface PvmActivityTaskFactory {
6 |
7 | PvmActivityTask create(Object... args);
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/TableSchemaNaming.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2018 October 16:47.
7 | */
8 |
9 | @Data
10 | public class TableSchemaNaming {
11 |
12 | private String prefix ="";
13 | private String suffix ="";
14 |
15 |
16 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/TableSchemaStrategy.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2018 October 15:53.
5 | */
6 | public interface TableSchemaStrategy {
7 |
8 | String getTableSchemaFormatter(String tableOrCollectionName);
9 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/TaskAssigneeDispatcher.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
6 | import com.alibaba.smart.framework.engine.model.assembly.Activity;
7 | import com.alibaba.smart.framework.engine.model.instance.TaskAssigneeCandidateInstance;
8 |
9 | /**
10 | * Created by 高海军 帝奇 74394 on 2017 January 11:13.
11 | */
12 | public interface TaskAssigneeDispatcher {
13 |
14 | List getTaskAssigneeCandidateInstance(Activity activity, ExecutionContext context);
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/VariablePersister.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration;
2 |
3 | import java.util.Set;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2017 October 06:20.
7 | */
8 | public interface VariablePersister {
9 |
10 | /**
11 | * 是否开启变量存储机制,默认不开启.
12 | * @return
13 | */
14 | boolean isPersisteVariableInstanceEnabled();
15 |
16 | /**
17 | *黑名单中的 key 关联的数据将不会被持久化到变量表中.
18 | *
19 | * @return
20 | */
21 | Set getBlockList();
22 |
23 | /**
24 | * 序列化.
25 | *
26 | * 除了基本类型和 String, 其他Value 的序列化机制.
27 | */
28 | String serialize(Object value);
29 |
30 | /**
31 | * 反序列化.
32 | *
33 | * 其他同 {@code serialize}
34 | *
35 | */
36 | Object deserialize(String key, String type, String value);
37 | }
38 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/aware/ProcessEngineConfigurationAware.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.aware;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.ProcessEngineConfiguration;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2019-12-30 15:38.
7 | */
8 | public interface ProcessEngineConfigurationAware {
9 |
10 | void setProcessEngineConfiguration(ProcessEngineConfiguration processEngineConfiguration);
11 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/DefaultExceptionProcessor.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.ExceptionProcessor;
4 | import com.alibaba.smart.framework.engine.exception.EngineException;
5 |
6 | /**
7 | * Created by 高海军 帝奇 74394 on 2020-09-10 16:11.
8 | */
9 | public class DefaultExceptionProcessor implements ExceptionProcessor {
10 | @Override
11 | public void process(Exception exception, Object context) {
12 | throw new EngineException(exception);
13 | }
14 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/DefaultIdGenerator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl;
2 |
3 | import java.util.UUID;
4 |
5 | import com.alibaba.smart.framework.engine.configuration.IdGenerator;
6 | import com.alibaba.smart.framework.engine.model.instance.Instance;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2017 February 23:17.
10 | */
11 | public class DefaultIdGenerator implements IdGenerator{
12 |
13 | // 不建议在生产环境中使用。
14 | @Override
15 | public void generate(Instance instance) {
16 |
17 | String randomUUID = UUID.randomUUID().toString();
18 |
19 | instance.setInstanceId(randomUUID);
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/DefaultInstanceAccessor.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.InstanceAccessor;
4 | import com.alibaba.smart.framework.engine.util.ClassUtil;
5 |
6 | /**
7 | *
8 | * @author 高海军 帝奇 74394
9 | * @date 2017 May 21:00
10 | */
11 | public class DefaultInstanceAccessor implements InstanceAccessor {
12 |
13 | @Override
14 | public Object access(String classNameOrBeanName) {
15 | Object instance = ClassUtil.createOrGetInstance(classNameOrBeanName);
16 | return instance;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/DefaultPvmActivityTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.PvmActivityTask;
4 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
5 | import com.alibaba.smart.framework.engine.pvm.PvmActivity;
6 |
7 |
8 |
9 | public class DefaultPvmActivityTask implements PvmActivityTask {
10 |
11 | private PvmActivity pvmActivity;
12 | private ExecutionContext context;
13 |
14 | public DefaultPvmActivityTask(Object... args) {
15 | this.pvmActivity = (PvmActivity)args[0];
16 | this.context = (ExecutionContext)args[1];
17 | }
18 |
19 |
20 | @Override
21 | public ExecutionContext call() {
22 |
23 | //忽略了子线程的返回值
24 | this.pvmActivity.enter(context);
25 |
26 | return context;
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/DefaultPvmActivityTaskFactory.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl;
2 |
3 |
4 | import com.alibaba.smart.framework.engine.configuration.PvmActivityTask;
5 | import com.alibaba.smart.framework.engine.configuration.PvmActivityTaskFactory;
6 |
7 | public class DefaultPvmActivityTaskFactory implements PvmActivityTaskFactory {
8 |
9 | public PvmActivityTask create(Object... args){
10 | return new DefaultPvmActivityTask(args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/DefaultTableSchemaStrategy.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.TableSchemaNaming;
4 | import com.alibaba.smart.framework.engine.configuration.TableSchemaStrategy;
5 |
6 | /**
7 | * Created by 高海军 帝奇 74394 on 2018 October 16:57.
8 | */
9 | public class DefaultTableSchemaStrategy implements TableSchemaStrategy {
10 |
11 | private TableSchemaNaming tableSchemaNaming;
12 |
13 | public DefaultTableSchemaStrategy() {
14 | tableSchemaNaming = new TableSchemaNaming();
15 | }
16 |
17 |
18 |
19 | @Override
20 | public String getTableSchemaFormatter(String tableOrCollectionName){
21 | return tableSchemaNaming.getPrefix()+tableOrCollectionName+tableSchemaNaming.getSuffix();
22 | }
23 |
24 |
25 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/DefaultVariablePersister.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl;
2 |
3 | import java.util.Set;
4 |
5 | import com.alibaba.smart.framework.engine.configuration.VariablePersister;
6 |
7 | /**
8 | * Created by 高海军 帝奇 74394 on 2017 October 07:09.
9 | */
10 | public class DefaultVariablePersister implements VariablePersister {
11 |
12 | @Override
13 | public boolean isPersisteVariableInstanceEnabled() {
14 | return false;
15 | }
16 |
17 | @Override
18 | public Set getBlockList() {
19 | return null;
20 | }
21 |
22 | @Override
23 | public String serialize(Object value) {
24 | return null;
25 | }
26 |
27 | @Override
28 | public Object deserialize(String key, String type, String value) {
29 | return null;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/option/DefaultOptionContainer.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl.option;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import com.alibaba.smart.framework.engine.configuration.ConfigurationOption;
7 | import com.alibaba.smart.framework.engine.configuration.OptionContainer;
8 |
9 | /**
10 | * Created by 高海军 帝奇 74394 on 2020-02-15 21:40.
11 | */
12 | public class DefaultOptionContainer implements OptionContainer {
13 |
14 | private Map map = new HashMap();
15 |
16 | @Override
17 | public void put(ConfigurationOption configurationOption) {
18 | map.put(configurationOption.getId(),configurationOption);
19 | }
20 |
21 | @Override
22 | public ConfigurationOption get(String id) {
23 | ConfigurationOption configurationOption = map.get(id);
24 | if(null == configurationOption){
25 | return ConfigurationOption.DISABLED_OPTION;
26 | }
27 | return configurationOption;
28 | }
29 |
30 |
31 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/option/DisabledOption.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl.option;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.ConfigurationOption;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2020-02-15 21:40.
7 | */
8 | public class DisabledOption implements ConfigurationOption {
9 |
10 | @Override
11 | public boolean isEnabled() {
12 | return false;
13 | }
14 |
15 | @Override
16 | public String getId() {
17 | return "disabled";
18 | }
19 |
20 | @Override
21 | public Object getData() {
22 | return null;
23 | }
24 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/option/EagerFlushEnabledOption.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl.option;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.ConfigurationOption;
4 |
5 |
6 | public class EagerFlushEnabledOption implements ConfigurationOption {
7 |
8 | @Override
9 | public boolean isEnabled() {
10 | return true;
11 | }
12 |
13 | @Override
14 | public String getId() {
15 | return "eagerFlushEnabledOption";
16 | }
17 |
18 | @Override
19 | public Object getData() {
20 | return null;
21 | }
22 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/option/ExpressionCompileResultCachedOption.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl.option;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.ConfigurationOption;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2020-02-15 21:40.
7 |
8 | * 目前仅用于cache 表达式的解析结果。一般来说,是需要cache的。但是如果表达式字面内容完全相同,但是变量的类型的不同,会导致运行时错误,这种情况下则需要设置为false。
9 | */
10 | public class ExpressionCompileResultCachedOption implements ConfigurationOption {
11 |
12 | @Override
13 | public boolean isEnabled() {
14 | return true;
15 | }
16 |
17 | @Override
18 | public String getId() {
19 | return "expressionCompileResultCached";
20 | }
21 |
22 | @Override
23 | public Object getData() {
24 | return null;
25 | }
26 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/option/ServiceOrchestrationEnabledOption.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl.option;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.ConfigurationOption;
4 |
5 |
6 | public class ServiceOrchestrationEnabledOption implements ConfigurationOption {
7 |
8 | @Override
9 | public boolean isEnabled() {
10 | return true;
11 | }
12 |
13 | @Override
14 | public String getId() {
15 | return "serviceOrchestrationEnabled";
16 | }
17 |
18 | @Override
19 | public Object getData() {
20 | return null;
21 | }
22 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/impl/option/TransferEnabledOption.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.impl.option;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.ConfigurationOption;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2020-02-15 21:40.
7 | */
8 | public class TransferEnabledOption implements ConfigurationOption {
9 |
10 | @Override
11 | public boolean isEnabled() {
12 | return true;
13 | }
14 |
15 | @Override
16 | public String getId() {
17 | return "transferEnabled";
18 | }
19 |
20 | @Override
21 | public Object getData() {
22 | return null;
23 | }
24 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/scanner/AnnotationScanner.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.scanner;
2 |
3 |
4 | import java.lang.annotation.Annotation;
5 | import java.util.Map;
6 |
7 | import com.alibaba.smart.framework.engine.configuration.ProcessEngineConfiguration;
8 |
9 | /**
10 | * Created by 高海军 帝奇 74394 on 2019 December 16:03.
11 | */
12 | public interface AnnotationScanner {
13 |
14 | void scan(ProcessEngineConfiguration processEngineConfiguration,
15 | Class extends Annotation> bindingAnnotationClazz);
16 |
17 | Map getScanResult();
18 |
19 | T getExtensionPoint(String group,Class modelType);
20 |
21 | Object getObject(String group,Class modelType);
22 |
23 | void clear();
24 | }
25 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/configuration/scanner/ExtensionBindingResult.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.configuration.scanner;
2 |
3 | import java.util.Map;
4 |
5 | import lombok.Data;
6 |
7 | /**
8 | * Created by 高海军 帝奇 74394 on 2019-08-27 14:32.
9 | */
10 |
11 | @Data
12 | public class ExtensionBindingResult {
13 |
14 | private Map bindingMap;
15 |
16 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/constant/AdHocConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.constant;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2018 October 16:49.
5 | *
6 | * @author ghj
7 | * @date 2018/10/22
8 | */
9 | public interface AdHocConstant {
10 |
11 | String DEFAULT_ZERO_VALUE = "0";
12 |
13 | String AGREE = "agree";
14 |
15 | String DISAGREE = "disagree";
16 |
17 | String MVEL= "mvel";
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/constant/AssigneeTypeConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.constant;
2 |
3 | /**
4 | *
5 | * @author 高海军 帝奇 74394
6 | * @date 2017 September 12:32
7 | */
8 | public interface AssigneeTypeConstant {
9 |
10 | String USER = "user";
11 |
12 | String GROUP = "group";
13 |
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/constant/DeploymentStatusConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.constant;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2017 September 17:05.
5 | */
6 | public interface DeploymentStatusConstant {
7 |
8 |
9 | String ACTIVE = "active";
10 |
11 | String INACTIVE = "inactive";
12 |
13 | String DELETED = "deleted";
14 |
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/constant/ExtensionElementsConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.constant;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-11-14 17:51.
5 | */
6 | public interface ExtensionElementsConstant {
7 |
8 | String EXECUTION_LISTENER ="ExecutionListener";
9 |
10 | String PROPERTIES = "Properties";
11 |
12 |
13 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/constant/LogicStatusConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.constant;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2017 September 17:05.
5 | */
6 | public interface LogicStatusConstant {
7 |
8 | String VALID = "valid";
9 |
10 | String DELETED = "deleted";
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/constant/SmartBase.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.constant;
2 |
3 | /**
4 | * @author 高海军 帝奇 2016.11.11
5 | * @author ettear 2016.04.13
6 | */
7 | public interface SmartBase {
8 |
9 | String SMART_NS = "http://smartengine.org/schema/process";
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/constant/TaskInstanceConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.constant;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2017 September 19:00.
5 | */
6 | public interface TaskInstanceConstant {
7 |
8 | String PENDING = "pending";
9 |
10 | String COMPLETED = "completed";
11 |
12 | String ABORTED = "aborted";
13 |
14 | String CANCELED = "canceled";
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/delegation/ContextBoundedJavaDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.delegation;
2 |
3 | import com.alibaba.smart.framework.engine.model.assembly.Activity;
4 |
5 | import lombok.Getter;
6 | import lombok.Setter;
7 |
8 | /**
9 | * @author 高海军 帝奇
10 | */
11 | public abstract class ContextBoundedJavaDelegation implements JavaDelegation {
12 |
13 | @Getter
14 | @Setter
15 | protected String className;
16 | @Getter
17 | @Setter
18 | protected Activity activity;
19 |
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/delegation/JavaDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.delegation;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 |
5 | /**
6 | * @author 高海军 帝奇 2016.11.11
7 | */
8 | public interface JavaDelegation extends RootDelegation {
9 |
10 | void execute(ExecutionContext executionContext);
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/delegation/RootDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.delegation;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-08-30 11:29.
5 | */
6 | public interface RootDelegation {
7 |
8 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/delegation/TccDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.delegation;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 |
5 | /**
6 | * @author 高海军 帝奇 2016.11.11
7 | *
8 | * use `JavaDelegation` or `ContextBoundedJavaDelegation` instead.
9 | */
10 | @Deprecated
11 | public interface TccDelegation {
12 |
13 | TccResult tryExecute(ExecutionContext executionContext);
14 |
15 | TccResult confirmExecute(ExecutionContext executionContext);
16 |
17 | TccResult cancelExecute(ExecutionContext executionContext);
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/delegation/TccResult.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.delegation;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | /**
7 | * @author 高海军 帝奇 2016.11.11
8 | */
9 | @Deprecated
10 | public class TccResult {
11 |
12 | private TccResult(){
13 | }
14 |
15 | @Getter
16 | @Setter
17 | private boolean isSucessful;
18 |
19 | @Getter
20 | @Setter
21 | private Object target;
22 |
23 | public static TccResult buildSucessfulResult(Object target){
24 | TccResult result = new TccResult();
25 | result.setSucessful(true);
26 | result.setTarget(target);
27 | return result;
28 | }
29 |
30 |
31 | public static TccResult buildFailedResult(Object target){
32 | TccResult result = new TccResult();
33 | result.setSucessful(false);
34 | result.setTarget(target);
35 | return result;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/exception/ConcurrentException.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.exception;
2 |
3 | /**
4 | * @author zaimang.tj
5 | * @date 2017/11/8
6 | */
7 | public class ConcurrentException extends EngineException {
8 | private static final long serialVersionUID = -5576514534329147766L;
9 |
10 | public ConcurrentException(String message) {
11 | super(message);
12 | }
13 |
14 | public ConcurrentException(Exception e) {
15 | super(e);
16 | }
17 |
18 | public ConcurrentException(String message, Exception e) {
19 | super(message, e);
20 | }
21 |
22 | public ConcurrentException(String message, Throwable e) {
23 | super(message, e);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/exception/DeployException.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.exception;
2 |
3 |
4 | /**
5 | * @author 高海军 帝奇 2016.11.11
6 | */
7 | public class DeployException extends EngineException {
8 |
9 |
10 | private static final long serialVersionUID = -5576514678329147766L;
11 |
12 | public DeployException(String message) {
13 | super(message);
14 | }
15 |
16 | public DeployException(String message, Exception e) {
17 | super(message, e);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/exception/EngineException.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.exception;
2 |
3 | /**
4 | * @author 高海军 帝奇 2016.11.11
5 | */
6 | public class EngineException extends RuntimeException {
7 |
8 | private static final long serialVersionUID = -4066455487370828006L;
9 |
10 | public EngineException(String message) {
11 | super(message);
12 | }
13 |
14 | public EngineException( Exception e) {
15 | super(e.getMessage(), e);
16 | }
17 |
18 | public EngineException(String message, Exception e) {
19 | super(message, e);
20 | }
21 |
22 | public EngineException(String message, Throwable e) {
23 | super(message, e);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/exception/LockException.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.exception;
2 |
3 |
4 | /**
5 | * @author 高海军 帝奇 2016.11.11
6 | */
7 | public class LockException extends EngineException {
8 |
9 |
10 | private static final long serialVersionUID = -5576514678329147766L;
11 |
12 | public LockException(String message) {
13 | super(message);
14 | }
15 |
16 | public LockException(String message, Exception e) {
17 | super(message, e);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/exception/ParseException.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.exception;
2 |
3 | /**
4 | * Created by ettear on 16-4-12.
5 | */
6 | public class ParseException extends EngineException {
7 |
8 | private static final long serialVersionUID = 6304946747125320343L;
9 |
10 | public ParseException( Exception e) {
11 | super(e.getMessage(), e);
12 | }
13 |
14 |
15 | public ParseException(String message) {
16 | super(message);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/exception/SignalException.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.exception;
2 |
3 |
4 | /**
5 | * @author 高海军 帝奇 2020.9.9
6 | */
7 | public class SignalException extends EngineException {
8 |
9 |
10 | private static final long serialVersionUID = -5576514678329147766L;
11 |
12 | public SignalException(String message) {
13 | super(message);
14 | }
15 |
16 | public SignalException(String message, Exception e) {
17 | super(message, e);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/exception/ValidationException.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.exception;
2 |
3 | public class ValidationException extends EngineException {
4 |
5 |
6 | public ValidationException(Exception e) {
7 | super(e.getMessage(), e);
8 | }
9 |
10 |
11 | public ValidationException(String message) {
12 | super(message);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/extension/annotation/ExtensionBinding.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * Created by 高海军 帝奇 74394 on 2019-08-25 21:36.
11 | */
12 | @Target({ElementType.TYPE})
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Documented
15 | public @interface ExtensionBinding {
16 |
17 | String group();
18 |
19 | Class bindKey();
20 |
21 | int priority() default 0;
22 |
23 | //AnnotationLookup lookup() ;
24 |
25 | //Class extends AnnotationLookup> lookup() default PlaceHolderAnnotationLookup.class;
26 |
27 |
28 | //String[] value() default {};
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/extension/constant/ExtensionConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.constant;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-08-27 17:31.
5 | */
6 | public interface ExtensionConstant {
7 | String COMMON = "common";
8 |
9 | String SERVICE = "SERVICE";
10 |
11 | String ELEMENT_PARSER = "element-parser";
12 |
13 | String ATTRIBUTE_PARSER = "attribute-parser";
14 |
15 | String ACTIVITY_BEHAVIOR = "activity-behavior";
16 |
17 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/extension/lookup/AnnotationLookup.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.lookup;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-10-03 15:06.
5 | */
6 | public interface AnnotationLookup {
7 | void lookup();
8 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/extension/lookup/PlaceHolderAnnotationLookup.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.lookup;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-10-03 15:06.
5 | */
6 | public class PlaceHolderAnnotationLookup implements AnnotationLookup {
7 |
8 | @Override
9 | public void lookup() {
10 |
11 | }
12 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/helper/ExecutionInstanceHelper.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.helper;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.model.instance.ExecutionInstance;
6 |
7 | public abstract class ExecutionInstanceHelper {
8 |
9 |
10 | public static ExecutionInstance findMatched(List executionInstanceList, String processDefinitionActivityId ){
11 |
12 |
13 | for (ExecutionInstance executionInstance : executionInstanceList) {
14 | if(executionInstance.getProcessDefinitionActivityId().equals(processDefinitionActivityId)){
15 | return executionInstance;
16 | }
17 | }
18 |
19 | return null;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/hook/LifeCycleHook.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.hook;
2 |
3 | /**
4 | * 生命周期监听 Created by ettear on 16-4-13.
5 | */
6 | public interface LifeCycleHook {
7 |
8 | /**
9 | * This method will be invoked when started.
10 | */
11 | void start();
12 |
13 | /**
14 | * This method will be invoked when stopped
15 | */
16 | void stop();
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/factory/ActivityInstanceFactory.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.factory;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.model.assembly.Activity;
5 | import com.alibaba.smart.framework.engine.model.instance.ActivityInstance;
6 |
7 | /**
8 | * 活动实例工厂 Created by ettear on 16-4-20.
9 | */
10 | public interface ActivityInstanceFactory {
11 |
12 | ActivityInstance create(Activity activity, ExecutionContext context);
13 |
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/factory/DeploymentInstanceFactory.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.factory;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.DeploymentInstance;
4 | import com.alibaba.smart.framework.engine.service.param.command.CreateDeploymentCommand;
5 |
6 | /**
7 | * 流程实例工厂 Created by ettear on 16-4-20.
8 | */
9 |
10 | public interface DeploymentInstanceFactory {
11 |
12 | /**
13 | * 创建流程实例
14 | *
15 | * @return 流程实例
16 | */
17 | DeploymentInstance create(CreateDeploymentCommand createDeploymentCommand);
18 |
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/factory/ExecutionInstanceFactory.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.factory;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.model.instance.ActivityInstance;
5 | import com.alibaba.smart.framework.engine.model.instance.ExecutionInstance;
6 |
7 | public interface ExecutionInstanceFactory {
8 |
9 | /**
10 | * 创建执行实例
11 | *
12 | * @return 执行实例
13 | */
14 | ExecutionInstance create(ActivityInstance activityInstance, ExecutionContext executionContext);
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/factory/ProcessInstanceFactory.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.factory;
2 |
3 | import java.util.Map;
4 |
5 | import com.alibaba.smart.framework.engine.configuration.ProcessEngineConfiguration;
6 | import com.alibaba.smart.framework.engine.model.instance.ProcessInstance;
7 |
8 | /**
9 | * 流程实例工厂 Created by ettear on 16-4-20.
10 | */
11 | public interface ProcessInstanceFactory {
12 |
13 | /**
14 | * 创建流程实例
15 | *
16 | * @return 流程实例
17 | */
18 | ProcessInstance create(ProcessEngineConfiguration processEngineConfiguration, String processDefinitionId, String processDefinitionVersion, Map request);
19 |
20 |
21 | ProcessInstance createChild(ProcessEngineConfiguration processEngineConfiguration, String processDefinitionId, String processDefinitionVersion, Map request,String parentInstanceId, String parentExecutionInstanceId);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/factory/TaskInstanceFactory.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.factory;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.model.assembly.Activity;
5 | import com.alibaba.smart.framework.engine.model.instance.ExecutionInstance;
6 | import com.alibaba.smart.framework.engine.model.instance.TaskInstance;
7 |
8 | /**
9 | * 任务实例工厂 Created by ettear on 16-4-20.
10 | */
11 | public interface TaskInstanceFactory {
12 |
13 | /**
14 | * 创建任务实例
15 | *
16 | * @return 任务实例
17 | */
18 | TaskInstance create(Activity activity, ExecutionInstance executionInstance, ExecutionContext context);
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/factory/TransitionInstanceFactory.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.factory;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.model.instance.TransitionInstance;
5 |
6 | /**
7 | * 关联实例工 Created by ettear on 16-4-20.
8 | */
9 | public interface TransitionInstanceFactory {
10 |
11 | /**
12 | * 创建关联实例
13 | *
14 | * @return 关联实例
15 | */
16 | TransitionInstance create(ExecutionContext executionContext);
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/factory/impl/DefaultTransitionInstanceFactory.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.factory.impl;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
5 | import com.alibaba.smart.framework.engine.extension.constant.ExtensionConstant;
6 | import com.alibaba.smart.framework.engine.instance.factory.TransitionInstanceFactory;
7 | import com.alibaba.smart.framework.engine.instance.impl.DefaultTransitionInstance;
8 | import com.alibaba.smart.framework.engine.model.instance.TransitionInstance;
9 |
10 | /**
11 | * 默认关联实例工厂实现 Created by ettear on 16-4-20.
12 | */
13 | @ExtensionBinding(group = ExtensionConstant.COMMON, bindKey = TransitionInstanceFactory.class)
14 |
15 | public class DefaultTransitionInstanceFactory implements TransitionInstanceFactory {
16 |
17 | @Override
18 | public TransitionInstance create(ExecutionContext executionContext) {
19 | return new DefaultTransitionInstance();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/impl/AbstractInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.impl;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.Instance;
4 |
5 | import lombok.Data;
6 |
7 | /**
8 | * 抽象实例 Created by ettear on 16-4-19.
9 | */
10 | @Data
11 | public abstract class AbstractInstance implements Instance {
12 |
13 | private static final long serialVersionUID = -973475989101269263L;
14 | /**
15 | * 实例Id
16 | */
17 | private String instanceId;
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/impl/AbstractLifeCycleInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.impl;
2 |
3 | import java.util.Date;
4 |
5 | import com.alibaba.smart.framework.engine.model.instance.LifeCycleInstance;
6 |
7 | import lombok.Data;
8 | import lombok.EqualsAndHashCode;
9 | import lombok.ToString;
10 |
11 | /**
12 | * 抽象实例 Created by ettear on 16-4-19.
13 | */
14 | @Data
15 | @EqualsAndHashCode(callSuper = true)
16 | @ToString(callSuper = true)
17 | public abstract class AbstractLifeCycleInstance extends AbstractInstance implements LifeCycleInstance {
18 |
19 | private static final long serialVersionUID = -170898515347885220L;
20 |
21 | /**
22 | * 开始时间
23 | */
24 | private Date startTime;
25 | /**
26 | * 结束时间
27 | */
28 | private Date completeTime;
29 |
30 | /**
31 | * 租户id
32 | */
33 | private String tenantId;
34 | }
35 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/impl/DefaultExecutionInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.impl;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.ExecutionInstance;
4 | import com.alibaba.smart.framework.engine.model.instance.TaskInstance;
5 |
6 | import lombok.Data;
7 | import lombok.EqualsAndHashCode;
8 |
9 |
10 | @EqualsAndHashCode(callSuper = true)
11 | @Data
12 | public class DefaultExecutionInstance extends AbstractLifeCycleInstance implements ExecutionInstance {
13 |
14 | private static final long serialVersionUID = 2323809298485587299L;
15 | private String processDefinitionIdAndVersion;
16 | private String processInstanceId;
17 | private String activityInstanceId;
18 |
19 | private String processDefinitionActivityId;
20 | private boolean active;
21 |
22 | private String blockId;
23 |
24 | private TaskInstance taskInstance;
25 |
26 | @Override
27 | public String toString() {
28 | return this.getInstanceId()+":"+this.getProcessDefinitionActivityId()+":"+this.isActive();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/impl/DefaultTaskAssigneeInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.impl;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.TaskAssigneeInstance;
4 |
5 | import lombok.Data;
6 | import lombok.EqualsAndHashCode;
7 |
8 | /**
9 | * 默认任务处理者 Created by 帝奇 on 17.01.02.
10 | */
11 | @EqualsAndHashCode(callSuper = true)
12 | @Data
13 | public class DefaultTaskAssigneeInstance extends AbstractLifeCycleInstance implements TaskAssigneeInstance {
14 |
15 | private static final long serialVersionUID = -3920292154786127202L;
16 |
17 | private String processInstanceId;
18 |
19 | private String assigneeId;
20 | private String assigneeType;
21 | private String taskInstanceId;
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/impl/DefaultTransitionInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.impl;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.TransitionInstance;
4 |
5 | import lombok.Data;
6 |
7 | /**
8 | * 默认关联实例 Created by ettear on 16-4-19.
9 | */
10 | @Data
11 | public class DefaultTransitionInstance implements TransitionInstance {
12 |
13 | private static final long serialVersionUID = 8888812970442968263L;
14 | private String transitionId;
15 | private String sourceActivityInstanceId;
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/impl/DefaultVariableInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.impl;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.VariableInstance;
4 |
5 | import lombok.Data;
6 | import lombok.EqualsAndHashCode;
7 |
8 | @EqualsAndHashCode(callSuper = true)
9 | @Data
10 | public class DefaultVariableInstance extends AbstractLifeCycleInstance implements VariableInstance {
11 |
12 |
13 | private String processInstanceId;
14 |
15 | private String executionInstanceId;
16 |
17 | private String fieldKey;
18 |
19 | private Class fieldType;
20 |
21 | private Object fieldValue;
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/instance/storage/VariableInstanceStorage.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.instance.storage;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.configuration.ProcessEngineConfiguration;
6 | import com.alibaba.smart.framework.engine.configuration.VariablePersister;
7 | import com.alibaba.smart.framework.engine.model.instance.VariableInstance;
8 |
9 | public interface VariableInstanceStorage {
10 |
11 | void insert(VariablePersister variablePersister, VariableInstance variableInstance,
12 | ProcessEngineConfiguration processEngineConfiguration);
13 |
14 | List findList(String processInstanceId, String executionInstanceId,
15 | VariablePersister variablePersister,String tenantId,
16 | ProcessEngineConfiguration processEngineConfiguration);
17 |
18 | // List findAll(String processInstanceId,VariablePersister variablePersister,
19 | // ProcessEngineConfiguration processEngineConfiguration);
20 |
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/interceptor/Interceptor.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.interceptor;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019 August 17:02.
5 | */
6 | public interface Interceptor {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/interceptor/InterceptorChain.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.interceptor;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019 August 17:02.
5 | */
6 | public class InterceptorChain {
7 |
8 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/interceptor/InterceptorSupport.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.interceptor;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019 August 17:02.
5 | */
6 | public class InterceptorSupport {
7 |
8 |
9 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/listener/Listener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.listener;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
5 |
6 | /**
7 | * Created by 高海军 帝奇 74394 on 2019-09-01 11:51.
8 | */
9 | public interface Listener {
10 |
11 | void execute(EventConstant event, ExecutionContext executionContext);
12 |
13 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/listener/ListenerAggregation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.listener;
2 |
3 | import java.util.List;
4 | import java.util.Map;
5 |
6 | import com.alibaba.smart.framework.engine.common.util.MapUtil;
7 |
8 | import lombok.Data;
9 |
10 | /**
11 | * Created by 高海军 帝奇 74394 on 2019-11-14 16:37.
12 | */
13 | @Data
14 | public class ListenerAggregation {
15 |
16 | private Map> eventListenerMap = MapUtil.newHashMap();
17 |
18 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/Activity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | /**
4 | * @author 高海军 帝奇 2016.11.11
5 | * @author ettear 2016.04.13
6 | */
7 | public interface Activity extends ExtensionElementContainer,IdBasedElement {
8 |
9 |
10 | boolean isStartActivity();
11 |
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/BaseElement.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @author 高海军 帝奇 2016.11.11
7 | * @author ettear 2016.04.13
8 | */
9 | public interface BaseElement extends Serializable {
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/ConditionExpression.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | /**
4 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
5 | */
6 | public interface ConditionExpression extends NoneIdBasedElement {
7 |
8 | String getExpressionType();
9 | void setExpressionType(String type);
10 |
11 | String getExpressionContent();
12 | void setExpressionContent(String content);
13 |
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/ExtensionDecorator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | import com.alibaba.smart.framework.engine.xml.parser.ParseContext;
4 |
5 | /**
6 | * @author 高海军 帝奇 2016.11.11
7 | * @author ettear 2016.04.13
8 | */
9 |
10 | public interface ExtensionDecorator extends NoneIdBasedElement {
11 |
12 | //Object getKey();
13 |
14 | String getDecoratorType();
15 |
16 | void decorate(ExtensionElements extensionElements, ParseContext context);
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/ExtensionElementContainer.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | /**
4 | * @author pengziran
5 | * Created by pengziran on 01/08/2017.
6 | *
7 | * refactored by diqi 2019.07.20
8 | */
9 | public interface ExtensionElementContainer {
10 |
11 | ExtensionElements getExtensionElements();
12 |
13 | void setExtensionElements(ExtensionElements extensionElements);
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/ExtensionElements.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | import com.alibaba.smart.framework.engine.xml.parser.ParseContext;
4 |
5 | import java.util.List;
6 | import java.util.Map;
7 |
8 | public interface ExtensionElements extends NoneIdBasedElement {
9 |
10 | void decorate(ExtensionDecorator extension, ParseContext context);
11 |
12 |
13 | List getExtensionList();
14 |
15 | //void setExtensionList(List extensionList);
16 |
17 |
18 | Map getDecorationMap();
19 |
20 | //void setDecorationMap (Map decorationMap );
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/IdBasedElement.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * @author 高海军 帝奇 2016.11.11
7 | * @author ettear 2016.04.13
8 | */
9 | public interface IdBasedElement extends BaseElement {
10 |
11 | String getId();
12 |
13 | void setId(String id);
14 |
15 | Map getProperties();
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/NoneIdBasedElement.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | /**
4 | * @author 高海军 帝奇 2016.11.11
5 | * @author ettear 2016.04.13
6 | */
7 | public interface NoneIdBasedElement extends BaseElement{
8 |
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/ProcessDefinition.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | import java.util.List;
4 | import java.util.Map;
5 |
6 | /**
7 | * @author 高海军 帝奇 2016.11.11
8 | * @author ettear 2016.04.13
9 | */
10 | public interface ProcessDefinition extends ExtensionElementContainer,IdBasedElement {
11 |
12 | String getTenantId();
13 |
14 | void setTenantId(String tenantId);
15 |
16 | String getName();
17 | void setName(String name);
18 |
19 |
20 | String getVersion();
21 | void setVersion(String version);
22 |
23 | //String getIdAndVersion();
24 | //
25 | //void setIdAndVersion(String idAndVersion);
26 |
27 |
28 | List getBaseElementList();
29 |
30 | void setBaseElementList( List elementList);
31 |
32 | Map getIdBasedElementMap();
33 |
34 | void setIdBasedElementMap( Map idBasedElementMap);
35 |
36 | void setProperties(Map properties);
37 | }
38 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/ProcessDefinitionSource.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 | import java.util.List;
4 |
5 | public interface ProcessDefinitionSource extends NoneIdBasedElement {
6 |
7 | String getTenantId();
8 |
9 | void setTenantId(String tenantId);
10 |
11 | List getProcessDefinitionList();
12 |
13 | void setProcessDefinitionList(List processDefinitionList);
14 |
15 | ProcessDefinition getFirstProcessDefinition();
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/Transition.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly;
2 |
3 |
4 | /**
5 | * @author 高海军 帝奇 2016.11.11
6 | * @author ettear 2016.04.13
7 | */
8 | public interface Transition extends ExtensionElementContainer,IdBasedElement {
9 |
10 | String getSourceRef();
11 |
12 | String getTargetRef();
13 |
14 | ConditionExpression getConditionExpression();
15 | }
16 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/impl/AbstractActivity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly.impl;
2 |
3 | import java.util.Map;
4 |
5 | import com.alibaba.smart.framework.engine.model.assembly.Activity;
6 | import com.alibaba.smart.framework.engine.model.assembly.ExtensionElements;
7 |
8 | import lombok.Data;
9 |
10 | /**
11 | * @author 高海军 帝奇 2016.11.11
12 | * @author ettear 2016.04.13
13 | */
14 | @Data
15 | public abstract class AbstractActivity implements Activity {
16 |
17 | private static final long serialVersionUID = 3558917263151685441L;
18 |
19 | private String id;
20 | private String name;
21 |
22 | private ExtensionElements extensionElements;
23 |
24 | private boolean startActivity;
25 |
26 | private Map properties;
27 |
28 | @Override
29 | public boolean isStartActivity() {
30 | return startActivity;
31 | }
32 |
33 | public void setStartActivity(boolean startActivity) {
34 | this.startActivity = startActivity;
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/impl/AbstractTask.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly.impl;
2 |
3 | import lombok.Data;
4 | import lombok.EqualsAndHashCode;
5 |
6 | /**
7 | * @author 高海军 帝奇 Apr 14, 2016 2:50:20 PM
8 | */
9 | @EqualsAndHashCode(callSuper = true)
10 | @Data
11 | public abstract class AbstractTask extends AbstractActivity {
12 |
13 | /**
14 | *
15 | */
16 | private static final long serialVersionUID = 5042056118774610434L;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/assembly/impl/AbstractTransition.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.assembly.impl;
2 |
3 | import com.alibaba.smart.framework.engine.model.assembly.ExtensionElements;
4 | import com.alibaba.smart.framework.engine.model.assembly.Transition;
5 |
6 | import lombok.Data;
7 |
8 | /**
9 | * @author 高海军 帝奇 2016.11.11
10 | * @author ettear 2016.04.13
11 | */
12 | @Data
13 | public abstract class AbstractTransition implements Transition {
14 |
15 | private static final long serialVersionUID = -3833522271165082836L;
16 |
17 | private String id;
18 | private String name;
19 |
20 |
21 | private String sourceRef;
22 | private String targetRef;
23 |
24 | private ExtensionElements extensionElements;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/instance/ExecutionInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.instance;
2 |
3 | /**
4 | * @author 高海军 帝奇 2016.11.11
5 | * @author ettear 2016.04.13
6 | */
7 | public interface ExecutionInstance extends LifeCycleInstance {
8 |
9 | String getProcessDefinitionIdAndVersion();
10 |
11 | void setProcessDefinitionIdAndVersion(String processDefinitionIdAndVersion);
12 |
13 |
14 | String getProcessInstanceId();
15 |
16 | void setProcessInstanceId(String processInstanceId);
17 |
18 | boolean isActive();
19 |
20 | void setActive(boolean active);
21 |
22 | String getProcessDefinitionActivityId();
23 |
24 | void setProcessDefinitionActivityId(String processDefinitionActivityId);
25 |
26 |
27 | String getActivityInstanceId();
28 |
29 | void setActivityInstanceId(String activityInstanceId);
30 |
31 | String getBlockId();
32 |
33 | void setBlockId(String blockId);
34 |
35 |
36 | void setTaskInstance(TaskInstance taskInstance);
37 |
38 | TaskInstance getTaskInstance();
39 |
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/instance/Instance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.instance;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * 实例 Created by ettear on 16-4-19.
7 | */
8 | public interface Instance extends Serializable {
9 |
10 | String getTenantId();
11 |
12 | void setTenantId(String tenantId);
13 |
14 | /**
15 | * 获取实例ID
16 | *
17 | * @return 实例ID
18 | */
19 |
20 | String getInstanceId();
21 |
22 | /**
23 | * 设置实例ID
24 | *
25 | * @param id 实例ID
26 | */
27 | void setInstanceId(String id);
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/instance/InstanceStatus.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.instance;
2 |
3 | /**
4 | * Created by ettear on 16-4-21.
5 | */
6 | public enum InstanceStatus {
7 |
8 | running, suspended, aborted,completed;
9 |
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/instance/LifeCycleInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.instance;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * 生命周期实例 Created by ettear on 16-4-21.
7 | */
8 | public interface LifeCycleInstance extends Instance {
9 |
10 | // InstanceStatus getStatus();
11 | //
12 | // void setStatus(InstanceStatus status);
13 |
14 | Date getStartTime();
15 |
16 | void setStartTime(Date startDate);
17 |
18 | Date getCompleteTime();
19 |
20 | void setCompleteTime(Date completeTime);
21 |
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/instance/TaskAssigneeCandidateInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.instance;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2017 September 20:38.
7 | */
8 | @Data
9 | public class TaskAssigneeCandidateInstance {
10 |
11 | private String assigneeId;
12 |
13 | private String assigneeType;
14 |
15 | private int priority = 500;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/instance/TaskAssigneeInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.instance;
2 |
3 | /**
4 | * @author 高海军 帝奇 2016.11.11
5 | * @author ettear 2016.04.13
6 | */
7 | public interface TaskAssigneeInstance extends LifeCycleInstance {
8 |
9 | String getProcessInstanceId();
10 |
11 | void setProcessInstanceId(String processInstanceId);
12 |
13 | String getTaskInstanceId();
14 |
15 | void setTaskInstanceId(String taskInstanceId);
16 |
17 | String getAssigneeId() ;
18 |
19 | void setAssigneeId(String assigneeId);
20 |
21 | String getAssigneeType();
22 |
23 | void setAssigneeType(String assigneeType);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/instance/TransitionInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.instance;
2 |
3 | /**
4 | * @author 高海军 帝奇 2016.11.11
5 | * @author ettear 2016.04.13
6 | */
7 | public interface TransitionInstance {
8 |
9 | String getTransitionId();
10 |
11 | void setTransitionId(String transitionId);
12 |
13 | String getSourceActivityInstanceId();
14 |
15 | void setSourceActivityInstanceId(String sourceActivityInstanceId);
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/model/instance/VariableInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.model.instance;
2 |
3 | public interface VariableInstance extends LifeCycleInstance {
4 |
5 | Class getFieldType();
6 |
7 | void setFieldType(Class fieldType);
8 |
9 | String getProcessInstanceId();
10 |
11 | void setProcessInstanceId(String processInstanceId);
12 |
13 | String getExecutionInstanceId();
14 |
15 | void setExecutionInstanceId(String executionInstanceId);
16 |
17 | void setFieldKey(String fieldKey);
18 |
19 | String getFieldKey();
20 |
21 | void setFieldValue(Object value);
22 |
23 | Object getFieldValue();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/pvm/PvmActivity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.pvm;
2 |
3 | import java.util.Map;
4 |
5 | import com.alibaba.smart.framework.engine.behavior.ActivityBehavior;
6 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
7 | import com.alibaba.smart.framework.engine.model.assembly.Activity;
8 |
9 | /**
10 | * @author 高海军 帝奇 2016.11.11
11 | * @author ettear 2016.04.13
12 | */
13 | public interface PvmActivity extends PvmElement {
14 |
15 | Map getIncomeTransitions();
16 |
17 | Map getOutcomeTransitions();
18 |
19 | /**
20 | * 流程实例启动,节点进入 会调用此方法.
21 | *
22 | * @param context
23 | */
24 | void enter(ExecutionContext context);
25 |
26 | void execute(ExecutionContext context);
27 |
28 | void setBehavior(ActivityBehavior activityBehavior);
29 |
30 | ActivityBehavior getBehavior();
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/pvm/PvmElement.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.pvm;
2 |
3 | import com.alibaba.smart.framework.engine.hook.LifeCycleHook;
4 | import com.alibaba.smart.framework.engine.model.assembly.ExtensionElementContainer;
5 |
6 | /**
7 | * @author 高海军 帝奇 2016.11.11
8 | * @author ettear 2016.04.13
9 | */
10 | public interface PvmElement extends LifeCycleHook {
11 |
12 | M getModel();
13 |
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/pvm/PvmProcessDefinition.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.pvm;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * @author 高海军 帝奇 2016.11.11
7 | * @author ettear 2016.04.13
8 | */
9 | public interface PvmProcessDefinition {
10 |
11 | String getId();
12 |
13 | String getVersion();
14 |
15 | String getTenantId();
16 |
17 | String getIdAndVersion();
18 |
19 | void setIdAndVersion(String idAndVersion);
20 |
21 | PvmActivity getStartActivity();
22 |
23 | Map getActivities();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/pvm/PvmProcessInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.pvm;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.model.instance.ProcessInstance;
5 |
6 | /**
7 | * @author 高海军 帝奇 2016.11.11
8 | * @author ettear 2016.04.13
9 | */
10 | public interface PvmProcessInstance {
11 |
12 | ProcessInstance start(ExecutionContext executionContext);
13 |
14 | ProcessInstance signal(PvmActivity pvmActivity, ExecutionContext executionContext);
15 |
16 | ProcessInstance jump(PvmActivity pvmActivity, ExecutionContext executionContext);
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/pvm/PvmTransition.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.pvm;
2 |
3 | import com.alibaba.smart.framework.engine.behavior.TransitionBehavior;
4 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
5 | import com.alibaba.smart.framework.engine.model.assembly.Transition;
6 |
7 | /**
8 | * @author 高海军 帝奇 2016.11.11
9 | * @author ettear 2016.04.13
10 | */
11 | public interface PvmTransition extends PvmElement {
12 |
13 | PvmActivity getSource();
14 |
15 | PvmActivity getTarget();
16 |
17 | boolean match(ExecutionContext context);
18 | //
19 | //void execute(ExecutionContext context);
20 |
21 | void setBehavior(TransitionBehavior transitionBehavior);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/pvm/event/EventConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.pvm.event;
2 |
3 |
4 | public enum EventConstant {
5 |
6 | start,// 流程实例开始或者环节节点进入 ,类似于 PROCESS_START ACTIVITY_START
7 | end, // 流程实例结束或者环节节点离开 ,类似于 PROCESS_END ACTIVITY_END
8 |
9 | take, // 互斥网关的sequenceFlow被选中执行时触发
10 |
11 | // above is new support event
12 |
13 | PROCESS_START,
14 | PROCESS_END,
15 |
16 | ACTIVITY_START,
17 | ACTIVITY_EXECUTE,
18 | ACTIVITY_END,
19 |
20 |
21 |
22 |
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/pvm/impl/AbstractPvmElement.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.pvm.impl;
2 |
3 | import com.alibaba.smart.framework.engine.model.assembly.ExtensionElementContainer;
4 | import com.alibaba.smart.framework.engine.pvm.PvmElement;
5 |
6 | /**
7 | * @author 高海军 帝奇 2016.11.11
8 | * @author ettear 2016.04.13
9 | */
10 | public abstract class AbstractPvmElement implements PvmElement {
11 |
12 |
13 | private M model;
14 |
15 | @Override
16 | public M getModel() {
17 | return this.model;
18 | }
19 |
20 | public void setModel(M model) {
21 | this.model = model;
22 | }
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/pvm/impl/DefaultPvmProcessDefinition.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.pvm.impl;
2 |
3 | import java.util.Map;
4 |
5 | import com.alibaba.smart.framework.engine.model.assembly.ProcessDefinition;
6 | import com.alibaba.smart.framework.engine.pvm.PvmActivity;
7 | import com.alibaba.smart.framework.engine.pvm.PvmProcessDefinition;
8 | import com.alibaba.smart.framework.engine.pvm.PvmTransition;
9 |
10 | import lombok.Data;
11 |
12 | /**
13 | * @author 高海军 帝奇 2016.11.11
14 | * @author ettear 2016.04.13
15 | */
16 | @Data
17 | public class DefaultPvmProcessDefinition implements PvmProcessDefinition {
18 |
19 | private String idAndVersion;
20 |
21 | private String id;
22 |
23 | private String version;
24 |
25 | private String tenantId;
26 |
27 | private Map activities;
28 |
29 | private Map transitions;
30 |
31 | private PvmActivity startActivity;
32 |
33 | private ProcessDefinition model;
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/command/RepositoryCommandService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.command;
2 |
3 | import java.io.InputStream;
4 |
5 | import com.alibaba.smart.framework.engine.model.assembly.ProcessDefinitionSource;
6 |
7 | /**
8 | *
9 | * 主要负责解析 XML,将其加载到单机内存里面。 需要注意的是,集群环境下需要注意内存数据的一致性.
10 | *
11 | * @author 高海军 帝奇 2016.11.11
12 | * @author ettear 2016.04.13
13 | */
14 | public interface RepositoryCommandService {
15 |
16 | ProcessDefinitionSource deploy(String classPathResource) ;
17 |
18 | ProcessDefinitionSource deploy(String classPathResource,String tenantId) ;
19 |
20 | ProcessDefinitionSource deploy(InputStream inputStream) ;
21 |
22 | ProcessDefinitionSource deploy(InputStream inputStream,String tenantId) ;
23 |
24 | ProcessDefinitionSource deployWithUTF8Content(String uTF8ProcessDefinitionContent) ;
25 |
26 | ProcessDefinitionSource deployWithUTF8Content(String uTF8ProcessDefinitionContent,String tenantId) ;
27 |
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/command/VariableCommandService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.command;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.VariableInstance;
4 |
5 | /**
6 | * 主要变量插入。
7 | *
8 | * @author 高海军 帝奇 2021.02.25
9 | */
10 | public interface VariableCommandService {
11 |
12 | void insert(VariableInstance... variableInstance);
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/param/command/BaseCommand.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.param.command;
2 |
3 | import com.alibaba.smart.framework.engine.service.param.query.PaginateQueryParam;
4 | import lombok.Data;
5 |
6 |
7 | /**
8 | * 基本命令信息
9 | *
10 | * @author yanricheng
11 | * @date 2025/05/13
12 | */
13 | @Data
14 | public class BaseCommand {
15 | protected String tenantId;
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/param/command/CreateDeploymentCommand.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.param.command;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2017 September 21:13.
5 | */
6 |
7 | import lombok.Data;
8 |
9 | @Data
10 | public class CreateDeploymentCommand extends BaseCommand{
11 |
12 | private String processDefinitionType;
13 | private String processDefinitionCode;
14 | private String processDefinitionName;
15 | private String processDefinitionDesc;
16 | private String processDefinitionContent;
17 |
18 | private String deploymentUserId;
19 | private String deploymentStatus;
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/param/command/UpdateDeploymentCommand.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.param.command;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2017 September 21:13.
5 | */
6 |
7 | import lombok.Data;
8 |
9 | @Data
10 | public class UpdateDeploymentCommand extends BaseCommand{
11 |
12 | private String deployInstanceId;
13 |
14 | private String processDefinitionType;
15 | private String processDefinitionName;
16 | private String processDefinitionDesc;
17 | private String processDefinitionContent;
18 |
19 | private String deploymentUserId;
20 | //private String deploymentStatus;
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/param/query/BaseQueryParam.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.param.query;
2 |
3 | import lombok.Data;
4 |
5 |
6 |
7 | /**
8 | * 基本查询信息
9 | *
10 | * @author yanricheng
11 | * @date 2025/05/13
12 | */
13 | @Data
14 | public class BaseQueryParam extends PaginateQueryParam {
15 |
16 | protected String tenantId;
17 |
18 | private Long id;
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/param/query/PaginateQueryParam.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.param.query;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * Created by yueyu.yr on 2017/9/22.
7 | *
8 | * @author yueyu.yr
9 | * @date 2017/09/22
10 | */
11 | @Data
12 |
13 | public class PaginateQueryParam {
14 |
15 | protected Integer pageOffset;
16 | protected Integer pageSize;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/param/query/PendingTaskQueryParam.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.param.query;
2 |
3 | import java.util.List;
4 |
5 | import lombok.Data;
6 | import lombok.EqualsAndHashCode;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2017 October 11:23.
10 | */
11 | @Data
12 | @EqualsAndHashCode(callSuper = true)
13 | public class PendingTaskQueryParam extends BaseQueryParam{
14 |
15 | /**
16 | * 任务处理者的用户Id
17 | */
18 | private String assigneeUserId;
19 |
20 | private List assigneeGroupIdList;
21 |
22 | private String processDefinitionType;
23 |
24 | private List processInstanceIdList;
25 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/param/query/ProcessInstanceQueryParam.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.param.query;
2 |
3 | import java.util.Date;
4 | import java.util.List;
5 |
6 | import lombok.Data;
7 | import lombok.EqualsAndHashCode;
8 |
9 | /**
10 | * Created by yueyu.yr on 2017/9/22.
11 | *
12 | * @author yueyu.yr
13 | * @date 2017/09/22
14 | */
15 | @Data
16 | @EqualsAndHashCode(callSuper = true)
17 | public class ProcessInstanceQueryParam extends BaseQueryParam {
18 |
19 | private String startUserId;
20 | private String status ;
21 | private String processDefinitionType;
22 | private String parentInstanceId;
23 | private String bizUniqueId;
24 | private String processDefinitionIdAndVersion;
25 | /**
26 | * 流程引擎实例id列表
27 | */
28 | private List processInstanceIdList;
29 |
30 | /**
31 | * 查询启动时间在processStartTime之后的流程实例
32 | */
33 | private Date processStartTime;
34 |
35 | /**
36 | * 查询启动时间在processEndTime之前的流程实例
37 | */
38 | private Date processEndTime;
39 | }
40 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/param/query/TaskInstanceQueryByAssigneeParam.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.param.query;
2 |
3 | import java.util.List;
4 |
5 | import lombok.Data;
6 | import lombok.EqualsAndHashCode;
7 |
8 | /**
9 | * Created by jerry.zzy on 2017/11/16.
10 | */
11 | @Data
12 | @EqualsAndHashCode(callSuper = true)
13 | public class TaskInstanceQueryByAssigneeParam extends BaseQueryParam {
14 |
15 | private String assigneeUserId;
16 |
17 | private List assigneeGroupIdList;
18 |
19 | private String processDefinitionType;
20 |
21 | private List processInstanceIdList;
22 |
23 | private String status;
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/param/query/TaskInstanceQueryParam.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.param.query;
2 |
3 | import java.util.Date;
4 | import java.util.List;
5 |
6 | import lombok.Data;
7 | import lombok.EqualsAndHashCode;
8 |
9 |
10 | @Data
11 | @EqualsAndHashCode(callSuper = true)
12 | public class TaskInstanceQueryParam extends BaseQueryParam {
13 |
14 | private List processInstanceIdList;
15 |
16 | private String activityInstanceId;
17 |
18 | private String processDefinitionType;
19 |
20 | private String processDefinitionActivityId;
21 | /**
22 | * @see com.alibaba.smart.framework.engine.constant.TaskInstanceConstant
23 | */
24 | private String status;
25 |
26 | private String claimUserId;
27 |
28 | private String tag;
29 |
30 | private String extension;
31 |
32 | private Integer priority;
33 |
34 | private String comment;
35 |
36 | private String title;
37 |
38 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/query/ActivityQueryService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.query;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.model.instance.ActivityInstance;
6 |
7 | /**
8 | * 流程节点查询服务,主要用来显示流程操作轨迹。
9 | *
10 | * Created by 高海军 帝奇 74394 on 2016 December 11:07.
11 | */
12 | public interface ActivityQueryService {
13 |
14 | /**
15 | * 默认按照时间降序
16 | * @param processInstanceId
17 | * @return
18 | */
19 | List findAll(String processInstanceId);
20 |
21 | List findAll(String processInstanceId,String tenantId);
22 |
23 | //List findAll(Long processInstanceId, boolean asc);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/query/DeploymentQueryService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.query;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.model.instance.DeploymentInstance;
6 | import com.alibaba.smart.framework.engine.service.param.query.DeploymentInstanceQueryParam;
7 |
8 | /**
9 | * 查询流程定义的部署实例。
10 | *
11 | * Created by 高海军 帝奇 74394 on 2017 September 17:15.
12 | */
13 | public interface DeploymentQueryService {
14 |
15 | DeploymentInstance findById(String deploymentInstanceId);
16 | DeploymentInstance findById(String deploymentInstanceId,String tenantId);
17 |
18 | List findList(DeploymentInstanceQueryParam deploymentInstanceQueryParam) ;
19 |
20 | Integer count(DeploymentInstanceQueryParam deploymentInstanceQueryParam);
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/query/ExecutionQueryService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.query;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.model.instance.ExecutionInstance;
6 |
7 | /**
8 | * 查询执行实例。
9 | *
10 | * Created by 高海军 帝奇 74394 on 2016 November 22:08.
11 | */
12 | public interface ExecutionQueryService {
13 |
14 | List findActiveExecutionList(String processInstanceId,String tenantId);
15 | List findActiveExecutionList(String processInstanceId);
16 |
17 | /**
18 | * 默认按照时间降序
19 | * @param processInstanceId
20 | * @return
21 | */
22 | List findAll(String processInstanceId);
23 |
24 | List findAll(String processInstanceId,String tenantId);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/query/ProcessQueryService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.query;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.model.instance.ProcessInstance;
6 | import com.alibaba.smart.framework.engine.service.param.query.ProcessInstanceQueryParam;
7 |
8 | /**
9 | * 查询流程实例。
10 | *
11 | * Created by 高海军 帝奇 74394 on 2016 December 11:07.
12 | */
13 | public interface ProcessQueryService {
14 |
15 | ProcessInstance findById(String processInstanceId);
16 |
17 | ProcessInstance findById(String processInstanceId,String tenantId);
18 |
19 | List findList(ProcessInstanceQueryParam processInstanceQueryParam);
20 |
21 | Long count(ProcessInstanceQueryParam processInstanceQueryParam);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/query/RepositoryQueryService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.query;
2 |
3 | import java.util.Collection;
4 |
5 | import com.alibaba.smart.framework.engine.model.assembly.ProcessDefinition;
6 |
7 | /**
8 | * 获取内存中的流程定义。
9 | *
10 | * Created by 高海军 帝奇 74394 on 2017 June 14:38.
11 | *
12 | */
13 |
14 | public interface RepositoryQueryService {
15 |
16 | ProcessDefinition getCachedProcessDefinition(String processDefinitionId, String version);
17 |
18 | ProcessDefinition getCachedProcessDefinition(String processDefinitionId, String version,String tenantId);
19 |
20 | ProcessDefinition getCachedProcessDefinition(String processDefinitionIdAndVersion);
21 |
22 | Collection getAllCachedProcessDefinition();
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/query/TaskAssigneeQueryService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.query;
2 |
3 | import java.util.List;
4 | import java.util.Map;
5 |
6 | import com.alibaba.smart.framework.engine.model.instance.TaskAssigneeInstance;
7 |
8 | /**
9 | * 任务委托信息
10 | */
11 | public interface TaskAssigneeQueryService {
12 |
13 | List findList(String taskInstanceId);
14 | List findList(String taskInstanceId,String tenantId);
15 |
16 | Map> findAssigneeOfInstanceList(List taskInstanceIdList);
17 | Map> findAssigneeOfInstanceList(List taskInstanceIdList,String tenantId);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/service/query/VariableQueryService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.service.query;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.model.instance.TaskInstance;
6 | import com.alibaba.smart.framework.engine.model.instance.VariableInstance;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2017 October 07:45.
10 | */
11 | public interface VariableQueryService {
12 |
13 | /**
14 | *获取指定流程实例关联的变量数据.
15 | *
16 | */
17 | List findProcessInstanceVariableList(String processInstanceId);
18 | List findProcessInstanceVariableList(String processInstanceId,String tenantId);
19 |
20 | /**
21 | *获取指定流程实例以及对应执行实例关联的变量数据.
22 | *
23 | * @param processInstanceId
24 | * @param executionInstanceId 可以从 @see {@link TaskInstance#getExecutionInstanceId()} 获取
25 | */
26 | List findList(String processInstanceId, String executionInstanceId);
27 | List findList(String processInstanceId, String executionInstanceId,String tenantId);
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/smart/CustomExtensionElement.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.smart;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2020-12-16 15:22.
5 | *
6 | * marker interface,仅是SmartEngine自定义的xml element entity 会实现这个接口
7 | */
8 | public interface CustomExtensionElement {
9 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/smart/PropertiesElementMarker.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.smart;
2 |
3 |
4 | public interface PropertiesElementMarker {
5 |
6 | String getDecoratorType();
7 | }
8 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/smart/Property.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.smart;
2 |
3 | import java.util.Map;
4 |
5 | import com.alibaba.smart.framework.engine.constant.ExtensionElementsConstant;
6 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
7 |
8 | import lombok.Data;
9 |
10 |
11 | @Data
12 | public class Property implements PropertiesElementMarker, NoneIdBasedElement,CustomExtensionElement {
13 |
14 | public final static String xmlLocalPart = "property";
15 |
16 | private String name;
17 | private String value;
18 | private String type;
19 |
20 | private Map attrs;
21 |
22 | @Override
23 | public String getDecoratorType() {
24 | return ExtensionElementsConstant.PROPERTIES;
25 | }
26 |
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/smart/PropertyCompositeKey.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.smart;
2 |
3 | import lombok.Data;
4 |
5 |
6 | @Data
7 | public class PropertyCompositeKey {
8 |
9 | private String type;
10 | private String name;
11 |
12 | public PropertyCompositeKey(String type, String name) {
13 | this.type = type;
14 | this.name = name;
15 | }
16 |
17 | public PropertyCompositeKey( String name) {
18 | this.name = name;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/smart/PropertyCompositeValue.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.smart;
2 |
3 | import java.util.Map;
4 |
5 | import lombok.AllArgsConstructor;
6 | import lombok.Data;
7 |
8 |
9 | @Data
10 | @AllArgsConstructor
11 | public class PropertyCompositeValue {
12 |
13 | private String value;
14 | private Map attrMap;
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/util/ObjectUtil.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.util;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * @author JannLim
7 | * @time 2020/11/17 14:21
8 | */
9 | public class ObjectUtil {
10 |
11 | public static String obj2Str(Object obj) {
12 | return obj == null ? null : obj.toString();
13 | }
14 |
15 | public static Date obj2Date(Object obj) {
16 | if (obj == null) {
17 | return null;
18 | }
19 | if (obj instanceof Date) {
20 | return (Date) obj;
21 | } else if (obj instanceof Long) {
22 | return new Date((Long) obj);
23 | } else {
24 | return null;
25 | }
26 | }
27 |
28 | public static Integer obj2Integer(Object obj) {
29 | if (obj == null) {
30 | return null;
31 | }
32 | return (Integer) obj;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/xml/parser/AttributeParser.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.xml.parser;
2 |
3 | import javax.xml.namespace.QName;
4 | import javax.xml.stream.XMLStreamReader;
5 |
6 | /**
7 | * Created by ettear on 16-4-12.
8 | */
9 | public interface AttributeParser extends BaseXmlParser {
10 |
11 | /**
12 | * Reads a model from an XMLStreamReader.
13 | *
14 | * @param reader The XMLStreamReader
15 | * @param context The context
16 | * @return A model representation of the input.
17 | */
18 | M parseAttribute(QName attributeName, XMLStreamReader reader, ParseContext context);
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/xml/parser/BaseXmlParser.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.xml.parser;
2 |
3 | import com.alibaba.smart.framework.engine.hook.LifeCycleHook;
4 |
5 | /**
6 | * Base interface for artifact parsers. Created by ettear on 16-4-12.
7 | */
8 | public interface BaseXmlParser extends LifeCycleHook {
9 |
10 |
11 | Class getModelType();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/xml/parser/ElementParser.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.xml.parser;
2 |
3 | import javax.xml.stream.XMLStreamException;
4 | import javax.xml.stream.XMLStreamReader;
5 |
6 | /**
7 | * Created by ettear on 16-4-12.
8 | */
9 | public interface ElementParser extends BaseXmlParser {
10 |
11 | /**
12 | * Reads a model from an XMLStreamReader.
13 | *
14 | * @param reader The XMLStreamReader
15 | * @param context The context
16 | * @return A model representation of the input.
17 | */
18 | M parseElement(XMLStreamReader reader, ParseContext context) throws XMLStreamException;
19 | }
20 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/xml/parser/ParseContext.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.xml.parser;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * Created by ettear on 16-4-12.
7 | */
8 | @Data
9 | public class ParseContext {
10 |
11 | private ParseContext parent;
12 | private Object currentElement;
13 |
14 | public ParseContext evolve(Object currentElement){
15 | ParseContext parseContext=new ParseContext();
16 | parseContext.setParent(this);
17 | parseContext.setCurrentElement(currentElement);
18 | return parseContext;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/alibaba/smart/framework/engine/xml/parser/XmlParserFacade.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.xml.parser;
2 |
3 | import javax.xml.namespace.QName;
4 | import javax.xml.stream.XMLStreamReader;
5 |
6 | import com.alibaba.smart.framework.engine.hook.LifeCycleHook;
7 |
8 | /**
9 | * XML处理器扩展点 Created by ettear on 16-4-12.
10 | */
11 | public interface XmlParserFacade extends LifeCycleHook {
12 |
13 | /**
14 | * Reads a model from an XMLStreamReader.
15 | *
16 | * @param reader The XMLStreamReader
17 | * @param context The context
18 | * @return A model representation of the input.
19 | */
20 | Object parseElement(XMLStreamReader reader, ParseContext context);
21 |
22 | /**
23 | * Reads a model from an XMLStreamReader.
24 | *
25 | * @param reader The XMLStreamReader
26 | * @param context The context
27 | * @return A model representation of the input.
28 | */
29 | Object parseAttribute(QName attributeName, XMLStreamReader reader, ParseContext context);
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extendsion/parser/engine/StringField.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extendsion.parser.engine;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import com.alibaba.smart.framework.engine.model.assembly.NoneIdBasedElement;
6 |
7 | import lombok.Data;
8 |
9 | /**
10 | * @author zilong.jiangzl
11 | * @create 2020-07-16 11:41 下午
12 | */
13 | @Data
14 | public class StringField implements NoneIdBasedElement {
15 | static String PROCESS_NS ="http://test.com/process";
16 |
17 | private static final long serialVersionUID = -5129848456612155165L;
18 |
19 | public final static QName qtype = new QName(PROCESS_NS, "string");
20 |
21 | private String value;
22 |
23 |
24 | }
25 |
26 |
27 | /*
28 | static final String ATTRIBUTE_STRING_VALUE = "stringValue";
29 | static final String ATTRIBUTE_JSON_VALUE = "jsonValue";
30 | static final String ATTRIBUTE_INTEGER_VALUE = "integerValue";
31 | static final String ATTRIBUTE_BOOLEAN_VALUE = "booleanValue";
32 | static final String ATTRIBUTE_LONG_VALUE = "longValue";
33 |
34 | */
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extension/scanner/A.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.scanner;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-08-25 22:15.
5 | */
6 | public class A implements Root {
7 | }
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extension/scanner/B.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.scanner;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-08-25 22:15.
5 | */
6 | public class B implements Root {
7 | }
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extension/scanner/BehaviorInternface.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.scanner;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-08-25 22:13.
5 | */
6 | public interface BehaviorInternface {
7 |
8 | void behavior();
9 | }
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extension/scanner/ModelABehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.scanner;
2 |
3 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2019-08-25 22:13.
7 | */
8 | @ExtensionBinding(group = "Behavior", bindKey = A.class)
9 | public class ModelABehavior implements BehaviorInternface {
10 |
11 | @Override
12 | public void behavior() {
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extension/scanner/ModelAParser.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.scanner;
2 |
3 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2019-08-25 22:13.
7 | */
8 | @ExtensionBinding(group = "ELEMENT_PARSER", bindKey = A.class)
9 | public class ModelAParser implements ParserInternface {
10 |
11 | @Override
12 | public void parse() {
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extension/scanner/ModelBBehavior.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.scanner;
2 |
3 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2019-08-25 22:13.
7 | */
8 | @ExtensionBinding(group = "Behavior", bindKey = B.class)
9 | public class ModelBBehavior implements BehaviorInternface {
10 |
11 | @Override
12 | public void behavior() {
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extension/scanner/ModelBParser.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.scanner;
2 |
3 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2019-08-25 22:13.
7 | */
8 | @ExtensionBinding(group = "ELEMENT_PARSER", bindKey = B.class)
9 | public class ModelBParser implements ParserInternface {
10 |
11 | @Override
12 | public void parse() {
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extension/scanner/ParserInternface.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.scanner;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-08-25 22:13.
5 | */
6 | public interface ParserInternface {
7 |
8 | void parse();
9 | }
--------------------------------------------------------------------------------
/core/src/test/java/com/alibaba/smart/framework/engine/extension/scanner/Root.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.extension.scanner;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2019-08-25 22:15.
5 | */
6 | public interface Root {
7 | }
--------------------------------------------------------------------------------
/core/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | ### direct log messages to stdout ###
2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
3 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
4 | log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n
5 | # Root logger option
6 | log4j.rootLogger=WARN,stdout
7 |
8 |
--------------------------------------------------------------------------------
/core/src/test/resources/process-def/callactivity/sub-process-suspend.bpmn20.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/core/src/test/resources/process-def/callactivity/sub-process.bpmn20.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docs/contact/group.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/SmartEngine/8acf58f9668c1efe503cb6cdee6e0fe5901ea391/docs/contact/group.jpg
--------------------------------------------------------------------------------
/docs/contact/me.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/SmartEngine/8acf58f9668c1efe503cb6cdee6e0fe5901ea391/docs/contact/me.jpg
--------------------------------------------------------------------------------
/extension/retry/retry-common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | smart-engine
5 | com.alibaba.smart.framework
6 | 3.6.0-SNAPSHOT
7 | ../../../pom.xml
8 |
9 |
10 | 4.0.0
11 |
12 | smart-engine-extension-retry-common
13 | Smart Engine Extension Retry Common
14 |
15 |
16 |
17 |
18 | ${project.groupId}
19 | smart-engine-core
20 | ${project.version}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/extension/retry/retry-common/src/main/java/com/alibaba/smart/framework/engine/retry/RetryExtensionPoint.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.retry;
2 |
3 | import com.alibaba.smart.framework.engine.hook.LifeCycleHook;
4 |
5 | /**
6 | * @author zhenhong.tzh
7 | * @date 2019-04-27
8 | */
9 | public interface RetryExtensionPoint extends LifeCycleHook {
10 |
11 | /**
12 | * 获取重试扩展点
13 | *
14 | * @param modelType 扩展点类型
15 | * @return 扩展点
16 | */
17 | T getExtensionPoint(Class modelType);
18 | }
19 |
--------------------------------------------------------------------------------
/extension/retry/retry-common/src/main/java/com/alibaba/smart/framework/engine/retry/RetryListener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.retry;
2 |
3 | import com.alibaba.smart.framework.engine.retry.model.instance.RetryRecord;
4 |
5 | /**
6 | * 重试消息监听器
7 | *
8 | * @author zhenhong.tzh
9 | * @date 2019-04-27
10 | */
11 | public interface RetryListener {
12 |
13 | /**
14 | * 监听retry表的更新动作
15 | *
16 | * @param retryRecord 重试对象
17 | */
18 | void onMessage(RetryRecord retryRecord);
19 | }
20 |
--------------------------------------------------------------------------------
/extension/retry/retry-common/src/main/java/com/alibaba/smart/framework/engine/retry/impl/DefaultRetryPersistence.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.retry.impl;
2 |
3 | import java.util.Map;
4 |
5 | import com.alibaba.smart.framework.engine.extension.annotation.ExtensionBinding;
6 | import com.alibaba.smart.framework.engine.extension.constant.ExtensionConstant;
7 | import com.alibaba.smart.framework.engine.retry.service.command.RetryPersistence;
8 |
9 | /**
10 | * @author zhenhong.tzh
11 | * @date 2019-06-03
12 | */
13 | @ExtensionBinding(group = ExtensionConstant.COMMON, bindKey = RetryPersistence.class)
14 |
15 | public class DefaultRetryPersistence implements RetryPersistence {
16 |
17 | @Override
18 | public String serialize(Map params) {
19 | return null;
20 | }
21 |
22 | @Override
23 | public Map deserialize(String params) {
24 | return null;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/extension/retry/retry-common/src/main/java/com/alibaba/smart/framework/engine/retry/model/instance/DefaultRetryRecordInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.retry.model.instance;
2 |
3 | import java.util.Map;
4 |
5 | import lombok.Data;
6 |
7 | /**
8 | * @author zhenhong.tzh
9 | * @date 2019-04-30
10 | */
11 | @Data
12 | public class DefaultRetryRecordInstance implements RetryRecord {
13 | private String instanceId;
14 | private String tenantId;
15 | private int retryTimes;
16 | private boolean retrySuccess;
17 | private Map requestParams;
18 | }
19 |
--------------------------------------------------------------------------------
/extension/retry/retry-common/src/main/java/com/alibaba/smart/framework/engine/retry/service/command/RetryPersistence.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.retry.service.command;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * @author zhenhong.tzh
7 | * @date 2019-06-03
8 | */
9 | public interface RetryPersistence {
10 |
11 | /**
12 | * 把Map形式的param转换成string
13 | *
14 | * @param params 入参
15 | * @return
16 | */
17 | String serialize(Map params);
18 |
19 | /**
20 | * 把string形式的param转换成流程执行所需参数
21 | *
22 | * @param params 入参
23 | * @return
24 | */
25 | Map deserialize(String params);
26 | }
27 |
--------------------------------------------------------------------------------
/extension/retry/retry-common/src/main/java/com/alibaba/smart/framework/engine/retry/service/command/RetryService.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.retry.service.command;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.ProcessInstance;
4 | import com.alibaba.smart.framework.engine.retry.model.instance.RetryRecord;
5 |
6 | /**
7 | * @author zhenhong.tzh
8 | * @date 2019-04-27
9 | */
10 | public interface RetryService {
11 |
12 | /**
13 | * 保存需要重试的流程记录
14 | * @param retryRecord
15 | * @return
16 | */
17 | boolean save(RetryRecord retryRecord);
18 |
19 | ProcessInstance retry(RetryRecord retryRecord);
20 | }
21 |
--------------------------------------------------------------------------------
/extension/retry/retry-custom/src/main/java/com/alibaba/smart/framework/engine/persister/custom/RetryRecordInstance.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.custom;
2 |
3 | import java.util.Map;
4 |
5 | import com.alibaba.smart.framework.engine.retry.model.instance.RetryRecord;
6 |
7 | import lombok.Data;
8 |
9 | /**
10 | * @author zhenhong.tzh
11 | * @date 2019-04-30
12 | */
13 | @Data
14 | public class RetryRecordInstance implements RetryRecord {
15 | private String instanceId;
16 | private String tenantId;
17 | private int retryTimes;
18 | private boolean retrySuccess;
19 | private Map requestParams;
20 | }
21 |
--------------------------------------------------------------------------------
/extension/retry/retry-custom/src/test/java/com/alibaba/smart/framework/engine/retry/RetryDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.retry;
2 |
3 | import java.util.concurrent.atomic.AtomicInteger;
4 |
5 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
6 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
7 |
8 | /**
9 | * @author zhenhong.tzh
10 | * @date 2019-04-30
11 | */
12 | public class RetryDelegation implements JavaDelegation {
13 |
14 | private AtomicInteger retryTimes = new AtomicInteger(0);
15 |
16 | @Override
17 | public void execute(ExecutionContext executionContext) {
18 |
19 | if (retryTimes.getAndIncrement() < 1) {
20 | throw new RuntimeException("Execute occurs error.");
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/extension/retry/retry-custom/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | ### direct log messages to stdout ###
2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
3 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
4 | log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n
5 | # Root logger option
6 | log4j.rootLogger=WARN,stdout
7 | # logger package
8 |
9 |
--------------------------------------------------------------------------------
/extension/retry/retry-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/dao/RetryRecordDAO.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.dao;
2 |
3 | import com.alibaba.smart.framework.engine.persister.database.entity.RetryRecordEntity;
4 |
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * @author zhenhong.tzh
9 | * @date 2019-04-27
10 | */
11 | @Repository
12 | public interface RetryRecordDAO {
13 |
14 | RetryRecordEntity queryByInstanceId(String instanceId);
15 |
16 | Long insert(RetryRecordEntity retryRecordEntity);
17 |
18 | Long update(RetryRecordEntity retryRecordEntity);
19 | }
20 |
--------------------------------------------------------------------------------
/extension/retry/retry-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/entity/RetryRecordEntity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.entity;
2 |
3 | import lombok.Data;
4 | import lombok.EqualsAndHashCode;
5 | import lombok.ToString;
6 |
7 | /**
8 | * @author zhenhong.tzh
9 | * @date 2019-04-30
10 | */
11 | @Data
12 | @EqualsAndHashCode(callSuper = true)
13 | @ToString(callSuper = true)
14 | public class RetryRecordEntity extends BaseProcessEntity {
15 |
16 | private String instanceId;
17 | private int retryTimes;
18 | private boolean retrySuccess;
19 | private String requestParams;
20 | }
21 |
--------------------------------------------------------------------------------
/extension/retry/retry-mysql/src/main/resources/mybatis/mybatis-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/extension/retry/retry-mysql/src/main/resources/sql/retry-schema.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE `se_retry_record` (
2 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
3 | `gmt_create` datetime(6) NOT NULL COMMENT '创建时间',
4 | `gmt_modified` datetime(6) NOT NULL COMMENT '修改时间',
5 | `instance_id` bigint(20) unsigned NOT NULL COMMENT '流程实例id',
6 | `retry_times` bigint(20) unsigned DEFAULT 0 COMMENT '重试次数',
7 | `retry_success` boolean NOT NULL DEFAULT false COMMENT '重试是否成功',
8 | `request_params` varchar(4000) DEFAULT NULL COMMENT '存储请求参数的值',
9 | PRIMARY KEY (`id`)
10 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='重试对象-SmartEngine'
--------------------------------------------------------------------------------
/extension/storage/storage-common/src/main/java/com/alibaba/smart/framework/engine/persister/common/assistant/pojo/ThreadExecutionResult.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.common.assistant.pojo;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 |
6 | /**
7 | * Created by 高海军 帝奇 74394 on 2020-09-07 10:52.
8 | */
9 | @Data
10 | @AllArgsConstructor
11 | public class ThreadExecutionResult {
12 |
13 | private Long threadId;
14 | private Object payload;
15 | }
--------------------------------------------------------------------------------
/extension/storage/storage-common/src/main/java/com/alibaba/smart/framework/engine/persister/common/constant/StorageConstant.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.common.constant;
2 |
3 | /**
4 | * Created by 高海军 帝奇 74394 on 2018 November 11:58.
5 | */
6 | public interface StorageConstant {
7 |
8 | String NOT_IMPLEMENT_INTENTIONALLY = "not implement intentionally";
9 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/smart-engine.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/SmartEngine/8acf58f9668c1efe503cb6cdee6e0fe5901ea391/extension/storage/storage-custom/smart-engine.lock
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/common/expression/evaluator/CustomExpressionEvaluator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.common.expression.evaluator;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2017 February 22:17.
7 | */
8 | public class CustomExpressionEvaluator implements ExpressionEvaluator {
9 | @Override
10 | public Object eval(String expression, Map vars,boolean needCached) {
11 | return true;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/AliPayIdGenerator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test;
2 |
3 | import java.util.concurrent.atomic.AtomicLong;
4 |
5 | import com.alibaba.smart.framework.engine.configuration.IdGenerator;
6 | import com.alibaba.smart.framework.engine.model.instance.Instance;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2017 February 00:02.
10 | */
11 | public class AliPayIdGenerator implements IdGenerator {
12 |
13 | private AtomicLong atomicLong = new AtomicLong(233L);
14 |
15 | @Override
16 | public void generate(Instance instance) {
17 | long l = atomicLong.addAndGet(100L);
18 | String s = l + "";
19 | instance.setInstanceId(s);
20 | // return s;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/EndListener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.listener.Listener;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 |
7 | /**
8 | * @author ettear
9 | * Created by ettear on 06/08/2017.
10 | */
11 | public class EndListener implements Listener {
12 |
13 | @Override
14 | public void execute(EventConstant event,
15 | ExecutionContext executionContext) {
16 | executionContext.getResponse().put("end","end_listener");
17 | executionContext.getResponse().put("endTime", System.currentTimeMillis());
18 | try {
19 | Thread.sleep(500);
20 | } catch (InterruptedException e) {
21 | e.printStackTrace();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/HelloListener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.listener.Listener;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 | import com.alibaba.smart.framework.engine.test.cases.extensions.MultiValueAndHelloListenerTest;
7 |
8 | public class HelloListener implements Listener {
9 | @Override
10 | public void execute(EventConstant event,
11 | ExecutionContext executionContext) {
12 | String text = (String)executionContext.getRequest().get("hello");
13 | MultiValueAndHelloListenerTest.trace.add(text);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/StartListener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.listener.Listener;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 |
7 | /**
8 | * @author ettear
9 | * Created by ettear on 06/08/2017.
10 | */
11 | public class StartListener implements Listener {
12 |
13 | @Override
14 | public void execute(EventConstant event,
15 | ExecutionContext executionContext) {
16 | executionContext.getResponse().put("start","start_listener");
17 | executionContext.getResponse().put("startTime", System.currentTimeMillis());
18 | try {
19 | Thread.sleep(500);
20 | } catch (InterruptedException e) {
21 | e.printStackTrace();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/callcactivity1/CallActivityJavaDelegation1.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.callcactivity1;
2 |
3 | import com.alibaba.smart.framework.engine.annotation.Retryable;
4 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
5 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 |
9 |
10 | @Retryable(delay = 2000, maxAttempts = 1)
11 | public class CallActivityJavaDelegation1 implements JavaDelegation {
12 |
13 | public CallActivityJavaDelegation1(){
14 | logger.info("CallActivityJavaDelegation1 init");
15 | }
16 |
17 | static Logger logger = LoggerFactory.getLogger(CallActivityJavaDelegation1.class);
18 | @Override
19 | public void execute(ExecutionContext executionContext) {
20 | logger.info("==> test111");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/callcactivity1/CallActivityJavaDelegation2.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.callcactivity1;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | public class CallActivityJavaDelegation2 implements JavaDelegation {
9 | Logger logger = LoggerFactory.getLogger(CallActivityJavaDelegation2.class);
10 | @Override
11 | public void execute(ExecutionContext executionContext) {
12 | logger.info("==> test 222");
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/callcactivity1/CallActivityJavaDelegation3.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.callcactivity1;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | public class CallActivityJavaDelegation3 implements JavaDelegation {
9 | Logger logger = LoggerFactory.getLogger(CallActivityJavaDelegation3.class);
10 | @Override
11 | public void execute(ExecutionContext executionContext) {
12 | logger.info("==> test 333");
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/callcactivity2/ParentDelegation1.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.callcactivity2;
2 |
3 | import com.alibaba.smart.framework.engine.annotation.Retryable;
4 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
5 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 |
9 |
10 | public class ParentDelegation1 implements JavaDelegation {
11 |
12 | @Override
13 | public void execute(ExecutionContext executionContext) {
14 | System.out.println("==> ParentDelegation1");
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/callcactivity2/SubDelegation1.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.callcactivity2;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
5 |
6 |
7 | public class SubDelegation1 implements JavaDelegation {
8 |
9 | @Override
10 | public void execute(ExecutionContext executionContext) {
11 | System.out.println("==> SubDelegation1");
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/callcactivity2/SubDelegation2.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.callcactivity2;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
5 |
6 |
7 | public class SubDelegation2 implements JavaDelegation {
8 |
9 | @Override
10 | public void execute(ExecutionContext executionContext) {
11 | System.out.println("==> SubDelegation2");
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/cases/AdvancedExclusvieGatewayProcessTest.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.cases;
2 |
3 | import com.alibaba.smart.framework.engine.model.instance.ExecutionInstance;
4 | import com.alibaba.smart.framework.engine.test.delegation.BasicServiceTaskDelegation;
5 | import com.alibaba.smart.framework.engine.test.delegation.ExclusiveTaskDelegation;
6 |
7 | import org.junit.Test;
8 |
9 | public class AdvancedExclusvieGatewayProcessTest extends CommonTestCode {
10 |
11 | @Override
12 | public void setUp() {
13 | super.setUp();
14 |
15 | BasicServiceTaskDelegation.resetCounter();
16 | ExclusiveTaskDelegation.resetCounter();
17 | }
18 |
19 | @Test
20 | public void test() throws Exception {
21 |
22 | ExecutionInstance executionInstance = commonCodeSnippet("advanced-exclusviegateway-process.bpmn.xml");
23 |
24 |
25 | commonCode(null, executionInstance);
26 |
27 | }
28 |
29 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/cases/BPMNDiagramParserTest.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.cases;
2 |
3 | import com.alibaba.smart.framework.engine.model.assembly.ProcessDefinition;
4 |
5 | import org.junit.Test;
6 |
7 | import static org.junit.Assert.assertEquals;
8 |
9 | /**
10 | * Created by 高海军 帝奇 74394 on 2017 August 09:52.
11 | */
12 | public class BPMNDiagramParserTest extends CustomBaseTestCase {
13 |
14 |
15 | @Test
16 | public void test() throws Exception {
17 |
18 |
19 | ProcessDefinition processDefinition = repositoryCommandService
20 | .deploy("BPMNDiagramParserTest.bpmn.xml").getFirstProcessDefinition();
21 | assertEquals(5, processDefinition.getBaseElementList().size());
22 |
23 | // PersisterSession.destroySession();
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/cases/BasicProcessTest.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.cases;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import com.alibaba.smart.framework.engine.model.instance.ExecutionInstance;
7 | import com.alibaba.smart.framework.engine.test.delegation.BasicServiceTaskDelegation;
8 | import com.alibaba.smart.framework.engine.test.delegation.ExclusiveTaskDelegation;
9 |
10 | import org.junit.Test;
11 | public class BasicProcessTest extends CommonTestCode {
12 |
13 | @Override
14 | public void setUp() {
15 | super.setUp();
16 |
17 | BasicServiceTaskDelegation.resetCounter();
18 | ExclusiveTaskDelegation.resetCounter();
19 | }
20 |
21 | @Test
22 | public void test() throws Exception {
23 |
24 | ExecutionInstance executionInstance = commonCodeSnippet("basic-process.bpmn.xml");
25 |
26 | Map request = new HashMap();
27 | request.put("route", "a");
28 |
29 | commonCode(request, executionInstance);
30 |
31 | }
32 |
33 |
34 |
35 |
36 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/CommonGatewayDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
7 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
8 |
9 | public class CommonGatewayDelegation implements JavaDelegation {
10 |
11 | public void execute(ExecutionContext executionContext) {
12 | Map request = executionContext.getRequest();
13 |
14 | if(null == request){
15 | request = new HashMap();
16 | executionContext.setRequest(request);
17 |
18 | }
19 |
20 | String processDefinitionActivityId = executionContext.getExecutionInstance().getProcessDefinitionActivityId();
21 | request.put(processDefinitionActivityId, processDefinitionActivityId);
22 |
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/ExclusiveGatewayDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
7 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
8 |
9 | public class ExclusiveGatewayDelegation implements JavaDelegation {
10 |
11 | public void execute(ExecutionContext executionContext) {
12 | Map request = executionContext.getRequest();
13 |
14 | if(null == request){
15 | request = new HashMap();
16 | executionContext.setRequest(request);
17 |
18 | }
19 |
20 | request.put("route", "a");
21 |
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/OrchestrationAdapter.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation;
2 |
3 | import java.util.Map;
4 |
5 | public interface OrchestrationAdapter {
6 |
7 | void execute(Map request, Map response);
8 |
9 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/OrchestrationAdapterImplement.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation;
2 |
3 | import java.util.Map;
4 | import java.util.concurrent.atomic.AtomicLong;
5 |
6 | public class OrchestrationAdapterImplement implements OrchestrationAdapter {
7 |
8 | public static AtomicLong counter = new AtomicLong(0);
9 |
10 | public static void resetCounter() {
11 | counter.set(0L);
12 | }
13 |
14 |
15 | @Override
16 | public void execute(Map request, Map response) {
17 | counter.addAndGet(1L);
18 | }
19 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/TccTracker.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.listener.Listener;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 |
7 | /**
8 | * @author ettear
9 | * Created by ettear on 06/08/2017.
10 | */
11 | public class TccTracker implements Listener {
12 |
13 |
14 | @Override
15 | public void execute(EventConstant event,
16 | ExecutionContext executionContext) {
17 | String text = (String)executionContext.getRequest().get("text");
18 |
19 | executionContext.getResponse().put("hello1",text);
20 |
21 | }
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/event/ActivityEndListener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation.event;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.listener.Listener;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 | import com.alibaba.smart.framework.engine.test.cases.CamundaEventTest;
7 |
8 | public class ActivityEndListener implements Listener {
9 | @Override
10 | public void execute(EventConstant event,
11 | ExecutionContext executionContext) {
12 |
13 | CamundaEventTest.container.add("ActivityEndListener");
14 | }
15 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/event/ActivityStartListener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation.event;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.listener.Listener;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 | import com.alibaba.smart.framework.engine.test.cases.CamundaEventTest;
7 |
8 | public class ActivityStartListener implements Listener {
9 | @Override
10 | public void execute(EventConstant event,
11 | ExecutionContext executionContext) {
12 | CamundaEventTest.container.add("ActivityStartListener");
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/event/ProcessEndListener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation.event;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.listener.Listener;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 | import com.alibaba.smart.framework.engine.test.cases.CamundaEventTest;
7 |
8 | public class ProcessEndListener implements Listener {
9 | @Override
10 | public void execute(EventConstant event,
11 | ExecutionContext executionContext) {
12 | CamundaEventTest.container.add("ProcessEndListener");
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/event/ProcessStartListener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation.event;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.listener.Listener;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 | import com.alibaba.smart.framework.engine.test.cases.CamundaEventTest;
7 |
8 | public class ProcessStartListener implements Listener {
9 | @Override
10 | public void execute(EventConstant event,
11 | ExecutionContext executionContext) {
12 | CamundaEventTest.container.add("ProcessStartListener");
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/delegation/event/TakeEventListener.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.delegation.event;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.listener.Listener;
5 | import com.alibaba.smart.framework.engine.pvm.event.EventConstant;
6 | import com.alibaba.smart.framework.engine.test.cases.CamundaEventTest;
7 |
8 | public class TakeEventListener implements Listener {
9 | @Override
10 | public void execute(EventConstant event,
11 | ExecutionContext executionContext) {
12 | CamundaEventTest.container.add("TakeEventListener");
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/demo/dto/OrderDTO.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.demo.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * Created by 高海军 帝奇 74394 on 2017 February 22:42.
7 | */
8 |
9 | @Data
10 | public class OrderDTO {
11 |
12 | private Long orderId;
13 | private String blabla;
14 | }
15 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/parallelgateway/delegation/ChildReceiveTaskDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.parallelgateway.delegation;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
5 |
6 | public class ChildReceiveTaskDelegation implements JavaDelegation {
7 |
8 | @Override
9 | public void execute(ExecutionContext executionContext) {
10 | ChildServiceTaskDelegation.counter.addAndGet(5);
11 | System.out.println("ChildReceiveTaskDelegation");
12 | }
13 |
14 |
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/parallelgateway/delegation/ParentReceiveTaskDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.parallelgateway.delegation;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
5 |
6 | public class ParentReceiveTaskDelegation implements JavaDelegation {
7 |
8 | @Override
9 | public void execute(ExecutionContext executionContext) {
10 | ChildServiceTaskDelegation.counter.addAndGet(7);
11 | System.out.println("ParentReceiveTaskDelegation");
12 |
13 | }
14 |
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/parallelgateway/delegation/ParentServiceTaskDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.parallelgateway.delegation;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
5 |
6 | import java.util.concurrent.atomic.AtomicLong;
7 |
8 | public class ParentServiceTaskDelegation implements JavaDelegation {
9 |
10 | @Override
11 | public void execute(ExecutionContext executionContext) {
12 | ChildServiceTaskDelegation.counter.addAndGet(3);
13 | System.out.println("ParentServiceTaskDelegation");
14 |
15 | }
16 |
17 |
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/parallelgateway/orchestration/delegation/ServiceTaskTimeoutOrchestrationDelegationOne.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.parallelgateway.orchestration.delegation;
2 |
3 | public class ServiceTaskTimeoutOrchestrationDelegationOne extends ServiceTaskTimeoutOrchestrationDelegation {
4 |
5 | @Override
6 | protected int waitTime() {
7 | return 1000;
8 | }
9 |
10 | @Override
11 | protected String taskId() {
12 | return "taskA";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/java/com/alibaba/smart/framework/engine/test/parallelgateway/orchestration/delegation/ServiceTaskTimeoutOrchestrationDelegationTwo.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.parallelgateway.orchestration.delegation;
2 |
3 | public class ServiceTaskTimeoutOrchestrationDelegationTwo extends ServiceTaskTimeoutOrchestrationDelegation {
4 |
5 | @Override
6 | protected int waitTime() {
7 | return 500;
8 | }
9 |
10 | @Override
11 | protected String taskId() {
12 | return "taskB";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/resources/all-retry-servicetask.bpmn.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/resources/child-receivetask-process.bpmn20.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/resources/child-servicetask-process.bpmn20.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/resources/custom-properties.bpmn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | ### direct log messages to stdout ###
2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
3 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
4 | log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n
5 | # Root logger option
6 | log4j.rootLogger=WARN,stdout
7 | # logger package
8 | #log4j.logger.org.springframework=debug,stdout
9 |
10 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/resources/smart-engine/jump1.bpmn20.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/src/test/resources/spring/service-orchestration-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/extension/storage/storage-custom/test.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/SmartEngine/8acf58f9668c1efe503cb6cdee6e0fe5901ea391/extension/storage/storage-custom/test.txt
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/dao/ActivityInstanceDAO.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.dao;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.persister.database.entity.ActivityInstanceEntity;
6 |
7 | import org.apache.ibatis.annotations.Param;
8 | import org.springframework.stereotype.Repository;
9 |
10 | @Repository
11 | public interface ActivityInstanceDAO {
12 | List findAllActivity(@Param("processInstanceId") Long processInstanceId,@Param("tenantId") String tenantId);
13 |
14 | ActivityInstanceEntity findOne(@Param("id") Long id, @Param("tenantId") String tenantId);
15 |
16 |
17 | void insert(ActivityInstanceEntity activityInstanceEntity );
18 |
19 | Long delete(@Param("id") Long id, @Param("tenantId") String tenantId);
20 |
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/dao/TaskAssigneeDAO.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.dao;
2 |
3 | import java.util.List;
4 |
5 | import com.alibaba.smart.framework.engine.persister.database.entity.TaskAssigneeEntity;
6 |
7 | import org.apache.ibatis.annotations.Param;
8 | import org.springframework.stereotype.Repository;
9 |
10 | @Repository
11 | public interface TaskAssigneeDAO {
12 |
13 | List findList(@Param("taskInstanceId")Long taskInstanceId,@Param("tenantId") String tenantId);
14 |
15 | List findListForInstanceList(@Param("taskInstanceIdList") List taskInstanceIdList,@Param("tenantId") String tenantId);
16 |
17 | TaskAssigneeEntity findOne(@Param("id") Long id,@Param("tenantId") String tenantId);
18 |
19 |
20 | void insert( TaskAssigneeEntity taskAssigneeEntity );
21 |
22 | int update(@Param("id") Long id,@Param("assigneeId")String assigneeId,@Param("tenantId") String tenantId);
23 |
24 | void delete(@Param("id") Long id,@Param("tenantId") String tenantId);
25 | }
26 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/entity/ActivityInstanceEntity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.entity;
2 |
3 | import lombok.Data;
4 | import lombok.EqualsAndHashCode;
5 | import lombok.ToString;
6 |
7 | @Data
8 | @EqualsAndHashCode(callSuper = true)
9 | @ToString(callSuper = true)
10 | public class ActivityInstanceEntity extends BaseProcessEntity {
11 |
12 | private Long processInstanceId;
13 |
14 | private String processDefinitionActivityId;
15 |
16 | private String processDefinitionIdAndVersion;
17 | }
18 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/entity/BaseProcessEntity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.entity;
2 |
3 | import java.util.Date;
4 |
5 | import lombok.Data;
6 |
7 | @Data
8 | public class BaseProcessEntity {
9 | protected Long id;
10 |
11 | protected String tenantId;
12 |
13 | protected Date gmtCreate;
14 |
15 | protected Date gmtModified;
16 |
17 |
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/entity/DeploymentInstanceEntity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.entity;
2 |
3 | import lombok.Data;
4 | import lombok.EqualsAndHashCode;
5 | import lombok.ToString;
6 |
7 | /**
8 | * Created by yueyu.yr on 2017/9/22.
9 | *
10 | * @author yueyu.yr
11 | * @date 2017/09/22
12 | */
13 | @Data
14 | @EqualsAndHashCode(callSuper = true)
15 | @ToString(callSuper = true)
16 | public class DeploymentInstanceEntity extends BaseProcessEntity {
17 |
18 | private String processDefinitionId;
19 |
20 | private String processDefinitionVersion;
21 |
22 | private String processDefinitionType;
23 |
24 | private String processDefinitionCode;
25 |
26 | private String processDefinitionName;
27 |
28 | private String processDefinitionDesc;
29 |
30 | private String processDefinitionContent;
31 |
32 | private String deploymentUserId;
33 |
34 | private String deploymentStatus;
35 |
36 | private String logicStatus;
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/entity/ExecutionInstanceEntity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.entity;
2 |
3 | import lombok.Data;
4 | import lombok.EqualsAndHashCode;
5 | import lombok.ToString;
6 |
7 | @Data
8 | @EqualsAndHashCode(callSuper = true)
9 | @ToString(callSuper = true)
10 | public class ExecutionInstanceEntity extends BaseProcessEntity {
11 |
12 |
13 | private Long processInstanceId;
14 |
15 | private String processDefinitionIdAndVersion;
16 |
17 | private String processDefinitionActivityId;
18 |
19 | private Long activityInstanceId;
20 |
21 | private String incomeTransitionId;
22 |
23 | private Long incomeActivityInstanceId;
24 |
25 | private Long blockId;
26 |
27 | private boolean active;
28 | }
29 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/entity/ProcessInstanceEntity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.entity;
2 |
3 | import lombok.Data;
4 | import lombok.EqualsAndHashCode;
5 | import lombok.ToString;
6 |
7 | @Data
8 | @EqualsAndHashCode(callSuper = true)
9 | @ToString(callSuper = true)
10 | public class ProcessInstanceEntity extends BaseProcessEntity {
11 |
12 | private String processDefinitionIdAndVersion;
13 |
14 | private String startUserId;
15 |
16 | private Long parentProcessInstanceId;
17 |
18 | private Long parentExecutionInstanceId;
19 |
20 | private String status;
21 |
22 | private String processDefinitionType;
23 |
24 | private String bizUniqueId;
25 |
26 | private String reason;
27 |
28 | private String title;
29 |
30 | private String tag;
31 |
32 | private String comment;
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/entity/TaskAssigneeEntity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.entity;
2 |
3 | import lombok.Data;
4 | import lombok.EqualsAndHashCode;
5 | import lombok.ToString;
6 |
7 | @Data
8 | @EqualsAndHashCode(callSuper = true)
9 | @ToString(callSuper = true)
10 | public class TaskAssigneeEntity extends BaseProcessEntity {
11 |
12 | private Long processInstanceId;
13 |
14 | private Long taskInstanceId;
15 |
16 |
17 | private String assigneeId;
18 |
19 | private String assigneeType;
20 |
21 | //private Integer priority;
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/java/com/alibaba/smart/framework/engine/persister/database/entity/VariableInstanceEntity.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.entity;
2 |
3 | import lombok.Data;
4 | import lombok.EqualsAndHashCode;
5 | import lombok.ToString;
6 |
7 | @Data
8 | @EqualsAndHashCode(callSuper = true)
9 | @ToString(callSuper = true)
10 | public class VariableInstanceEntity extends BaseProcessEntity {
11 |
12 | private Long processInstanceId;
13 |
14 | private Long executionInstanceId;
15 |
16 | private String fieldKey;
17 |
18 | private String fieldType;
19 |
20 | private Long fieldLongValue;
21 |
22 | private Double fieldDoubleValue;
23 |
24 | private String fieldStringValue;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/main/resources/mybatis/mybatis-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/java/com/alibaba/smart/framework/engine/persister/database/dao/BaseElementTest.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.persister.database.dao;
2 |
3 | import org.junit.runner.RunWith;
4 | import org.springframework.test.context.ContextConfiguration;
5 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
6 | import org.springframework.transaction.annotation.Transactional;
7 |
8 | @ContextConfiguration("/spring/application-test.xml")
9 | @RunWith(SpringJUnit4ClassRunner.class)
10 | @Transactional
11 | public abstract class BaseElementTest {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/java/com/alibaba/smart/framework/engine/test/process/H2ConsoleDebugTest.java:
--------------------------------------------------------------------------------
1 | //package com.alibaba.smart.framework.engine.test.process;
2 | //
3 | //import org.h2.tools.Server;
4 | //import org.junit.jupiter.api.*;
5 | //
6 | //import java.sql.SQLException;
7 | //
8 | //public class H2ConsoleDebugTest {
9 | //
10 | // static Server webServer;
11 | //
12 | // @BeforeAll
13 | // public static void startH2Console() throws SQLException {
14 | // webServer = Server.createWebServer("-web", "-webAllowOthers", "-webPort", "8082").start();
15 | // System.out.println("H2 Console started at http://localhost:8082");
16 | // }
17 | //
18 | // @AfterAll
19 | // public static void stopH2Console() {
20 | // if (webServer != null) webServer.stop();
21 | // }
22 | //
23 | // @Test
24 | // public void testWithConsole() throws InterruptedException {
25 | // System.out.println("Keep the test running to inspect H2 console...");
26 | // Thread.sleep(600000); // 保持 JVM 活着,用于手动调试
27 | // }
28 | //}
29 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/java/com/alibaba/smart/framework/engine/test/process/bean/Order.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.process.bean;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class Order {
7 |
8 |
9 | private Double yzje;
10 |
11 | }
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/java/com/alibaba/smart/framework/engine/test/process/bean/TestUser.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.process.bean;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by 高海军 帝奇 74394 on 2017 October 09:43.
9 | */
10 | @Data
11 | @AllArgsConstructor
12 | @NoArgsConstructor
13 | public class TestUser {
14 | private String userName;
15 | private String password;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/java/com/alibaba/smart/framework/engine/test/process/delegation/ReceiverTaskDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.process.delegation;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
5 | import lombok.Getter;
6 | import org.springframework.stereotype.Service;
7 |
8 | import java.util.Map;
9 | import java.util.concurrent.CopyOnWriteArrayList;
10 |
11 | @Service
12 | public class ReceiverTaskDelegation implements JavaDelegation {
13 |
14 |
15 | @Getter
16 | private static CopyOnWriteArrayList arrayList = new CopyOnWriteArrayList();
17 |
18 | @Override
19 | public void execute(ExecutionContext executionContext) {
20 | Map request = executionContext.getRequest();
21 | if (null != request) {
22 | Object o = request.get("input");
23 | if (o != null) {
24 | String input = o.toString();
25 | arrayList.add(input);
26 | }
27 | }
28 |
29 | }
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/java/com/alibaba/smart/framework/engine/test/process/delegation/UserTaskTestDelegation.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.process.delegation;
2 |
3 | import com.alibaba.smart.framework.engine.context.ExecutionContext;
4 | import com.alibaba.smart.framework.engine.delegation.JavaDelegation;
5 | import com.alibaba.smart.framework.engine.test.process.VariableInstanceAndMultiInstanceTest;
6 | import org.springframework.stereotype.Service;
7 |
8 | /**
9 | * @author ettear
10 | * Created by ettear on 06/08/2017.
11 | */
12 | @Service
13 | public class UserTaskTestDelegation implements JavaDelegation {
14 |
15 |
16 | @Override
17 | public void execute(ExecutionContext executionContext) {
18 | String text= (String)executionContext.getRequest().get("text");
19 |
20 | VariableInstanceAndMultiInstanceTest.trace.add(text);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/java/com/alibaba/smart/framework/engine/test/process/helper/CustomExceptioinProcessor.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.process.helper;
2 |
3 | import com.alibaba.smart.framework.engine.configuration.ExceptionProcessor;
4 |
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2016 December 11:13.
10 | */
11 | public class CustomExceptioinProcessor implements ExceptionProcessor {
12 |
13 | private static final Logger LOGGER = LoggerFactory.getLogger(CustomExceptioinProcessor.class);
14 |
15 | @Override
16 | public void process(Exception exception,Object context) {
17 | LOGGER.error(exception.getMessage(),exception);
18 |
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/java/com/alibaba/smart/framework/engine/test/process/helper/TimeBasedIdGenerator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.process.helper;
2 |
3 | import java.util.concurrent.atomic.AtomicLong;
4 |
5 | import com.alibaba.smart.framework.engine.configuration.IdGenerator;
6 | import com.alibaba.smart.framework.engine.model.instance.Instance;
7 |
8 | /**
9 | * Created by 高海军 帝奇 74394 on 2017 February 00:02.
10 | */
11 | public class TimeBasedIdGenerator implements IdGenerator {
12 |
13 | private static AtomicLong temp = new AtomicLong(0);
14 |
15 | @Override
16 | public void generate(Instance instance) {
17 | String s = System.currentTimeMillis() + temp.getAndIncrement() + "";
18 | instance.setInstanceId(s);
19 | // return s;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/java/com/alibaba/smart/framework/engine/test/process/helper/sequece/RandomIdGenerator.java:
--------------------------------------------------------------------------------
1 | package com.alibaba.smart.framework.engine.test.process.helper.sequece;
2 |
3 | import java.util.Random;
4 | import java.util.concurrent.atomic.AtomicLong;
5 |
6 | import com.alibaba.smart.framework.engine.configuration.IdGenerator;
7 | import com.alibaba.smart.framework.engine.model.instance.Instance;
8 |
9 | /**
10 | * Created by 高海军 帝奇 74394 on 2017 February 23:17.
11 | *
12 | * 不建议在生产环境中使用。
13 | */
14 | public class RandomIdGenerator implements IdGenerator{
15 |
16 |
17 | private static AtomicLong executionId = new AtomicLong(System.currentTimeMillis());
18 |
19 | @Override
20 | public void generate(Instance instance) {
21 | String s = String.valueOf(executionId.incrementAndGet());
22 | instance.setInstanceId(s);
23 | // return s;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/resources/complex/child-receiveTaskCallActivity.bpmn20.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/resources/datasource.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/SmartEngine/8acf58f9668c1efe503cb6cdee6e0fe5901ea391/extension/storage/storage-mysql/src/test/resources/datasource.properties
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | ### direct log messages to stdout ###
2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
3 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
4 | log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n
5 | # Root logger option
6 | log4j.rootLogger=debug,stdout
7 | # logger package
8 |
9 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/resources/mybatis/mybatis-test-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/extension/storage/storage-mysql/src/test/resources/user-task-id-and-group-test.bpmn20.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------