├── .gitignore ├── LICENSE ├── README.md ├── doc ├── img │ ├── 02de6f93f1d4bd9d2455e86627df5f46.png │ ├── 19afbf405383b31346d5a4abb93b98c6.png │ ├── 3fb4b3b69521dfa150d70c1df6cea2f6.png │ ├── 4a307fbca5c72f84e9fb044558432b5d.png │ ├── 6e987e71c8ba092da1535c84fb805b2c.png │ ├── 715eec8e04f7a5fb754e796f7cb3888f.png │ ├── 9efe98c660476585e7e5fedb63067988.png │ ├── bb15ea631b20a48b77b5b9f0ffb080d7.png │ ├── bb7caec5a2d88f337dfe7a8276be1c33.png │ └── pr │ │ ├── pr-1.1.png │ │ ├── pr-1.2.png │ │ ├── pr-1.3.png │ │ ├── pr-3.1.png │ │ ├── pr-4.1.png │ │ ├── pr-4.2.png │ │ ├── pr-5.1.png │ │ ├── pr-5.2.png │ │ ├── pr-6.1.png │ │ ├── pr-6.2.png │ │ └── pr-6.3.png └── join-and-coding.md ├── kstry-core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── cn │ │ │ └── kstry │ │ │ └── framework │ │ │ └── core │ │ │ ├── annotation │ │ │ ├── CustomRole.java │ │ │ ├── EnableKstry.java │ │ │ ├── Invoke.java │ │ │ ├── Iterator.java │ │ │ ├── Limiter.java │ │ │ ├── NoticeResult.java │ │ │ ├── NoticeScope.java │ │ │ ├── NoticeSta.java │ │ │ ├── NoticeVar.java │ │ │ ├── ReqTaskField.java │ │ │ ├── ReqTaskParam.java │ │ │ ├── SpringInitialization.java │ │ │ ├── StaTaskField.java │ │ │ ├── StaTaskParam.java │ │ │ ├── TaskComponent.java │ │ │ ├── TaskField.java │ │ │ ├── TaskInstruct.java │ │ │ ├── TaskParam.java │ │ │ ├── TaskService.java │ │ │ ├── VarTaskField.java │ │ │ └── VarTaskParam.java │ │ │ ├── bpmn │ │ │ ├── BaseElement.java │ │ │ ├── BpmnElement.java │ │ │ ├── EndEvent.java │ │ │ ├── Event.java │ │ │ ├── ExclusiveGateway.java │ │ │ ├── FlowElement.java │ │ │ ├── Gateway.java │ │ │ ├── InclusiveGateway.java │ │ │ ├── ParallelGateway.java │ │ │ ├── SequenceFlow.java │ │ │ ├── ServiceTask.java │ │ │ ├── StartEvent.java │ │ │ ├── SubProcess.java │ │ │ ├── Task.java │ │ │ ├── enums │ │ │ │ ├── BpmnTypeEnum.java │ │ │ │ └── IterateStrategyEnum.java │ │ │ ├── extend │ │ │ │ ├── AggregationFlowElement.java │ │ │ │ ├── AsyncFlowElement.java │ │ │ │ ├── ElementIterable.java │ │ │ │ └── ServiceTaskSupport.java │ │ │ └── impl │ │ │ │ ├── BaseElementImpl.java │ │ │ │ ├── BasicAsyncFlowElement.java │ │ │ │ ├── BasicElementIterable.java │ │ │ │ ├── BpmnElementImpl.java │ │ │ │ ├── EndEventImpl.java │ │ │ │ ├── EventImpl.java │ │ │ │ ├── ExclusiveGatewayImpl.java │ │ │ │ ├── FlowElementImpl.java │ │ │ │ ├── GatewayImpl.java │ │ │ │ ├── InclusiveGatewayImpl.java │ │ │ │ ├── ParallelGatewayImpl.java │ │ │ │ ├── SequenceFlowExpression.java │ │ │ │ ├── SequenceFlowImpl.java │ │ │ │ ├── ServiceTaskImpl.java │ │ │ │ ├── StartEventImpl.java │ │ │ │ ├── SubProcessImpl.java │ │ │ │ ├── TaskImpl.java │ │ │ │ └── TaskParamWrapper.java │ │ │ ├── bus │ │ │ ├── BasicStoryBus.java │ │ │ ├── ContextStoryBus.java │ │ │ ├── EnhancedDataOperator.java │ │ │ ├── ExpressionBus.java │ │ │ ├── InScopeData.java │ │ │ ├── InstructContent.java │ │ │ ├── IterDataItem.java │ │ │ ├── OperatorStoryBus.java │ │ │ ├── ScopeData.java │ │ │ ├── ScopeDataNotice.java │ │ │ ├── ScopeDataOperator.java │ │ │ ├── ScopeDataQuery.java │ │ │ └── StoryBus.java │ │ │ ├── component │ │ │ ├── bpmn │ │ │ │ ├── BpmnProcessParser.java │ │ │ │ ├── CamundaProcessModelTransfer.java │ │ │ │ ├── DiagramTraverseSupport.java │ │ │ │ ├── ProcessDiagramRegister.java │ │ │ │ ├── ProcessModelTransfer.java │ │ │ │ ├── ProcessParser.java │ │ │ │ ├── SerializeProcessParser.java │ │ │ │ ├── builder │ │ │ │ │ ├── ExclusiveGatewayBuilder.java │ │ │ │ │ ├── InclusiveJoinPointBuilder.java │ │ │ │ │ ├── IterablePropertyBuilder.java │ │ │ │ │ ├── ParallelJoinPointBuilder.java │ │ │ │ │ ├── ServiceTaskBuilder.java │ │ │ │ │ ├── SubProcessBuilder.java │ │ │ │ │ └── SubProcessLink.java │ │ │ │ ├── joinpoint │ │ │ │ │ ├── DiagramJoinPoint.java │ │ │ │ │ ├── EndJoinPoint.java │ │ │ │ │ ├── InclusiveJoinPoint.java │ │ │ │ │ └── ParallelJoinPoint.java │ │ │ │ ├── lambda │ │ │ │ │ ├── LambdaParam.java │ │ │ │ │ └── LambdaServiceSupport.java │ │ │ │ └── link │ │ │ │ │ ├── BpmnDiagramLink.java │ │ │ │ │ ├── BpmnElementDiagramLink.java │ │ │ │ │ ├── ProcessLink.java │ │ │ │ │ ├── StartDiagramProcessLink.java │ │ │ │ │ ├── StartProcessLink.java │ │ │ │ │ ├── SubBpmnLink.java │ │ │ │ │ └── SubDiagramBpmnLink.java │ │ │ ├── conversion │ │ │ │ ├── TypeConverter.java │ │ │ │ ├── TypeConverterProcessor.java │ │ │ │ └── converter │ │ │ │ │ ├── BasicTypeConverter.java │ │ │ │ │ ├── CollectionGenericTypeConverter.java │ │ │ │ │ ├── Date2StringTypeConverter.java │ │ │ │ │ ├── FirstItemFromListTypeConverter.java │ │ │ │ │ ├── LocalDateTime2StringTypeConverter.java │ │ │ │ │ ├── Object2BooleanTypeConverter.java │ │ │ │ │ ├── OneItem2ListTypeConverter.java │ │ │ │ │ ├── OneItem2SetTypeConverter.java │ │ │ │ │ ├── String2DateTypeConverter.java │ │ │ │ │ └── String2LocalDateTimeTypeConverter.java │ │ │ ├── demotion │ │ │ │ └── GlobalServiceDemotion.java │ │ │ ├── dynamic │ │ │ │ ├── DynamicComponent.java │ │ │ │ ├── KValueDynamicComponent.java │ │ │ │ ├── ProcessDynamicComponent.java │ │ │ │ ├── RoleDynamicComponent.java │ │ │ │ ├── SpringDynamicComponent.java │ │ │ │ ├── SubProcessDynamicComponent.java │ │ │ │ └── creator │ │ │ │ │ ├── ComponentCacheSupport.java │ │ │ │ │ ├── DynamicComponentCreator.java │ │ │ │ │ ├── DynamicKValue.java │ │ │ │ │ ├── DynamicProcess.java │ │ │ │ │ ├── DynamicRole.java │ │ │ │ │ └── DynamicSubProcess.java │ │ │ ├── event │ │ │ │ ├── TrackingBeginEvent.java │ │ │ │ └── TrackingFinishEvent.java │ │ │ ├── expression │ │ │ │ ├── BasicExpressionAliasRegister.java │ │ │ │ ├── BooleanConditionExpression.java │ │ │ │ ├── ConditionExpression.java │ │ │ │ ├── ConditionExpressionImpl.java │ │ │ │ ├── Exp.java │ │ │ │ ├── Expression.java │ │ │ │ ├── ExpressionAlias.java │ │ │ │ ├── ExpressionAliasParser.java │ │ │ │ ├── ExpressionAliasRegister.java │ │ │ │ ├── RoleConditionExpression.java │ │ │ │ └── SpelConditionExpression.java │ │ │ ├── hook │ │ │ │ ├── AsyncFlowHook.java │ │ │ │ ├── Hook.java │ │ │ │ └── SimpleHook.java │ │ │ ├── instruct │ │ │ │ ├── JsScriptInstruct.java │ │ │ │ └── JsScriptProperty.java │ │ │ ├── jsprocess │ │ │ │ ├── metadata │ │ │ │ │ ├── JsonNode.java │ │ │ │ │ ├── JsonNodeProperties.java │ │ │ │ │ ├── JsonProcess.java │ │ │ │ │ └── JsonPropertySupport.java │ │ │ │ └── transfer │ │ │ │ │ ├── JsonProcessModelTransfer.java │ │ │ │ │ ├── JsonProcessParser.java │ │ │ │ │ ├── JsonSerializeIterator.java │ │ │ │ │ └── JsonSerializeProcessParser.java │ │ │ ├── launcher │ │ │ │ ├── BasicLauncher.java │ │ │ │ ├── ComponentImportSelector.java │ │ │ │ ├── ConfigResourceResolver.java │ │ │ │ ├── KstryContextResolver.java │ │ │ │ ├── SpringProcessDiagramRegister.java │ │ │ │ └── TypeConverterRegister.java │ │ │ ├── limiter │ │ │ │ ├── BasicNodeRateLimiter.java │ │ │ │ ├── LocalSingleNodeRateLimiter.java │ │ │ │ ├── NodeRateLimiter.java │ │ │ │ ├── RateLimiterBuilder.java │ │ │ │ ├── RateLimiterComponent.java │ │ │ │ ├── RateLimiterConfig.java │ │ │ │ └── strategy │ │ │ │ │ ├── DemotionFailAcquireStrategy.java │ │ │ │ │ ├── ExceptionFailAcquireStrategy.java │ │ │ │ │ ├── FailAcquireStrategy.java │ │ │ │ │ └── IgnoreFailAcquireStrategy.java │ │ │ ├── preheat │ │ │ │ ├── PreheatProcessDef.java │ │ │ │ ├── StoryEnginePreheatService.java │ │ │ │ └── TriggerProcessPreheat.java │ │ │ ├── strategy │ │ │ │ ├── PeekStrategy.java │ │ │ │ └── PeekStrategyRepository.java │ │ │ ├── utils │ │ │ │ ├── BasicInStack.java │ │ │ │ └── InStack.java │ │ │ └── validator │ │ │ │ └── RequestValidator.java │ │ │ ├── constant │ │ │ ├── BpmnElementProperties.java │ │ │ ├── ConfigPropertyNameConstant.java │ │ │ ├── GlobalConstant.java │ │ │ ├── GlobalProperties.java │ │ │ └── TypeConverterNames.java │ │ │ ├── container │ │ │ ├── ComponentLifecycle.java │ │ │ ├── component │ │ │ │ ├── InvokeProperties.java │ │ │ │ ├── MethodWrapper.java │ │ │ │ ├── NoticeAnnotationWrapper.java │ │ │ │ ├── ParamInjectDef.java │ │ │ │ ├── SpringTaskComponentRepository.java │ │ │ │ ├── TaskComponentRepository.java │ │ │ │ ├── TaskContainer.java │ │ │ │ ├── TaskInstructWrapper.java │ │ │ │ └── TaskServiceDef.java │ │ │ ├── element │ │ │ │ ├── BasicStartEventContainer.java │ │ │ │ └── StartEventContainer.java │ │ │ ├── processor │ │ │ │ ├── ExpressionParserProcessor.java │ │ │ │ ├── ImmutablePostProcessor.java │ │ │ │ ├── IterablePostProcessor.java │ │ │ │ ├── MainProcessPostProcessor.java │ │ │ │ ├── MarkIndexPostProcessor.java │ │ │ │ ├── RearrangeFlowPostProcessor.java │ │ │ │ ├── StartEventPostProcessor.java │ │ │ │ ├── StartEventProcessor.java │ │ │ │ └── VerifyFlowPostProcessor.java │ │ │ └── task │ │ │ │ ├── RootTaskService.java │ │ │ │ ├── TaskComponentRegister.java │ │ │ │ ├── TaskServiceWrapper.java │ │ │ │ └── impl │ │ │ │ ├── AbilityTaskServiceWrapper.java │ │ │ │ ├── RootTaskServiceWrapper.java │ │ │ │ ├── TaskComponentProxy.java │ │ │ │ └── TaskComponentRegisterWrapper.java │ │ │ ├── engine │ │ │ ├── BasicTaskCore.java │ │ │ ├── FlowRegister.java │ │ │ ├── FlowTaskCore.java │ │ │ ├── ParamLifecycle.java │ │ │ ├── SpringParamLifecycle.java │ │ │ ├── StoryEngine.java │ │ │ ├── StoryEngineModule.java │ │ │ ├── TaskParamParser.java │ │ │ ├── facade │ │ │ │ ├── ReqBuilder.java │ │ │ │ ├── StoryRequest.java │ │ │ │ ├── TaskResponse.java │ │ │ │ └── TaskResponseBox.java │ │ │ ├── future │ │ │ │ ├── AdminFuture.java │ │ │ │ ├── AdminTaskFuture.java │ │ │ │ ├── CancelableFuture.java │ │ │ │ ├── FlowFuture.java │ │ │ │ ├── FlowTaskFuture.java │ │ │ │ ├── FlowTaskSubscriber.java │ │ │ │ ├── FragmentFuture.java │ │ │ │ ├── FragmentTaskFuture.java │ │ │ │ ├── InvokeFuture.java │ │ │ │ ├── MainTaskFuture.java │ │ │ │ ├── MethodInvokeFuture.java │ │ │ │ ├── MonoFlowFuture.java │ │ │ │ ├── MonoFlowTaskFuture.java │ │ │ │ └── RetryFlowTaskSubscriber.java │ │ │ ├── interceptor │ │ │ │ ├── Iter.java │ │ │ │ ├── IterData.java │ │ │ │ ├── SubProcessIdentity.java │ │ │ │ ├── SubProcessInterceptor.java │ │ │ │ ├── SubProcessInterceptorRepository.java │ │ │ │ ├── TaskInterceptor.java │ │ │ │ └── TaskInterceptorRepository.java │ │ │ └── thread │ │ │ │ ├── EndTaskPedometer.java │ │ │ │ ├── FlowTask.java │ │ │ │ ├── FragmentTask.java │ │ │ │ ├── InvokeMethodThreadLocal.java │ │ │ │ ├── KstryThreadLocal.java │ │ │ │ ├── MainFlowTask.java │ │ │ │ ├── MethodInvokeTask.java │ │ │ │ ├── MonoFlowTask.java │ │ │ │ ├── Task.java │ │ │ │ ├── TaskExecutor.java │ │ │ │ ├── TaskServiceExecutor.java │ │ │ │ ├── ThreadLocalSwitch.java │ │ │ │ └── hook │ │ │ │ ├── ThreadLocalSwitchHook.java │ │ │ │ ├── ThreadSwitchHook.java │ │ │ │ ├── ThreadSwitchHookProcessor.java │ │ │ │ ├── ThreadSwitchLogHook.java │ │ │ │ └── TraceLog.java │ │ │ ├── enums │ │ │ ├── AsyncTaskState.java │ │ │ ├── DynamicComponentType.java │ │ │ ├── ElementAllowNextEnum.java │ │ │ ├── ExceptionTypeEnum.java │ │ │ ├── ExecutorType.java │ │ │ ├── IdentityTypeEnum.java │ │ │ ├── PermissionType.java │ │ │ ├── ResourceTypeEnum.java │ │ │ ├── ScopeTypeEnum.java │ │ │ ├── ServiceNodeType.java │ │ │ ├── SourceTypeEnum.java │ │ │ └── TrackingTypeEnum.java │ │ │ ├── exception │ │ │ ├── BusinessException.java │ │ │ ├── ExceptionEnum.java │ │ │ ├── ExpressionException.java │ │ │ ├── KstryComponentException.java │ │ │ ├── KstryException.java │ │ │ ├── NodeInvokeException.java │ │ │ ├── RateLimiterException.java │ │ │ ├── ResourceException.java │ │ │ ├── StoryException.java │ │ │ ├── TaskAsyncException.java │ │ │ ├── TaskTimeoutException.java │ │ │ └── ViolationException.java │ │ │ ├── kv │ │ │ ├── BasicKValue.java │ │ │ ├── BasicKvAbility.java │ │ │ ├── BasicKvSelector.java │ │ │ ├── DynamicKvAbility.java │ │ │ ├── KValue.java │ │ │ ├── KvAbility.java │ │ │ ├── KvScope.java │ │ │ ├── KvScopeProfile.java │ │ │ └── KvSelector.java │ │ │ ├── monitor │ │ │ ├── CycleTracking.java │ │ │ ├── DemotionInfo.java │ │ │ ├── ExpressionTracking.java │ │ │ ├── FieldSerializeTracking.java │ │ │ ├── FieldTracking.java │ │ │ ├── IterateInfo.java │ │ │ ├── LimiterTracking.java │ │ │ ├── MonitorTracking.java │ │ │ ├── NodeTracking.java │ │ │ ├── NoticeTracking.java │ │ │ ├── ParamTracking.java │ │ │ ├── RecallStory.java │ │ │ ├── SerializeTracking.java │ │ │ ├── ThreadPoolMonitor.java │ │ │ └── TrackingStack.java │ │ │ ├── resource │ │ │ ├── config │ │ │ │ ├── AbstractConfigResource.java │ │ │ │ ├── BasicProcessConfigResource.java │ │ │ │ ├── BasicPropertiesConfigResource.java │ │ │ │ ├── ClassPathConfigSource.java │ │ │ │ ├── ConfigResource.java │ │ │ │ ├── ConfigSource.java │ │ │ │ ├── MultiProtocolProcessConfigResource.java │ │ │ │ ├── ProcessClassPathConfigSource.java │ │ │ │ ├── ProcessConfigResource.java │ │ │ │ ├── ProcessDiagramConfigSource.java │ │ │ │ ├── PropertiesClassPathConfigSource.java │ │ │ │ └── PropertiesConfigResource.java │ │ │ ├── factory │ │ │ │ ├── BasicResourceFactory.java │ │ │ │ ├── KValueFactory.java │ │ │ │ ├── ResourceFactory.java │ │ │ │ └── StartEventFactory.java │ │ │ ├── identity │ │ │ │ ├── BasicIdentity.java │ │ │ │ └── Identity.java │ │ │ └── service │ │ │ │ ├── RoleMatchResource.java │ │ │ │ ├── ServiceNodeIdentity.java │ │ │ │ ├── ServiceNodeResource.java │ │ │ │ ├── ServiceNodeResourceAuth.java │ │ │ │ └── ServiceNodeResourceItem.java │ │ │ ├── role │ │ │ ├── BasicRole.java │ │ │ ├── BusinessRole.java │ │ │ ├── BusinessRoleRegister.java │ │ │ ├── BusinessRoleRepository.java │ │ │ ├── Role.java │ │ │ ├── ServiceTaskRole.java │ │ │ └── permission │ │ │ │ ├── Permission.java │ │ │ │ ├── PermissionAuth.java │ │ │ │ └── SimplePermission.java │ │ │ └── util │ │ │ ├── AssertUtil.java │ │ │ ├── AsyncTaskUtil.java │ │ │ ├── CustomRoleInfo.java │ │ │ ├── ElementParserUtil.java │ │ │ ├── ElementPropertyUtil.java │ │ │ ├── ExceptionUtil.java │ │ │ ├── ExpressionAliasUtil.java │ │ │ ├── GlobalUtil.java │ │ │ ├── KValueUtil.java │ │ │ ├── KeyUtil.java │ │ │ ├── LambdaUtil.java │ │ │ ├── PermissionUtil.java │ │ │ ├── PropertyUtil.java │ │ │ ├── ProxyUtil.java │ │ │ ├── ResourceUtil.java │ │ │ └── TaskServiceUtil.java │ └── resources │ │ └── META-INF │ │ └── spring-configuration-metadata.json │ └── test │ ├── java │ └── cn │ │ └── kstry │ │ └── framework │ │ └── test │ │ ├── annotation │ │ └── IgnoreScanAnn.java │ │ ├── bus │ │ ├── BusCaseTest.java │ │ ├── BusConfiguration.java │ │ ├── bo │ │ │ ├── BusStep1Bo.java │ │ │ ├── BusStep2Bo.java │ │ │ ├── BusStep2Request.java │ │ │ ├── BusTestRequest.java │ │ │ ├── BusTestResult.java │ │ │ └── ConvTBo.java │ │ ├── config │ │ │ └── Map2BusTestRequestConverter.java │ │ └── service │ │ │ └── BusTestService.java │ │ ├── demo │ │ ├── DemoConfiguration.java │ │ ├── FlowDemoCase2Test.java │ │ ├── FlowDemoCaseTest.java │ │ ├── bo │ │ │ ├── ClassInfo.java │ │ │ ├── RuleJudgeRequest.java │ │ │ ├── ScoreInfo.java │ │ │ ├── Student.java │ │ │ ├── StudentBasic.java │ │ │ ├── StudentPrivacy.java │ │ │ └── StudyExperience.java │ │ ├── config │ │ │ ├── AllocateRoleConfig.java │ │ │ ├── CustomExpressionFunction.java │ │ │ ├── Ex.java │ │ │ ├── Map2StudentConverter.java │ │ │ └── ProcessConfig.java │ │ ├── facade │ │ │ ├── CommonFields.java │ │ │ ├── QueryScoreRequest.java │ │ │ ├── QueryScoreResponse.java │ │ │ └── QueryScoreVarScope.java │ │ └── service │ │ │ ├── CalculateService.java │ │ │ ├── ExternalOrderService.java │ │ │ ├── FlowDemoService.java │ │ │ ├── InnerOrderService.java │ │ │ ├── OrderService.java │ │ │ └── StudentScoreService.java │ │ ├── diagram │ │ ├── DiagramCase01Test.java │ │ ├── DiagramCaseTestContextConfiguration.java │ │ ├── JsScriptInstructTest.java │ │ ├── RetryExceptionTest.java │ │ ├── bo │ │ │ └── CalculateServiceRequest.java │ │ ├── config │ │ │ ├── Case1BpmnDiagramConfiguration.java │ │ │ ├── DynamicBpmnDiagram.java │ │ │ ├── DynamicBpmnSubDiagram.java │ │ │ ├── JsScriptDiagramConfiguration.java │ │ │ ├── RetryExceptionDiagramConfiguration.java │ │ │ ├── SimpleAnnotationDiagram.java │ │ │ └── TaskIte.java │ │ ├── constants │ │ │ ├── SCS.java │ │ │ └── StoryNameConstants.java │ │ └── service │ │ │ ├── CalculateService.java │ │ │ ├── RetryExceptionService.java │ │ │ └── SimpleAnnotationComponent.java │ │ ├── flow │ │ ├── AsyncMethodTest.java │ │ ├── AtInterceptor.java │ │ ├── FlowCase01Test.java │ │ ├── FlowCase02Test.java │ │ ├── FlowCase03Test.java │ │ ├── FlowCase04Test.java │ │ ├── FlowCaseTestContextConfiguration.java │ │ ├── bo │ │ │ ├── Activity.java │ │ │ ├── CycleRequest.java │ │ │ ├── Goods.java │ │ │ ├── Hospital.java │ │ │ ├── MethodInvokeBo.java │ │ │ └── Te4Request.java │ │ ├── config │ │ │ ├── SwitchHookBo.java │ │ │ ├── TrackingEventListener.java │ │ │ └── ValidatorConfig.java │ │ ├── repeatedly │ │ │ ├── AsfBiz.java │ │ │ └── BaseBiz.java │ │ └── service │ │ │ ├── ActivityService.java │ │ │ ├── AsyncMethodService.java │ │ │ ├── CycleService.java │ │ │ ├── GoodsService.java │ │ │ ├── HelloService.java │ │ │ ├── HospitalService.java │ │ │ └── MethodInvokeService.java │ │ ├── iterator │ │ ├── IteratorConfiguration.java │ │ ├── IteratorSubProcessCaseTest.java │ │ ├── IteratorTaskCaseTest.java │ │ ├── bo │ │ │ ├── DataSource.java │ │ │ └── SkuBo.java │ │ ├── config │ │ │ ├── DynamicIteratorProcess.java │ │ │ └── DynamicIteratorSubProcess.java │ │ └── service │ │ │ ├── CalculateService.java │ │ │ └── SkuService.java │ │ ├── kv │ │ ├── KvCaseTest.java │ │ ├── KvConfiguration.java │ │ └── service │ │ │ ├── DynamicValue.java │ │ │ ├── KvDynamicProcess.java │ │ │ └── KvService.java │ │ ├── load │ │ ├── LoadBpmnConfigTest.java │ │ ├── LoadComponentTest.java │ │ ├── TestLoadConfiguration.java │ │ └── lct01 │ │ │ └── Lct01.java │ │ ├── monitor │ │ ├── FieldSerializeTrackingTest.java │ │ └── MonitorTrackingTest.java │ │ ├── mono │ │ ├── MonoConfiguration.java │ │ ├── MonoFlowTest.java │ │ ├── MonoResultTest.java │ │ ├── bo │ │ │ └── SayInfoRequest.java │ │ └── service │ │ │ ├── MonoSuccessService.java │ │ │ └── MonoSuccessServiceDemotion.java │ │ ├── role │ │ ├── RoleCaseTest.java │ │ ├── RoleConfiguration.java │ │ ├── RoleRegister.java │ │ ├── bo │ │ │ └── SayInfoRequest.java │ │ └── service │ │ │ ├── CustomRoleService.java │ │ │ ├── SayInfo.java │ │ │ └── SayInfoAbility.java │ │ ├── subprocess │ │ ├── SubProcessConfiguration.java │ │ ├── SubProcessTest.java │ │ ├── bo │ │ │ └── SubProcessBo.java │ │ ├── config │ │ │ └── ThreadConfiguration.java │ │ ├── interceptor │ │ │ ├── SayError01Interceptor.java │ │ │ ├── SayHello01Interceptor.java │ │ │ └── SayHello02Interceptor.java │ │ └── service │ │ │ └── SubProcessService.java │ │ └── util │ │ └── TestUtil.java │ └── resources │ ├── application.properties │ ├── bpmn │ ├── bus │ │ └── test_bus_01.bpmn │ ├── demo │ │ ├── component-demo-process.bpmn │ │ ├── student-score-query-process.bpmn │ │ └── student-score-query-process.json │ ├── diagram │ │ └── test_diagram_01.bpmn │ ├── flow │ │ ├── async_method_test.bpmn │ │ ├── cycle-flow-test-004.json │ │ ├── story-def-complex-flow.json │ │ ├── test_flow_01.bpmn │ │ ├── test_flow_02.bpmn │ │ ├── test_flow_02_sub.bpmn │ │ ├── test_flow_03.bpmn │ │ └── test_flow_04.bpmn │ ├── iterator │ │ ├── test_iterator_01.bpmn │ │ └── test_iterator_02.bpmn │ ├── kv │ │ ├── business-channel-config.yml │ │ ├── scope-default-config.yml │ │ ├── test_kv_001.bpmn │ │ └── test_kv_001.json │ ├── load │ │ ├── load_bpmn_002.bpmn │ │ ├── load_bpmn_00301.bpmn │ │ ├── load_bpmn_00302.bpmn │ │ ├── load_bpmn_00401.bpmn │ │ ├── load_bpmn_00402.bpmn │ │ ├── load_bpmn_005.bpmn │ │ ├── load_bpmn_006.bpmn │ │ └── load_bpmn_007.bpmn │ ├── mono │ │ ├── mono_flow_test.bpmn │ │ └── mono_result_test.bpmn │ ├── role │ │ └── test_role_01.bpmn │ └── subprocess │ │ └── subprocess_test_001.bpmn │ └── logback-test.xml ├── kstry-flux-demo ├── .gitignore ├── LICENSE ├── kstry-flux-demo-web │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── cn │ │ │ └── kstry │ │ │ └── flux │ │ │ └── demo │ │ │ ├── KstryFluxDemoApplication.java │ │ │ ├── config │ │ │ └── RoleRegister.java │ │ │ ├── converter │ │ │ └── Map2StudentConverter.java │ │ │ ├── dto │ │ │ ├── goods │ │ │ │ ├── EvaluationInfo.java │ │ │ │ ├── GoodsDetail.java │ │ │ │ ├── GoodsExtInfo.java │ │ │ │ ├── LogisticInsurance.java │ │ │ │ ├── OrderInfo.java │ │ │ │ ├── ShopInfo.java │ │ │ │ ├── ShopLabel.java │ │ │ │ └── SkuInfo.java │ │ │ └── student │ │ │ │ ├── ClassInfo.java │ │ │ │ ├── ScoreInfo.java │ │ │ │ ├── Student.java │ │ │ │ ├── StudentBasic.java │ │ │ │ ├── StudentPrivacy.java │ │ │ │ └── StudyExperience.java │ │ │ ├── facade │ │ │ ├── R.java │ │ │ ├── goods │ │ │ │ ├── CheckInfo.java │ │ │ │ ├── DetailPostProcessRequest.java │ │ │ │ ├── GetLogisticInsuranceRequest.java │ │ │ │ ├── GoodsDetailRequest.java │ │ │ │ ├── InitSkuResponse.java │ │ │ │ └── ShowGoodsSta.java │ │ │ ├── http │ │ │ │ └── ResultProperty.java │ │ │ └── student │ │ │ │ ├── QueryScoreRequest.java │ │ │ │ ├── QueryScoreResponse.java │ │ │ │ └── QueryScoreVarScope.java │ │ │ ├── interceptor │ │ │ └── StatisticsInterceptor.java │ │ │ ├── process │ │ │ ├── DefProcess.java │ │ │ └── DefSubProcess.java │ │ │ ├── service │ │ │ ├── goods │ │ │ │ ├── EvaluationService.java │ │ │ │ ├── GoodsCustomRole.java │ │ │ │ ├── GoodsService.java │ │ │ │ ├── GoodsServiceDemotion.java │ │ │ │ ├── LogisticService.java │ │ │ │ ├── OrderService.java │ │ │ │ ├── RiskControlService.java │ │ │ │ └── ShopService.java │ │ │ ├── http │ │ │ │ └── HttpActionService.java │ │ │ └── student │ │ │ │ └── StudentScoreService.java │ │ │ ├── util │ │ │ └── WebUtil.java │ │ │ └── web │ │ │ ├── GoodsController.java │ │ │ ├── HttpActionController.java │ │ │ └── StudentController.java │ │ └── resources │ │ ├── application.yml │ │ ├── bpmn │ │ ├── http-action-process.bpmn │ │ ├── student-score-query-process.bpmn │ │ └── student-score-query-process.json │ │ ├── config │ │ ├── global-default.yml │ │ ├── goods-config.yml │ │ └── risk-control-config.yml │ │ ├── goods.bpmn │ │ ├── goods2.bpmn │ │ ├── img │ │ └── goods-show-demo-flow.png │ │ ├── logback-spring.xml │ │ └── server │ │ ├── data.json │ │ └── httpServer.js └── pom.xml └── kstry-process-designer ├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── babel.config.js ├── jsconfig.json ├── lint-staged.config.js ├── nginx.conf ├── package-lock.json ├── package.json ├── packages ├── additional-modules │ ├── AutoPlace │ │ ├── CustomAutoPlace.js │ │ └── index.js │ ├── ContextPad │ │ ├── EnhancementContextPad │ │ │ ├── enhancementContextPadProvider.js │ │ │ └── index.js │ │ └── RewriteContextPad │ │ │ ├── index.js │ │ │ └── rewriteContextPadProvider.js │ ├── ElementFactory │ │ ├── CustomElementFactory.js │ │ └── index.js │ ├── Lint │ │ ├── bpmnlint.js │ │ └── customLintRules │ │ │ └── taskRequired.js │ ├── Palette │ │ ├── EnhancementPalette │ │ │ ├── enhancementPaletteProvider.js │ │ │ └── index.js │ │ ├── RewritePalette │ │ │ ├── index.js │ │ │ └── rewritePaletteProvider.js │ │ └── utils.js │ ├── PopupMenu │ │ ├── EnhancementPopupMenu │ │ │ ├── enhancementPopupMenuProvider.js │ │ │ └── index.js │ │ └── RewritePopupMenu │ │ │ ├── index.js │ │ │ └── rewritePopupMenuProvider.js │ ├── Renderer │ │ ├── EnhancementRenderer │ │ │ ├── EnhancementRenderer.js │ │ │ ├── index.js │ │ │ └── renderEventContent.js │ │ ├── RewriteRenderer │ │ │ ├── RewriteRenderer.js │ │ │ ├── index.js │ │ │ └── rewritePaths.js │ │ └── utils.js │ ├── Rules │ │ ├── CustomRules.js │ │ └── index.js │ └── Translate │ │ ├── index.js │ │ └── zh-cn │ │ ├── events.js │ │ ├── gateway.js │ │ ├── index.js │ │ ├── lint.js │ │ ├── other.js │ │ └── tasks.js ├── bo-utils │ ├── conditionUtil.js │ ├── documentationUtil.js │ ├── extensionPropertiesUtil.js │ ├── idUtil.js │ ├── nameUtil.js │ └── processUtil.js ├── bpmn-icons │ ├── bpmn-empty-state.svg │ ├── bpmn-icon-association.svg │ ├── bpmn-icon-business-rule-task.svg │ ├── bpmn-icon-call-activity.svg │ ├── bpmn-icon-collaboration.svg │ ├── bpmn-icon-conditional-flow.svg │ ├── bpmn-icon-connection.svg │ ├── bpmn-icon-data-input-output-association.svg │ ├── bpmn-icon-data-input.svg │ ├── bpmn-icon-data-object.svg │ ├── bpmn-icon-data-output.svg │ ├── bpmn-icon-data-store.svg │ ├── bpmn-icon-default-flow.svg │ ├── bpmn-icon-end-event-cancel.svg │ ├── bpmn-icon-end-event-compensation.svg │ ├── bpmn-icon-end-event-error.svg │ ├── bpmn-icon-end-event-escalation.svg │ ├── bpmn-icon-end-event-link.svg │ ├── bpmn-icon-end-event-message.svg │ ├── bpmn-icon-end-event-multiple.svg │ ├── bpmn-icon-end-event-none.svg │ ├── bpmn-icon-end-event-signal.svg │ ├── bpmn-icon-end-event-terminate.svg │ ├── bpmn-icon-event-subprocess-expanded.svg │ ├── bpmn-icon-gateway-complex.svg │ ├── bpmn-icon-gateway-eventbased.svg │ ├── bpmn-icon-gateway-none.svg │ ├── bpmn-icon-gateway-or.svg │ ├── bpmn-icon-gateway-parallel.svg │ ├── bpmn-icon-gateway-xor.svg │ ├── bpmn-icon-group.svg │ ├── bpmn-icon-intermediate-event-catch-cancel.svg │ ├── bpmn-icon-intermediate-event-catch-compensation.svg │ ├── bpmn-icon-intermediate-event-catch-condition.svg │ ├── bpmn-icon-intermediate-event-catch-error.svg │ ├── bpmn-icon-intermediate-event-catch-escalation.svg │ ├── bpmn-icon-intermediate-event-catch-link.svg │ ├── bpmn-icon-intermediate-event-catch-message.svg │ ├── bpmn-icon-intermediate-event-catch-multiple.svg │ ├── bpmn-icon-intermediate-event-catch-non-interrupting-condition.svg │ ├── bpmn-icon-intermediate-event-catch-non-interrupting-escalation.svg │ ├── bpmn-icon-intermediate-event-catch-non-interrupting-message.svg │ ├── bpmn-icon-intermediate-event-catch-non-interrupting-multiple.svg │ ├── bpmn-icon-intermediate-event-catch-non-interrupting-parallel.svg │ ├── bpmn-icon-intermediate-event-catch-non-interrupting-signal.svg │ ├── bpmn-icon-intermediate-event-catch-non-interrupting-timer.svg │ ├── bpmn-icon-intermediate-event-catch-parallel-multiple.svg │ ├── bpmn-icon-intermediate-event-catch-signal.svg │ ├── bpmn-icon-intermediate-event-catch-timer.svg │ ├── bpmn-icon-intermediate-event-none.svg │ ├── bpmn-icon-intermediate-event-throw-compensation.svg │ ├── bpmn-icon-intermediate-event-throw-escalation.svg │ ├── bpmn-icon-intermediate-event-throw-link.svg │ ├── bpmn-icon-intermediate-event-throw-message.svg │ ├── bpmn-icon-intermediate-event-throw-multiple.svg │ ├── bpmn-icon-intermediate-event-throw-signal.svg │ ├── bpmn-icon-lane.svg │ ├── bpmn-icon-manual-task.svg │ ├── bpmn-icon-message-flow.svg │ ├── bpmn-icon-participant.svg │ ├── bpmn-icon-process.svg │ ├── bpmn-icon-receive-task.svg │ ├── bpmn-icon-script-task.svg │ ├── bpmn-icon-send-task.svg │ ├── bpmn-icon-service-task.svg │ ├── bpmn-icon-start-event-compensation.svg │ ├── bpmn-icon-start-event-condition.svg │ ├── bpmn-icon-start-event-error.svg │ ├── bpmn-icon-start-event-escalation.svg │ ├── bpmn-icon-start-event-message.svg │ ├── bpmn-icon-start-event-multiple.svg │ ├── bpmn-icon-start-event-non-interrupting-condition.svg │ ├── bpmn-icon-start-event-non-interrupting-escalation.svg │ ├── bpmn-icon-start-event-non-interrupting-message.svg │ ├── bpmn-icon-start-event-non-interrupting-multiple.svg │ ├── bpmn-icon-start-event-non-interrupting-parallel-multiple.svg │ ├── bpmn-icon-start-event-non-interrupting-signal.svg │ ├── bpmn-icon-start-event-non-interrupting-timer.svg │ ├── bpmn-icon-start-event-none.svg │ ├── bpmn-icon-start-event-parallel-multiple.svg │ ├── bpmn-icon-start-event-signal.svg │ ├── bpmn-icon-start-event-timer.svg │ ├── bpmn-icon-subprocess-collapsed.svg │ ├── bpmn-icon-subprocess-expanded.svg │ ├── bpmn-icon-task-none.svg │ ├── bpmn-icon-text-annotation.svg │ ├── bpmn-icon-transaction.svg │ ├── bpmn-icon-user-task.svg │ ├── bpmn-multiple-state.svg │ ├── getIconType.js │ └── index.js ├── bpmn-utils │ ├── BpmnDesignerUtils.js │ ├── BpmnEventDefinition.js │ ├── BpmnExtensionElements.js │ └── BpmnValidator.js ├── components │ ├── Designer │ │ ├── index.vue │ │ ├── initModeler.js │ │ └── moduleAndExtensions.js │ ├── Panel │ │ ├── components │ │ │ ├── ActivityElementCalled.vue │ │ │ ├── ElementConditional.vue │ │ │ ├── ElementDocumentations.vue │ │ │ ├── ElementGenerations.vue │ │ │ ├── ElementIterateProperties.vue │ │ │ ├── ElementPostInstructions.vue │ │ │ ├── ElementPrevInstructions.vue │ │ │ ├── ElementRateLimitProperties.vue │ │ │ ├── ElementRunProperties.vue │ │ │ ├── ElementServiceTaskNodeProperties.vue │ │ │ └── SubChild │ │ │ │ ├── ExtensionInstructions.vue │ │ │ │ └── ExtensionProperties.vue │ │ └── index.vue │ ├── Settings │ │ └── index.vue │ ├── Toolbar │ │ ├── index.vue │ │ └── tools │ │ │ ├── Aligns.vue │ │ │ ├── Commands.vue │ │ │ ├── Exports.vue │ │ │ ├── Externals.vue │ │ │ ├── Import.vue │ │ │ ├── Previews.vue │ │ │ └── Scales.vue │ └── common │ │ ├── BpmnIcon.vue │ │ ├── CollapseTitle.vue │ │ ├── EditItem.vue │ │ ├── LucideIcon.vue │ │ ├── NumberTag.vue │ │ └── index.js ├── highlight │ └── index.js ├── moddle-extensions │ ├── activiti.json │ ├── bpmn.json │ ├── camunda.json │ ├── flowable.json │ ├── miyue.json │ └── zeebe.json ├── preset-configuration │ └── editor.config.js ├── store │ ├── index.js │ └── modules │ │ └── index.js └── theme │ ├── camunda-panel.scss │ ├── context-pad.scss │ ├── contextmenu.scss │ ├── designer.scss │ ├── element-variables.scss │ ├── images │ ├── 04.jpg │ └── tool.png │ ├── index.scss │ ├── palette.scss │ ├── panel.scss │ ├── process-icons │ └── mysql.png │ ├── settings.scss │ └── toolbar.scss ├── playground ├── App.vue ├── main.js └── router │ └── index.js ├── public ├── favicon.ico ├── icon-process.png ├── index.html └── logo.ico ├── types ├── bpmn-moddle │ ├── bpmn-form.d.ts │ └── bpmn-instance.d.ts ├── declares │ ├── bpmn-js-bpmnlint.d.ts │ ├── bpmn-js-toke-simulation.d.ts │ ├── bpmn-moddle.d.ts │ ├── bpmn.d.ts │ ├── camunda-bpmn-moddle.d.ts │ ├── diagram-js-direct-editing.d.ts │ ├── diagram.d.ts │ ├── didi.d.ts │ ├── moddle.d.ts │ └── object-refs.d.ts ├── editor │ ├── global.d.ts │ ├── settings.d.ts │ └── utils.d.ts ├── index.d.ts └── process-designer.d.ts ├── utils ├── EventEmitter.js ├── Logger.js ├── files.js ├── printCatch.js ├── resetPopover.js ├── tool.js ├── uuid.js └── xml.js └── vue.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | .mvn 22 | 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | build/ 31 | !**/src/main/**/build/ 32 | !**/src/test/**/build/ 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | 37 | .DS_Store 38 | /kstry-process-designer/node_modules 39 | /kstry-process-designer/dist 40 | 41 | 42 | # local env files 43 | .env.local 44 | .env.*.local 45 | 46 | # Log files 47 | npm-debug.log* 48 | yarn-debug.log* 49 | yarn-error.log* 50 | pnpm-debug.log* 51 | 52 | # Editor directories and files 53 | .idea 54 | .vscode 55 | *.suo 56 | *.ntvs* 57 | *.njsproj 58 | *.sln 59 | *.sw? 60 | -------------------------------------------------------------------------------- /doc/img/02de6f93f1d4bd9d2455e86627df5f46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/02de6f93f1d4bd9d2455e86627df5f46.png -------------------------------------------------------------------------------- /doc/img/19afbf405383b31346d5a4abb93b98c6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/19afbf405383b31346d5a4abb93b98c6.png -------------------------------------------------------------------------------- /doc/img/3fb4b3b69521dfa150d70c1df6cea2f6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/3fb4b3b69521dfa150d70c1df6cea2f6.png -------------------------------------------------------------------------------- /doc/img/4a307fbca5c72f84e9fb044558432b5d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/4a307fbca5c72f84e9fb044558432b5d.png -------------------------------------------------------------------------------- /doc/img/6e987e71c8ba092da1535c84fb805b2c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/6e987e71c8ba092da1535c84fb805b2c.png -------------------------------------------------------------------------------- /doc/img/715eec8e04f7a5fb754e796f7cb3888f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/715eec8e04f7a5fb754e796f7cb3888f.png -------------------------------------------------------------------------------- /doc/img/9efe98c660476585e7e5fedb63067988.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/9efe98c660476585e7e5fedb63067988.png -------------------------------------------------------------------------------- /doc/img/bb15ea631b20a48b77b5b9f0ffb080d7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/bb15ea631b20a48b77b5b9f0ffb080d7.png -------------------------------------------------------------------------------- /doc/img/bb7caec5a2d88f337dfe7a8276be1c33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/bb7caec5a2d88f337dfe7a8276be1c33.png -------------------------------------------------------------------------------- /doc/img/pr/pr-1.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-1.1.png -------------------------------------------------------------------------------- /doc/img/pr/pr-1.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-1.2.png -------------------------------------------------------------------------------- /doc/img/pr/pr-1.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-1.3.png -------------------------------------------------------------------------------- /doc/img/pr/pr-3.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-3.1.png -------------------------------------------------------------------------------- /doc/img/pr/pr-4.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-4.1.png -------------------------------------------------------------------------------- /doc/img/pr/pr-4.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-4.2.png -------------------------------------------------------------------------------- /doc/img/pr/pr-5.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-5.1.png -------------------------------------------------------------------------------- /doc/img/pr/pr-5.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-5.2.png -------------------------------------------------------------------------------- /doc/img/pr/pr-6.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-6.1.png -------------------------------------------------------------------------------- /doc/img/pr/pr-6.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-6.2.png -------------------------------------------------------------------------------- /doc/img/pr/pr-6.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/doc/img/pr/pr-6.3.png -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/annotation/SpringInitialization.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.annotation; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * 标注到服务节点入参类上,代表该入参对象需要从 Spring 容器中创建 27 | * 28 | * @author lykan 29 | */ 30 | @Target(ElementType.TYPE) 31 | @Retention(RetentionPolicy.RUNTIME) 32 | public @interface SpringInitialization { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/BpmnElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn; 19 | 20 | /** 21 | * BpmnElement 22 | */ 23 | public interface BpmnElement extends BaseElement { 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/EndEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn; 19 | 20 | import cn.kstry.framework.core.bpmn.extend.AggregationFlowElement; 21 | 22 | /** 23 | * EndEvent 24 | */ 25 | public interface EndEvent extends Event, AggregationFlowElement { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn; 19 | 20 | /** 21 | * Event 22 | */ 23 | public interface Event extends FlowElement { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/ExclusiveGateway.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn; 19 | 20 | import cn.kstry.framework.core.bpmn.extend.ServiceTaskSupport; 21 | import cn.kstry.framework.core.component.expression.Expression; 22 | 23 | /** 24 | * ExclusiveGateway 25 | */ 26 | public interface ExclusiveGateway extends Gateway, ServiceTaskSupport, Expression { 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/Gateway.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn; 19 | 20 | /** 21 | * Gateway 22 | */ 23 | public interface Gateway extends FlowElement { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/ParallelGateway.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn; 19 | 20 | import cn.kstry.framework.core.bpmn.extend.AggregationFlowElement; 21 | import cn.kstry.framework.core.bpmn.extend.AsyncFlowElement; 22 | 23 | /** 24 | * ParallelGateway 25 | */ 26 | public interface ParallelGateway extends Gateway, AggregationFlowElement, AsyncFlowElement { 27 | 28 | /** 29 | * 是否为严格模式,严格模式下的并行节点必须所有入度都得执行到,否则报错 30 | * 31 | * @return true 默认:true 32 | */ 33 | boolean isStrictMode(); 34 | } 35 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/SubProcess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn; 19 | 20 | /** 21 | * SubProcess 22 | */ 23 | public interface SubProcess extends Task { 24 | 25 | /** 26 | * 获取开始事件 27 | * 28 | * @return 开始事件 29 | */ 30 | StartEvent getStartEvent(); 31 | } 32 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/extend/AggregationFlowElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn.extend; 19 | 20 | import cn.kstry.framework.core.bpmn.FlowElement; 21 | 22 | /** 23 | * 聚合节点 24 | * 25 | * @author lykan 26 | */ 27 | public interface AggregationFlowElement extends FlowElement { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/extend/AsyncFlowElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn.extend; 19 | 20 | /** 21 | * 异步节点 22 | */ 23 | public interface AsyncFlowElement { 24 | 25 | /** 26 | * 是否开启异步 27 | * 28 | * @return openAsync 29 | */ 30 | Boolean openAsync(); 31 | } 32 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/extend/ServiceTaskSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn.extend; 19 | 20 | import cn.kstry.framework.core.bpmn.ServiceTask; 21 | 22 | import java.util.Optional; 23 | 24 | /** 25 | * 对 ServiceTask 支持 26 | * 27 | * @author lykan 28 | */ 29 | public interface ServiceTaskSupport { 30 | 31 | /** 32 | * 获取 ServiceTask 33 | * 34 | * @return ServiceTask 35 | */ 36 | Optional getServiceTask(); 37 | } 38 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/impl/BpmnElementImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn.impl; 19 | 20 | import cn.kstry.framework.core.bpmn.BpmnElement; 21 | import cn.kstry.framework.core.bpmn.enums.BpmnTypeEnum; 22 | 23 | /** 24 | * BpmnElementImpl 25 | */ 26 | public class BpmnElementImpl extends BaseElementImpl implements BpmnElement { 27 | 28 | @Override 29 | public BpmnTypeEnum getElementType() { 30 | return BpmnTypeEnum.ELEMENT; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/impl/EndEventImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn.impl; 19 | 20 | import cn.kstry.framework.core.bpmn.EndEvent; 21 | import cn.kstry.framework.core.bpmn.enums.BpmnTypeEnum; 22 | 23 | /** 24 | * EndEventImpl 25 | */ 26 | public class EndEventImpl extends EventImpl implements EndEvent { 27 | 28 | @Override 29 | public BpmnTypeEnum getElementType() { 30 | return BpmnTypeEnum.END_EVENT; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/impl/EventImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn.impl; 19 | 20 | import cn.kstry.framework.core.bpmn.Event; 21 | import cn.kstry.framework.core.bpmn.enums.BpmnTypeEnum; 22 | 23 | /** 24 | * EventImpl 25 | */ 26 | public class EventImpl extends FlowElementImpl implements Event { 27 | 28 | @Override 29 | public BpmnTypeEnum getElementType() { 30 | return BpmnTypeEnum.EVENT; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bpmn/impl/GatewayImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bpmn.impl; 19 | 20 | import cn.kstry.framework.core.bpmn.Gateway; 21 | import cn.kstry.framework.core.bpmn.enums.BpmnTypeEnum; 22 | 23 | /** 24 | * GatewayImpl 25 | */ 26 | public class GatewayImpl extends FlowElementImpl implements Gateway { 27 | 28 | @Override 29 | public BpmnTypeEnum getElementType() { 30 | return BpmnTypeEnum.GATEWAY; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/bus/ScopeData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.bus; 19 | 20 | import cn.kstry.framework.core.enums.ScopeTypeEnum; 21 | 22 | /** 23 | * ScopeData 24 | * 25 | * @author lykan 26 | */ 27 | public interface ScopeData { 28 | 29 | /** 30 | * @return ScopeDataEnum 31 | */ 32 | ScopeTypeEnum getScopeDataEnum(); 33 | } 34 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/component/bpmn/ProcessParser.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.core.component.bpmn; 2 | 3 | import cn.kstry.framework.core.component.bpmn.builder.SubProcessLink; 4 | import cn.kstry.framework.core.component.bpmn.link.ProcessLink; 5 | 6 | import java.util.Map; 7 | import java.util.Optional; 8 | 9 | /** 10 | * 流程解析器 11 | */ 12 | public interface ProcessParser { 13 | 14 | /** 15 | * 获取全部主流程 16 | * 17 | * @return 全部主流程 18 | */ 19 | Map getAllProcessLink(); 20 | 21 | /** 22 | * 获取单个主流程 23 | * 24 | * @param startEventId startEventId 25 | * @return 单个主流程 26 | */ 27 | Optional getProcessLink(String startEventId); 28 | 29 | /** 30 | * 获取全部子流程 31 | * 32 | * @return 全部子流程 33 | */ 34 | Map getAllSubProcessLink(); 35 | 36 | /** 37 | * 获取单个子流程 38 | * 39 | * @param subProcessId subProcessId 40 | * @return 单个子流程 41 | */ 42 | Optional getSubProcessLink(String subProcessId); 43 | } 44 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/component/bpmn/joinpoint/InclusiveJoinPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.component.bpmn.joinpoint; 19 | 20 | import cn.kstry.framework.core.bpmn.InclusiveGateway; 21 | import cn.kstry.framework.core.component.bpmn.link.ProcessLink; 22 | 23 | public class InclusiveJoinPoint extends DiagramJoinPoint { 24 | 25 | public InclusiveJoinPoint(InclusiveGateway element, ProcessLink processLink) { 26 | super(element, processLink); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/component/bpmn/joinpoint/ParallelJoinPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.component.bpmn.joinpoint; 19 | 20 | import cn.kstry.framework.core.bpmn.ParallelGateway; 21 | import cn.kstry.framework.core.component.bpmn.link.ProcessLink; 22 | 23 | public class ParallelJoinPoint extends DiagramJoinPoint { 24 | 25 | public ParallelJoinPoint(ParallelGateway element, ProcessLink processLink) { 26 | super(element, processLink); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/component/expression/Expression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.component.expression; 19 | 20 | import java.util.Optional; 21 | 22 | /** 23 | * Expression 24 | */ 25 | public interface Expression { 26 | 27 | /** 28 | * 获取 ConditionExpression 29 | * 30 | * @return conditionExpression 31 | */ 32 | Optional getConditionExpression(); 33 | } 34 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/component/expression/ExpressionAliasRegister.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.component.expression; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 表达式别名注册器 24 | * 25 | * @author lykan 26 | */ 27 | public interface ExpressionAliasRegister { 28 | 29 | /** 30 | * 注册别名列表 31 | * 32 | * @return 表达式别名列表 33 | */ 34 | List registerAlias(); 35 | } 36 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/component/hook/AsyncFlowHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.component.hook; 19 | 20 | import cn.kstry.framework.core.bpmn.extend.AsyncFlowElement; 21 | 22 | /** 23 | * 异步流程开启回调 24 | * 25 | * @author lykan 26 | */ 27 | public class AsyncFlowHook extends SimpleHook implements AsyncFlowElement { 28 | 29 | public AsyncFlowHook(T target) { 30 | super(target); 31 | } 32 | 33 | @Override 34 | public Boolean openAsync() { 35 | return true; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/component/jsprocess/metadata/JsonNodeProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.component.jsprocess.metadata; 19 | 20 | import java.util.HashMap; 21 | 22 | /** 23 | * JSON 节点属性 24 | * 25 | * @author lykan 26 | */ 27 | public class JsonNodeProperties extends HashMap { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/component/jsprocess/metadata/JsonPropertySupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.component.jsprocess.metadata; 19 | 20 | /** 21 | * JSON 节点属性支持 22 | * 23 | * @author lykan 24 | */ 25 | public interface JsonPropertySupport { 26 | 27 | /** 28 | * 获取Id 29 | * 30 | * @return id 31 | */ 32 | String getId(); 33 | 34 | /** 35 | * 获取属性集合 36 | * 37 | * @return 属性集合 38 | */ 39 | JsonNodeProperties getProperties(); 40 | } 41 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/component/limiter/strategy/FailAcquireStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.component.limiter.strategy; 19 | 20 | import cn.kstry.framework.core.bus.ScopeDataOperator; 21 | import cn.kstry.framework.core.component.limiter.RateLimiterConfig; 22 | 23 | import java.util.function.BiConsumer; 24 | 25 | /** 26 | * 令牌获取失败策略 27 | */ 28 | public interface FailAcquireStrategy extends BiConsumer { 29 | 30 | String name(); 31 | } 32 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/container/task/TaskComponentRegister.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.container.task; 19 | 20 | /** 21 | * 服务组件类注册 22 | * 23 | * @author lykan 24 | */ 25 | public interface TaskComponentRegister { 26 | 27 | /** 28 | * 组件名称 29 | */ 30 | String getName(); 31 | } 32 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/engine/SpringParamLifecycle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.engine; 19 | 20 | import org.springframework.context.ApplicationContext; 21 | 22 | /** 23 | * 参数生命周期接口 24 | * 25 | * @author lykan 26 | */ 27 | public interface SpringParamLifecycle extends ParamLifecycle { 28 | 29 | /** 30 | * 使用 Spring ApplicationContext 初始化参数上下文 31 | */ 32 | default void initContext(ApplicationContext applicationContext) { 33 | // do nothing 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/engine/future/CancelableFuture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.engine.future; 19 | 20 | /** 21 | * 可取消的 Future 22 | * 23 | * @author lykan 24 | */ 25 | public interface CancelableFuture { 26 | 27 | /** 28 | * 取消任务执行 29 | * 30 | * @param startEventId 流程开始事件ID 31 | */ 32 | boolean cancel(String startEventId); 33 | 34 | /** 35 | * 判断任务执行是否被取消 36 | * 37 | * @param startEventId 流程开始事件ID 38 | * @return 任务执行是否被取消 39 | */ 40 | boolean isCancelled(String startEventId); 41 | } 42 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/engine/future/FlowFuture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.engine.future; 19 | 20 | import java.util.concurrent.TimeUnit; 21 | 22 | /** 23 | * 主流程 FlowFuture 24 | * 25 | * @author lykan 26 | */ 27 | public interface FlowFuture extends MainTaskFuture { 28 | 29 | /** 30 | * 等待任务结束,超时时间 31 | * 32 | * @param timeout 超时时间 33 | * @param unit 超时时间单位 34 | * @return 等待指定时长后,任务是否执行完成 35 | */ 36 | boolean await(long timeout, TimeUnit unit) throws InterruptedException; 37 | } 38 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/engine/future/FragmentFuture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.engine.future; 19 | 20 | /** 21 | * 流程片段 Future 22 | * 23 | * @author lykan 24 | */ 25 | public interface FragmentFuture extends CancelableFuture { 26 | 27 | /** 28 | * 获取任务名 29 | * 30 | * @return 任务名 31 | */ 32 | String getTaskName(); 33 | } 34 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/engine/future/InvokeFuture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.engine.future; 19 | 20 | import cn.kstry.framework.core.bpmn.ServiceTask; 21 | import cn.kstry.framework.core.monitor.MonitorTracking; 22 | 23 | /** 24 | * 方法调用 Future 25 | * 26 | * @author lykan 27 | */ 28 | public interface InvokeFuture extends FragmentFuture { 29 | 30 | /** 31 | * 指定超时时间,调用目标方法获取方法返回值 32 | * 33 | * @param timeout 超时时间 34 | * @return 方法返回值 35 | */ 36 | Object invokeMethod(int timeout, MonitorTracking monitorTracking, ServiceTask serviceTask); 37 | } 38 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/engine/future/MainTaskFuture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.engine.future; 19 | 20 | import cn.kstry.framework.core.engine.thread.EndTaskPedometer; 21 | 22 | /** 23 | * 主线路 TaskFuture 24 | * 25 | * @author lykan 26 | */ 27 | public interface MainTaskFuture extends FragmentFuture { 28 | 29 | /** 30 | * 获取结束任务计步器 31 | * 32 | * @return 结束任务计步器 33 | */ 34 | EndTaskPedometer getEndTaskPedometer(); 35 | 36 | /** 37 | * 任务的严格模式 38 | * 39 | * @return 严格模式 40 | */ 41 | boolean strictMode(); 42 | } 43 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/engine/thread/hook/TraceLog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.engine.thread.hook; 19 | 20 | public class TraceLog { 21 | 22 | private String logId; 23 | 24 | public String getLogId() { 25 | return logId; 26 | } 27 | 28 | public void setLogId(String logId) { 29 | this.logId = logId; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/enums/AsyncTaskState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.enums; 19 | 20 | /** 21 | * 异步任务执行结果 22 | * 23 | * @author lykan 24 | */ 25 | public enum AsyncTaskState { 26 | 27 | /** 28 | * 成功 29 | */ 30 | SUCCESS, 31 | 32 | /** 33 | * 失败 34 | */ 35 | ERROR, 36 | 37 | /** 38 | * 超时 39 | */ 40 | TIMEOUT, 41 | 42 | /** 43 | * 取消 44 | */ 45 | CANCEL 46 | 47 | } 48 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/enums/DynamicComponentType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.enums; 19 | 20 | public enum DynamicComponentType { 21 | 22 | /** 23 | * 角色 24 | */ 25 | ROLE, 26 | 27 | /** 28 | * 子流程 29 | */ 30 | SUB_PROCESS, 31 | 32 | /** 33 | * 流程 34 | */ 35 | PROCESS, 36 | 37 | /** 38 | * 动态属性 39 | */ 40 | K_VALUE 41 | } 42 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/enums/ElementAllowNextEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.enums; 19 | 20 | /** 21 | * 判断是否允许执行下一个节点的状态标 22 | * 23 | * @author lykan 24 | */ 25 | public enum ElementAllowNextEnum { 26 | 27 | /** 28 | * 允许执行下一个节点 29 | */ 30 | ALLOW_NEX, 31 | 32 | /** 33 | * 不允许执行下一个节点 34 | */ 35 | NOT_ALLOW_NEX, 36 | 37 | /** 38 | * 不允许执行下一个节点,但是需要补偿逻辑 39 | */ 40 | NOT_ALLOW_NEX_NEED_COMPENSATE 41 | } 42 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/enums/ExecutorType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.enums; 19 | 20 | /** 21 | * 线程池类型 22 | * 23 | * @author lykan 24 | */ 25 | public enum ExecutorType { 26 | 27 | /** 28 | * 任务 29 | */ 30 | TASK, 31 | 32 | /** 33 | * 方法 34 | */ 35 | METHOD, 36 | 37 | /** 38 | * 集合迭代使用 39 | */ 40 | ITERATOR 41 | } 42 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/enums/SourceTypeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.enums; 19 | 20 | /** 21 | * 22 | * @author lykan 23 | */ 24 | public enum SourceTypeEnum { 25 | 26 | PROCESS_DIAGRAM, 27 | 28 | PROCESS, 29 | 30 | PROPERTIES 31 | } 32 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/exception/KstryComponentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.exception; 19 | 20 | /** 21 | * 22 | * @author lykan 23 | */ 24 | public class KstryComponentException extends KstryException { 25 | 26 | public KstryComponentException(String code, String desc, Throwable cause) { 27 | super(code, desc, cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/exception/NodeInvokeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.exception; 19 | 20 | /** 21 | * 22 | * @author lykan 23 | */ 24 | public class NodeInvokeException extends KstryException { 25 | 26 | public NodeInvokeException(String code, String desc, Throwable cause) { 27 | super(code, desc, cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/exception/RateLimiterException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.exception; 19 | 20 | /** 21 | * 限流异常 22 | * 23 | * @author lykan 24 | */ 25 | public class RateLimiterException extends KstryException { 26 | 27 | public RateLimiterException(String code, String desc, Throwable cause) { 28 | super(code, desc, cause); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/exception/ResourceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.exception; 19 | 20 | /** 21 | * 22 | * @author lykan 23 | */ 24 | public class ResourceException extends KstryException { 25 | 26 | public ResourceException(String code, String desc, Throwable cause) { 27 | super(code, desc, cause); 28 | } 29 | 30 | public ResourceException(ExceptionEnum exceptionEnum, Throwable cause) { 31 | super(exceptionEnum.getExceptionCode(), exceptionEnum.getDesc(), cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/exception/StoryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.exception; 19 | 20 | /** 21 | * @author lykan 22 | */ 23 | public class StoryException extends KstryException { 24 | 25 | public StoryException(String code, String desc, Throwable cause) { 26 | super(code, desc, cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/exception/TaskAsyncException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.exception; 19 | 20 | /** 21 | * 22 | * @author lykan 23 | */ 24 | public class TaskAsyncException extends KstryException { 25 | 26 | public TaskAsyncException(String code, String desc, Throwable cause) { 27 | super(code, desc, cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/exception/TaskTimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.exception; 19 | 20 | /** 21 | * 22 | * @author lykan 23 | */ 24 | public class TaskTimeoutException extends KstryException { 25 | 26 | public TaskTimeoutException(String code, String desc, Throwable cause) { 27 | super(code, desc, cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/kv/KValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.kv; 19 | 20 | import java.util.Optional; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | public interface KValue { 27 | 28 | Object KV_NULL = new Object(); 29 | 30 | /** 31 | * 根据 Key, 获取业务值 32 | * 33 | * @param key 键 34 | * @return 值 35 | */ 36 | Optional getValue(String key); 37 | } 38 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/kv/KvScopeProfile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.kv; 19 | 20 | /** 21 | * 22 | * @author lykan 23 | */ 24 | public class KvScopeProfile { 25 | 26 | private final String scope; 27 | 28 | private final String activeProfile; 29 | 30 | public KvScopeProfile(String scope, String activeProfile) { 31 | this.scope = scope; 32 | this.activeProfile = activeProfile; 33 | } 34 | 35 | public String getScope() { 36 | return scope; 37 | } 38 | 39 | public String getActiveProfile() { 40 | return activeProfile; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/kv/KvSelector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.kv; 19 | 20 | import java.util.Optional; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | public interface KvSelector { 27 | 28 | Optional getKValue(String scope); 29 | } 30 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/monitor/SerializeTracking.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.monitor; 19 | 20 | /** 21 | * 字段序列化器 22 | */ 23 | public interface SerializeTracking { 24 | 25 | /** 26 | * 序列化值 27 | */ 28 | String valueSerialize(FieldTracking fieldTracking); 29 | } 30 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/resource/config/ConfigResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.resource.config; 19 | 20 | import cn.kstry.framework.core.enums.ResourceTypeEnum; 21 | 22 | /** 23 | * 配置文件定义 24 | * 25 | * @author lykan 26 | */ 27 | public interface ConfigResource { 28 | 29 | /** 30 | * 获取配置文件名称 31 | * 32 | * @return 配置文件名称 33 | */ 34 | String getConfigName(); 35 | 36 | /** 37 | * 获取资源类型 38 | * 39 | * @return 资源类型 40 | */ 41 | ResourceTypeEnum getResourceType(); 42 | } 43 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/resource/config/PropertiesConfigResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.resource.config; 19 | 20 | import java.util.List; 21 | 22 | import cn.kstry.framework.core.kv.BasicKValue; 23 | 24 | /** 25 | * Properties 配置文件定义 26 | * 27 | * @author lykan 28 | */ 29 | public interface PropertiesConfigResource extends ConfigResource { 30 | 31 | /** 32 | * 获取 K-V 列表 33 | * 34 | * @return K-V 列表 35 | */ 36 | List getKValueList(); 37 | } 38 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/resource/factory/ResourceFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.resource.factory; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 资源创建工厂 24 | * 25 | * @author lykan 26 | */ 27 | public interface ResourceFactory { 28 | 29 | /** 30 | * 获取资源列表 31 | * 32 | * @return 资源列表 33 | */ 34 | List getResourceList(); 35 | } 36 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/resource/service/RoleMatchResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.resource.service; 19 | 20 | import cn.kstry.framework.core.role.Role; 21 | 22 | import javax.annotation.Nonnull; 23 | 24 | /** 25 | * 角色匹配资源 26 | * 27 | * @author lykan 28 | */ 29 | public interface RoleMatchResource extends ServiceNodeIdentity { 30 | 31 | /** 32 | * 根据 角色匹配当前资源是否可以被使用 33 | * 34 | * @param role 角色 35 | * @return 是否匹配成功。true:匹配成功 36 | */ 37 | boolean match(@Nonnull Role role); 38 | } 39 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/resource/service/ServiceNodeIdentity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.resource.service; 19 | 20 | import cn.kstry.framework.core.enums.ServiceNodeType; 21 | import cn.kstry.framework.core.resource.identity.Identity; 22 | 23 | /** 24 | * 服务节点身份 25 | * 26 | * @author lyakn 27 | */ 28 | public interface ServiceNodeIdentity extends Identity { 29 | 30 | /** 31 | * 获取服务节点类型 32 | * 33 | * @return 服务节点类型 34 | */ 35 | ServiceNodeType getServiceNodeType(); 36 | } 37 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/role/BusinessRoleRegister.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.role; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | public interface BusinessRoleRegister { 27 | 28 | /** 29 | * 注册业务角色集 30 | */ 31 | List register(); 32 | } 33 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/role/ServiceTaskRole.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.role; 19 | 20 | /** 21 | * 使用该角色,无需授权就可以执行全部的服务节点,但是服务能力节点不会被执行。 22 | * 如果分配了服务能力节点,与之对应的服务节点权限将不允许被分配,否则会出现匹配到多个能力的异常 23 | * 24 | * @author lykan 25 | */ 26 | public class ServiceTaskRole extends BasicRole { 27 | 28 | public ServiceTaskRole() { 29 | super("default-service-task-role"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kstry-core/src/main/java/cn/kstry/framework/core/role/permission/Permission.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.core.role.permission; 19 | 20 | import cn.kstry.framework.core.enums.PermissionType; 21 | import cn.kstry.framework.core.resource.identity.Identity; 22 | 23 | /** 24 | * 权限 25 | * 26 | * @author lykan 27 | */ 28 | public interface Permission extends Identity, PermissionAuth { 29 | 30 | /** 31 | * 获取权限类型 32 | * 33 | * @return 权限类型 34 | */ 35 | PermissionType getPermissionType(); 36 | } 37 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/annotation/IgnoreScanAnn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.test.annotation; 19 | 20 | import java.lang.annotation.Documented; 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * @author lykan 28 | */ 29 | @Target(ElementType.TYPE) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Documented 32 | public @interface IgnoreScanAnn { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/bus/bo/BusTestResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.test.bus.bo; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | @Data 27 | public class BusTestResult { 28 | 29 | private int id; 30 | } 31 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/bus/bo/ConvTBo.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.bus.bo; 2 | 3 | import cn.kstry.framework.core.annotation.VarTaskField; 4 | import cn.kstry.framework.core.constant.TypeConverterNames; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | import java.util.Set; 9 | 10 | @Data 11 | public class ConvTBo { 12 | 13 | @VarTaskField 14 | private String nowStr; 15 | 16 | @VarTaskField 17 | private String localNowStr; 18 | 19 | @VarTaskField 20 | private boolean objBool; 21 | 22 | @VarTaskField(converter = TypeConverterNames.ONE_ITEM_TO_LIST) 23 | private List oneItemList; 24 | 25 | @VarTaskField(converter = TypeConverterNames.ONE_ITEM_TO_SET) 26 | private Set oneItemSet; 27 | 28 | @VarTaskField(converter = TypeConverterNames.FIRST_ITEM_FROM_LIST) 29 | private String firstItemList; 30 | 31 | @VarTaskField(converter = TypeConverterNames.FIRST_ITEM_FROM_LIST) 32 | private int zzInt; 33 | } 34 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/bo/ClassInfo.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.bo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Data 9 | @Builder 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class ClassInfo { 13 | 14 | private Long id; 15 | 16 | private String name; 17 | } 18 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/bo/RuleJudgeRequest.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.bo; 2 | 3 | import cn.kstry.framework.core.bus.ScopeData; 4 | import cn.kstry.framework.core.enums.ScopeTypeEnum; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class RuleJudgeRequest implements ScopeData { 9 | 10 | private int a; 11 | 12 | private int b; 13 | 14 | private int c; 15 | 16 | @Override 17 | public ScopeTypeEnum getScopeDataEnum() { 18 | return ScopeTypeEnum.VARIABLE; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/bo/ScoreInfo.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.bo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Data 9 | @Builder 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class ScoreInfo { 13 | 14 | private int score; 15 | 16 | private Long studentId; 17 | 18 | private String studyYear; 19 | 20 | private String course; 21 | 22 | private Long classId; 23 | 24 | private ClassInfo classInfo; 25 | } 26 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/bo/Student.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.bo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Student { 7 | 8 | private Long id; 9 | 10 | private String name; 11 | 12 | private String address; 13 | 14 | private String idCard; 15 | 16 | private String birthday; 17 | } 18 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/bo/StudentBasic.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.bo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class StudentBasic { 7 | 8 | private Long id; 9 | 10 | private String name; 11 | 12 | private String address; 13 | } 14 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/bo/StudentPrivacy.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.bo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class StudentPrivacy { 7 | 8 | private Long id; 9 | 10 | private String idCard; 11 | 12 | private String birthday; 13 | } 14 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/bo/StudyExperience.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.bo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | /** 9 | * 学习经历 10 | */ 11 | @Data 12 | @Builder 13 | @NoArgsConstructor 14 | @AllArgsConstructor 15 | public class StudyExperience { 16 | 17 | private Long studentId; 18 | 19 | private Long classId; 20 | 21 | private String studyYear; 22 | } 23 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/config/AllocateRoleConfig.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.config; 2 | 3 | import cn.kstry.framework.core.component.dynamic.creator.DynamicRole; 4 | import cn.kstry.framework.core.role.Role; 5 | import cn.kstry.framework.core.role.ServiceTaskRole; 6 | import cn.kstry.framework.core.util.PermissionUtil; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.util.Objects; 10 | import java.util.Optional; 11 | 12 | @Component 13 | public class AllocateRoleConfig implements DynamicRole { 14 | 15 | @Override 16 | public Optional getRole(String key) { 17 | if (Objects.equals("test-rbac-flow-demo@external-business-id", key)) { 18 | ServiceTaskRole serviceTaskRole = new ServiceTaskRole(); 19 | serviceTaskRole.addPermission(PermissionUtil.permissionList("r:calculatePrice@external, r:lockStock@external")); 20 | return Optional.of(serviceTaskRole); 21 | } 22 | return Optional.empty(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/config/CustomExpressionFunction.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.config; 2 | 3 | import cn.kstry.framework.core.component.expression.ExpressionAlias; 4 | import cn.kstry.framework.core.component.expression.ExpressionAliasRegister; 5 | import com.google.common.collect.Lists; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.List; 9 | import java.util.Objects; 10 | 11 | @Component 12 | public class CustomExpressionFunction implements ExpressionAliasRegister { 13 | 14 | @Override 15 | public List registerAlias() { 16 | return Lists.newArrayList(new ExpressionAlias("eq", Objects.class, "equals")); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/config/Ex.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.config; 2 | 3 | import cn.kstry.framework.core.component.expression.Exp; 4 | import cn.kstry.framework.core.util.GlobalUtil; 5 | 6 | import java.util.function.Consumer; 7 | 8 | /** 9 | * 扩展工具类 10 | */ 11 | public class Ex extends Exp { 12 | 13 | public Ex customEquals(String left, String right) { 14 | this.expression = GlobalUtil.format("{}@eq({}, {})", this.expression, left, right); 15 | return this; 16 | } 17 | 18 | public static String bu(Consumer builder) { 19 | return b(new Ex(), builder); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/facade/CommonFields.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.facade; 2 | 3 | import cn.kstry.framework.test.demo.bo.ClassInfo; 4 | import cn.kstry.framework.test.demo.bo.Student; 5 | import lombok.experimental.FieldNameConstants; 6 | 7 | @SuppressWarnings("unused") 8 | @FieldNameConstants(innerTypeName = "F") 9 | public class CommonFields { 10 | 11 | private int type; 12 | 13 | private int a; 14 | 15 | private int b; 16 | 17 | private String factor; 18 | 19 | private boolean lockStockResult; 20 | 21 | private int calculateRes; 22 | 23 | private long goodsId; 24 | 25 | private long price; 26 | 27 | private Long studentId; 28 | 29 | private Long classId; 30 | 31 | private Student student; 32 | 33 | private ClassInfo classInfo; 34 | } 35 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/facade/QueryScoreRequest.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.facade; 2 | 3 | import lombok.Data; 4 | import lombok.experimental.FieldNameConstants; 5 | 6 | @Data 7 | @FieldNameConstants(innerTypeName = "F") 8 | public class QueryScoreRequest { 9 | 10 | private Long studentId; 11 | 12 | private boolean needScore; 13 | } 14 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/facade/QueryScoreResponse.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.facade; 2 | 3 | import cn.kstry.framework.test.demo.bo.ScoreInfo; 4 | import cn.kstry.framework.test.demo.bo.Student; 5 | import lombok.Data; 6 | import lombok.experimental.FieldNameConstants; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @FieldNameConstants(innerTypeName = "F") 12 | public class QueryScoreResponse { 13 | 14 | private Student student; 15 | 16 | private List scoreInfos; 17 | } 18 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/facade/QueryScoreVarScope.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.facade; 2 | 3 | import cn.kstry.framework.core.bus.ScopeData; 4 | import cn.kstry.framework.core.enums.ScopeTypeEnum; 5 | import cn.kstry.framework.test.demo.bo.*; 6 | import lombok.Data; 7 | import lombok.experimental.FieldNameConstants; 8 | 9 | import java.util.List; 10 | 11 | @Data 12 | @FieldNameConstants(innerTypeName = "F") 13 | public class QueryScoreVarScope implements ScopeData { 14 | 15 | private StudentBasic studentBasic; 16 | 17 | private StudentPrivacy studentPrivacy; 18 | 19 | private String student; 20 | 21 | private List studyExperienceList; 22 | 23 | private List classIds; 24 | 25 | private List classInfos; 26 | 27 | private List scoreInfos; 28 | 29 | @Override 30 | public ScopeTypeEnum getScopeDataEnum() { 31 | return ScopeTypeEnum.VARIABLE; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/service/ExternalOrderService.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.service; 2 | 3 | import cn.kstry.framework.core.annotation.NoticeVar; 4 | import cn.kstry.framework.core.annotation.TaskComponent; 5 | import cn.kstry.framework.core.annotation.TaskService; 6 | import cn.kstry.framework.test.demo.facade.CommonFields; 7 | 8 | @TaskComponent(name = "orderService", scanSuper = false) 9 | public class ExternalOrderService extends InnerOrderService { 10 | 11 | @Override 12 | @NoticeVar(target = CommonFields.F.price) 13 | @TaskService(ability = "external") 14 | public long calculatePrice(long goodsId) { 15 | System.out.println("ExternalOrderService calculatePrice..."); 16 | return 200L; 17 | } 18 | 19 | @Override 20 | @NoticeVar(target = CommonFields.F.lockStockResult) 21 | @TaskService(ability = "external") 22 | public boolean lockStock(long goodsId) { 23 | System.out.println("ExternalOrderService lockStock..."); 24 | return false; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/service/FlowDemoService.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.service; 2 | 3 | import cn.kstry.framework.core.annotation.NoticeVar; 4 | import cn.kstry.framework.core.annotation.TaskComponent; 5 | import cn.kstry.framework.core.annotation.TaskService; 6 | import cn.kstry.framework.core.annotation.VarTaskParam; 7 | import cn.kstry.framework.test.demo.bo.ClassInfo; 8 | import cn.kstry.framework.test.demo.bo.Student; 9 | 10 | @TaskComponent 11 | public class FlowDemoService { 12 | 13 | @NoticeVar 14 | @TaskService(desc = "获取学生信息") 15 | public Student getStudentInfo(@VarTaskParam Long studentId) { 16 | Student student = new Student(); 17 | student.setId(studentId); 18 | student.setName("Name" + studentId); 19 | return student; 20 | } 21 | 22 | @NoticeVar 23 | @TaskService(desc = "获取班级信息") 24 | public ClassInfo getClassInfo(@VarTaskParam Long classId) { 25 | ClassInfo classInfo = new ClassInfo(); 26 | classInfo.setId(classId); 27 | classInfo.setName("Name" + classId); 28 | return classInfo; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/service/InnerOrderService.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.service; 2 | 3 | import cn.kstry.framework.core.annotation.NoticeResult; 4 | import cn.kstry.framework.core.annotation.NoticeVar; 5 | import cn.kstry.framework.core.annotation.TaskComponent; 6 | import cn.kstry.framework.core.annotation.TaskService; 7 | import cn.kstry.framework.test.demo.facade.CommonFields; 8 | 9 | @TaskComponent(name = "orderService") 10 | public class InnerOrderService implements OrderService { 11 | 12 | @Override 13 | @TaskService 14 | @NoticeVar(target = CommonFields.F.price) 15 | public long calculatePrice(long goodsId) { 16 | System.out.println("InnerOrderService calculatePrice..."); 17 | return 100L; 18 | } 19 | 20 | @Override 21 | @TaskService 22 | @NoticeVar(target = CommonFields.F.lockStockResult) 23 | public boolean lockStock(long goodsId) { 24 | System.out.println("InnerOrderService lockStock..."); 25 | return true; 26 | } 27 | 28 | @Override 29 | @NoticeResult 30 | @TaskService 31 | public long geneOrderId(long price, long goodsId) { 32 | System.out.println("InnerOrderService geneOrderId..."); 33 | return 2987; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/demo/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.demo.service; 2 | 3 | public interface OrderService { 4 | 5 | long calculatePrice(long goodsId); 6 | 7 | boolean lockStock(long goodsId); 8 | 9 | long geneOrderId(long price, long goodsId); 10 | } 11 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/diagram/DiagramCaseTestContextConfiguration.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.diagram; 2 | 3 | import cn.kstry.framework.core.annotation.EnableKstry; 4 | import org.springframework.context.annotation.ComponentScan; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.context.annotation.PropertySource; 7 | 8 | @Configuration 9 | @EnableKstry(bpmnPath = "./bpmn/diagram/*.bpmn") 10 | @PropertySource("classpath:application.properties") 11 | @ComponentScan(basePackageClasses = DiagramCaseTestContextConfiguration.class) 12 | public class DiagramCaseTestContextConfiguration { 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/diagram/bo/CalculateServiceRequest.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.diagram.bo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CalculateServiceRequest { 7 | 8 | private int a; 9 | 10 | private Boolean b; 11 | 12 | private String c; 13 | 14 | private int d; 15 | } 16 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/diagram/constants/SCS.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.diagram.constants; 2 | 3 | import lombok.experimental.FieldNameConstants; 4 | 5 | @SuppressWarnings("unused") 6 | @FieldNameConstants(innerTypeName = "F") 7 | public class SCS { 8 | 9 | /** 10 | * 计算组件 11 | */ 12 | private String CALCULATE_SERVICE; 13 | 14 | /** 15 | * 计算组件中服务节点 16 | */ 17 | @FieldNameConstants(innerTypeName = "F") 18 | public static class CALCULATE_SERVICE { 19 | 20 | /** 21 | * 加一 22 | */ 23 | private String INCREASE_ONE; 24 | 25 | /** 26 | * 相乘 27 | */ 28 | private String MULTIPLY_PLUS; 29 | 30 | /** 31 | * 增加超时 32 | */ 33 | private String INCREASE_TIMEOUT; 34 | 35 | /** 36 | * 数组元素 +1 37 | */ 38 | private String INCREASE_ARRAY_ONE; 39 | 40 | /** 41 | * 计算错误 42 | */ 43 | private String CALCULATE_ERROR; 44 | 45 | /** 46 | * 计算错误,进行降级 47 | */ 48 | private String CALCULATE_ERROR_DEMOTION; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/diagram/constants/StoryNameConstants.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.diagram.constants; 2 | 3 | public interface StoryNameConstants { 4 | 5 | String A001 = "action-001"; 6 | String A002 = "action-002"; 7 | String A003 = "action-003"; 8 | String A004 = "action-004"; 9 | String A005 = "action-005"; 10 | String A006 = "action-006"; 11 | String A007 = "action-007"; 12 | 13 | String D001 = "dynamic-001"; 14 | String D002 = "dynamic-002"; 15 | String D003 = "dynamic-003"; 16 | String D004 = "dynamic-004"; 17 | String D005 = "dynamic-005"; 18 | String D006 = "dynamic-006"; 19 | String D007 = "dynamic-007"; 20 | String D008 = "dynamic-008"; 21 | 22 | String JS001 = "JsScript-001"; 23 | String JS002 = "JsScript-002"; 24 | String JS003 = "JsScript-003"; 25 | } 26 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/bo/Activity.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.bo; 2 | 3 | import cn.kstry.framework.core.annotation.NoticeSta; 4 | 5 | @NoticeSta 6 | public class Activity { 7 | 8 | private Long id; 9 | 10 | private Long discountPrice; 11 | 12 | public Long getId() { 13 | return id; 14 | } 15 | 16 | public void setId(Long id) { 17 | this.id = id; 18 | } 19 | 20 | public Long getDiscountPrice() { 21 | return discountPrice; 22 | } 23 | 24 | public void setDiscountPrice(Long discountPrice) { 25 | this.discountPrice = discountPrice; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/bo/CycleRequest.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.bo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CycleRequest { 7 | 8 | private int count; 9 | } 10 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/bo/Goods.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.bo; 2 | 3 | import cn.kstry.framework.core.annotation.NoticeResult; 4 | import cn.kstry.framework.core.annotation.ReqTaskField; 5 | 6 | import javax.validation.constraints.NotNull; 7 | 8 | @NoticeResult 9 | public class Goods { 10 | 11 | @NotNull(message = "goods.id 不能为空") 12 | @ReqTaskField("id") 13 | private Long id; 14 | 15 | private String name; 16 | 17 | private Long price; 18 | 19 | private Hospital hospital; 20 | 21 | public Long getId() { 22 | return id; 23 | } 24 | 25 | public void setId(Long id) { 26 | this.id = id; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public Long getPrice() { 38 | return price; 39 | } 40 | 41 | public void setPrice(Long price) { 42 | this.price = price; 43 | } 44 | 45 | public Hospital getHospital() { 46 | return hospital; 47 | } 48 | 49 | public void setHospital(Hospital hospital) { 50 | this.hospital = hospital; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/bo/Hospital.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.bo; 2 | 3 | import cn.kstry.framework.core.annotation.NoticeSta; 4 | import cn.kstry.framework.core.annotation.SpringInitialization; 5 | import cn.kstry.framework.core.annotation.StaTaskField; 6 | 7 | @NoticeSta 8 | @SpringInitialization 9 | public class Hospital { 10 | 11 | @StaTaskField({"hospital", "id"}) 12 | private Long id; 13 | 14 | @NoticeSta 15 | @StaTaskField({"hospital", "name"}) 16 | private String name; 17 | 18 | public Long getId() { 19 | return id; 20 | } 21 | 22 | public void setId(Long id) { 23 | this.id = id; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public void setName(String name) { 31 | this.name = name; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/bo/MethodInvokeBo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.test.flow.bo; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | @Data 27 | public class MethodInvokeBo { 28 | 29 | private int a; 30 | 31 | private Boolean b; 32 | 33 | private String c; 34 | 35 | private int d; 36 | } 37 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/bo/Te4Request.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.bo; 2 | 3 | import com.google.common.collect.Lists; 4 | 5 | import java.util.List; 6 | 7 | public class Te4Request { 8 | 9 | private Long goodsId; 10 | 11 | private Long activityId; 12 | 13 | private long hospitalId; 14 | 15 | private int count; 16 | 17 | private List nodeList = Lists.newCopyOnWriteArrayList(); 18 | 19 | public Long getGoodsId() { 20 | return goodsId; 21 | } 22 | 23 | public void setGoodsId(Long goodsId) { 24 | this.goodsId = goodsId; 25 | } 26 | 27 | public Long getActivityId() { 28 | return activityId; 29 | } 30 | 31 | public void setActivityId(Long activityId) { 32 | this.activityId = activityId; 33 | } 34 | 35 | public long getHospitalId() { 36 | return hospitalId; 37 | } 38 | 39 | public void setHospitalId(long hospitalId) { 40 | this.hospitalId = hospitalId; 41 | } 42 | 43 | public List getNodeList() { 44 | return nodeList; 45 | } 46 | 47 | public synchronized int getCount() { 48 | return count; 49 | } 50 | 51 | public synchronized void increase() { 52 | this.count++; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/config/SwitchHookBo.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.config; 2 | 3 | public class SwitchHookBo { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/config/TrackingEventListener.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.config; 2 | 3 | import cn.kstry.framework.core.component.event.TrackingBeginEvent; 4 | import cn.kstry.framework.core.component.event.TrackingFinishEvent; 5 | import com.alibaba.fastjson.JSON; 6 | import org.springframework.context.event.EventListener; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | public class TrackingEventListener { 11 | 12 | @EventListener 13 | public void handleTrackingBeginEvent(TrackingBeginEvent event) { 14 | assert event.getNodeTracking() != null; 15 | // System.out.println("TrackingBeginEvent:" + JSON.toJSONString(event)); 16 | } 17 | 18 | @EventListener 19 | public void handleTrackingFinishEvent(TrackingFinishEvent event) { 20 | assert event.getNodeTracking() != null; 21 | // System.out.println("TrackingFinishEvent:" + JSON.toJSONString(event)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/config/ValidatorConfig.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; 6 | 7 | @Configuration 8 | public class ValidatorConfig { 9 | 10 | @Bean 11 | public MethodValidationPostProcessor methodValidationPostProcessor() { 12 | return new MethodValidationPostProcessor(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/repeatedly/AsfBiz.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.repeatedly; 2 | 3 | import cn.kstry.framework.core.annotation.TaskComponent; 4 | import cn.kstry.framework.core.annotation.TaskService; 5 | 6 | @TaskComponent(name = "asf") 7 | public class AsfBiz extends BaseBiz { 8 | 9 | @Override 10 | @TaskService(name = "invoke-repeatedly-defined") 11 | public String invoke(String param) { 12 | return null; 13 | } 14 | 15 | @Override 16 | @TaskService(name = "invoke-repeatedly-defined2") 17 | public String invoke() { 18 | return null; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/flow/repeatedly/BaseBiz.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.flow.repeatedly; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | 5 | @Slf4j 6 | public abstract class BaseBiz { 7 | 8 | protected abstract A invoke(B param); 9 | 10 | protected abstract A invoke(); 11 | } 12 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/iterator/bo/DataSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.test.iterator.bo; 19 | 20 | import lombok.Data; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * 26 | * @author lykan 27 | */ 28 | @Data 29 | public class DataSource { 30 | 31 | private Integer[] numList; 32 | } 33 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/kv/service/DynamicValue.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.kv.service; 2 | 3 | import cn.kstry.framework.core.component.dynamic.creator.DynamicKValue; 4 | import cn.kstry.framework.core.kv.KvScope; 5 | import org.junit.Assert; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.Optional; 9 | 10 | @Component 11 | public class DynamicValue implements DynamicKValue { 12 | 13 | @Override 14 | public long version(String key) { 15 | return DynamicKValue.super.version(key); 16 | } 17 | 18 | @Override 19 | public Optional getValue(String key, KvScope kvScope) { 20 | Assert.assertEquals("new-per-scope", kvScope.getScope()); 21 | Assert.assertEquals("business-channel", kvScope.getBusinessId().orElse(null)); 22 | if (key.equals("dynamic")) { 23 | return Optional.of("dynamic"); 24 | } 25 | return Optional.empty(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/mono/bo/SayInfoRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.test.mono.bo; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | @Data 27 | public class SayInfoRequest { 28 | 29 | private int a; 30 | 31 | private Boolean b; 32 | 33 | private String c; 34 | 35 | private int d; 36 | } 37 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/role/bo/SayInfoRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.test.role.bo; 19 | 20 | /** 21 | * 22 | * @author lykan 23 | */ 24 | public class SayInfoRequest { 25 | 26 | private Integer number; 27 | 28 | public Integer getNumber() { 29 | return number; 30 | } 31 | 32 | public void setNumber(Integer number) { 33 | this.number = number; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/role/service/CustomRoleService.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.framework.test.role.service; 2 | 3 | import cn.kstry.framework.core.annotation.CustomRole; 4 | import cn.kstry.framework.core.annotation.TaskComponent; 5 | import cn.kstry.framework.core.annotation.TaskService; 6 | import cn.kstry.framework.core.role.Role; 7 | import cn.kstry.framework.core.util.AssertUtil; 8 | import cn.kstry.framework.core.util.PermissionUtil; 9 | 10 | /** 11 | * 12 | * @author lykan 13 | */ 14 | @SuppressWarnings("unused") 15 | @TaskComponent(name = "custom-role-test") 16 | public class CustomRoleService { 17 | 18 | @CustomRole 19 | @TaskService(name = "custom-role-service") 20 | public void custom(Role role) { 21 | AssertUtil.notNull(role); 22 | role.addPermission(PermissionUtil.permissionList("r:say_number")); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/subprocess/bo/SubProcessBo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.test.subprocess.bo; 19 | 20 | import lombok.Data; 21 | 22 | import java.util.concurrent.atomic.AtomicInteger; 23 | 24 | /** 25 | * 26 | * @author lykan 27 | */ 28 | @Data 29 | public class SubProcessBo { 30 | 31 | private int a; 32 | 33 | private long b; 34 | 35 | private boolean c; 36 | 37 | private String d; 38 | 39 | private double e; 40 | 41 | private AtomicInteger f; 42 | } 43 | -------------------------------------------------------------------------------- /kstry-core/src/test/java/cn/kstry/framework/test/util/TestUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2024, Lykan (jiashuomeng@gmail.com). 4 | * *

5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * *

9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * *

11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.framework.test.util; 19 | 20 | import java.util.stream.IntStream; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | public class TestUtil { 27 | 28 | // public static final String TEST_PROCESS_TYPE = "json"; 29 | public static final String TEST_PROCESS_TYPE = "bpmn"; 30 | 31 | /** 32 | * 重复测试 33 | */ 34 | public static void repeatTest(int num, Runnable run) { 35 | IntStream.range(0, num).parallel().forEach(x -> run.run()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /kstry-core/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=prod 2 | kstry.story.timeout=2000 3 | kstry.story.success-code=200 4 | kstry.story.tracking.type=none 5 | kstry.story.tracking.log=true 6 | kstry.story.request-id=ks-request-id 7 | kstry.story.define-node-params=true 8 | kstry.story.max-cycle-count=20 9 | kstry.thread.pool.core-size=8 10 | kstry.thread.pool.max-size=16 11 | kstry.thread.pool.keep-alive-time=5 12 | kstry.thread.pool.queue-size=5000 13 | kstry.thread.pool.monitor.delay=1000 14 | kstry.thread.ignore-copy-prefix=Xxx 15 | kstry.thread.pool.monitor.enable=true 16 | kstry.thread.pool.shutdown-await=1000 17 | kstry.thread.pool.shutdown-now-await=10 18 | kstry.story.tracking.value-max-length=40 19 | kstry.converter.date-format=yyyy-MM-dd HH:mm:ss 20 | kstry.thread.open-virtual = false 21 | -------------------------------------------------------------------------------- /kstry-core/src/test/resources/bpmn/kv/business-channel-config.yml: -------------------------------------------------------------------------------- 1 | business-channel@dev: 2 | default: 3 | name: name 4 | 5 | business-channel: 6 | default: 7 | name1: name1 8 | name2: name2 9 | name3: name3 10 | name4: name-4 11 | new-per-scope: 12 | name1: name1 13 | name2: name-2 14 | 15 | business-channel@prod: 16 | default: 17 | name1: name1 18 | name2: name2 19 | name3: name-3 20 | bust: 21 | new-per-scope: 22 | name1: name-1 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /kstry-core/src/test/resources/bpmn/kv/scope-default-config.yml: -------------------------------------------------------------------------------- 1 | default: 2 | name1: name1 3 | name2: name2 4 | name3: name3 5 | name4: name4 6 | name5: name5 7 | name6: name6 8 | name7: name7 9 | name8: name-8 10 | fir: fir 11 | ate: ate 12 | bust: bust 13 | ids: 14 | - 1 15 | - 2 16 | - 3 17 | - 4 18 | 19 | default@prod: 20 | name1: name1 21 | name2: name2 22 | name3: name3 23 | name4: name4 24 | name5: name5 25 | name6: name6 26 | name7: name-7 27 | fir: 28 | 29 | new-per-scope: 30 | name1: name1 31 | name2: name2 32 | name3: name3 33 | name4: name4 34 | name5: name5 35 | name6: name-6 36 | ate: 37 | 38 | new-per-scope@prod: 39 | name1: name1 40 | name2: name2 41 | name3: name3 42 | name4: name4 43 | name5: name-5 -------------------------------------------------------------------------------- /kstry-core/src/test/resources/bpmn/kv/test_kv_001.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "process-id": "Process_027m9ap", 4 | "process-nodes": [ 5 | { 6 | "id": "story-def-kv-test_001", 7 | "next-nodes": [ 8 | "Flow_1a2t1yq" 9 | ], 10 | "type": "start_event" 11 | }, 12 | { 13 | "id": "Flow_1a2t1yq", 14 | "next-nodes": [ 15 | "Activity_1hthdiz" 16 | ], 17 | "type": "sequence_flow" 18 | }, 19 | { 20 | "id": "Activity_1hthdiz", 21 | "name": "获取变量", 22 | "next-nodes": [ 23 | "Flow_09w4534" 24 | ], 25 | "properties": { 26 | "task-component": "kv-test", 27 | "allow-absent": false, 28 | "strict-mode": true, 29 | "task-service": "kv-service-business" 30 | }, 31 | "type": "service_task" 32 | }, 33 | { 34 | "id": "Flow_09w4534", 35 | "next-nodes": [ 36 | "a9c501c8f22541aa9b2ec55883f7dea9" 37 | ], 38 | "type": "sequence_flow" 39 | }, 40 | { 41 | "id": "a9c501c8f22541aa9b2ec55883f7dea9", 42 | "next-nodes": [], 43 | "type": "end_event" 44 | } 45 | ], 46 | "start-id": "story-def-kv-test_001", 47 | "sub-process": false 48 | } 49 | ] -------------------------------------------------------------------------------- /kstry-core/src/test/resources/bpmn/load/load_bpmn_002.bpmn: -------------------------------------------------------------------------------- 1 | 2 | a -------------------------------------------------------------------------------- /kstry-flux-demo/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | .mvn 22 | 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | build/ 31 | !**/src/main/**/build/ 32 | !**/src/test/**/build/ 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | 37 | .DS_Store 38 | 39 | 2022-* 40 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/KstryFluxDemoApplication.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo; 2 | 3 | import cn.kstry.framework.core.annotation.EnableKstry; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | /** 9 | * bpmnPath: 指定bpmn文件位置 10 | */ 11 | @EnableScheduling 12 | @EnableKstry(bpmnPath = "./bpmn/*.bpmn,./bpmn/*.json", propertiesPath = "./config/*.yml") 13 | @SpringBootApplication 14 | public class KstryFluxDemoApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(KstryFluxDemoApplication.class, args); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/goods/EvaluationInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.dto.goods; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | @Data 27 | public class EvaluationInfo { 28 | 29 | private Integer evaluateCount; 30 | } 31 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/goods/GoodsExtInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.dto.goods; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | @Data 27 | public class GoodsExtInfo { 28 | 29 | private Integer collectCount; 30 | } 31 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/goods/LogisticInsurance.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.dto.goods; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | @Data 27 | public class LogisticInsurance { 28 | 29 | private Integer type; 30 | 31 | private String desc; 32 | } 33 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/goods/OrderInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.dto.goods; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | @Data 27 | public class OrderInfo { 28 | 29 | private Integer orderedCount; 30 | } 31 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/goods/ShopInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.dto.goods; 19 | 20 | import lombok.Data; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * @author lykan 26 | */ 27 | @Data 28 | public class ShopInfo { 29 | 30 | private Long id; 31 | 32 | private String shopName; 33 | 34 | private List labels; 35 | 36 | private Integer salesNumMonthly; 37 | } 38 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/goods/ShopLabel.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.dto.goods; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author lykan 7 | */ 8 | @Data 9 | public class ShopLabel { 10 | 11 | private Integer index; 12 | 13 | private String name; 14 | 15 | private String url; 16 | } 17 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/goods/SkuInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.dto.goods; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * 24 | * @author lykan 25 | */ 26 | @Data 27 | public class SkuInfo { 28 | 29 | private Long skuId; 30 | 31 | private String skuName; 32 | 33 | private Long price; 34 | 35 | private Integer stock; 36 | 37 | private String img; 38 | } 39 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/student/ClassInfo.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.dto.student; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Data 9 | @Builder 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class ClassInfo { 13 | 14 | private Long id; 15 | 16 | private String name; 17 | } 18 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/student/ScoreInfo.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.dto.student; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Data 9 | @Builder 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class ScoreInfo { 13 | 14 | private int score; 15 | 16 | private Long studentId; 17 | 18 | private String studyYear; 19 | 20 | private String course; 21 | 22 | private Long classId; 23 | 24 | private ClassInfo classInfo; 25 | } 26 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/student/Student.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.dto.student; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Student { 7 | 8 | private Long id; 9 | 10 | private String name; 11 | 12 | private String address; 13 | 14 | private String idCard; 15 | 16 | private String birthday; 17 | } 18 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/student/StudentBasic.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.dto.student; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class StudentBasic { 7 | 8 | private Long id; 9 | 10 | private String name; 11 | 12 | private String address; 13 | } 14 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/student/StudentPrivacy.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.dto.student; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class StudentPrivacy { 7 | 8 | private Long id; 9 | 10 | private String idCard; 11 | 12 | private String birthday; 13 | } 14 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/dto/student/StudyExperience.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.dto.student; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | /** 9 | * 学习经历 10 | */ 11 | @Data 12 | @Builder 13 | @NoArgsConstructor 14 | @AllArgsConstructor 15 | public class StudyExperience { 16 | 17 | private Long studentId; 18 | 19 | private Long classId; 20 | 21 | private String studyYear; 22 | } 23 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/facade/goods/CheckInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.facade.goods; 19 | 20 | import cn.kstry.flux.demo.dto.goods.GoodsDetail; 21 | import cn.kstry.framework.core.annotation.StaTaskField; 22 | import lombok.Data; 23 | 24 | /** 25 | * @author lykan 26 | */ 27 | @Data 28 | public class CheckInfo { 29 | 30 | @StaTaskField({ShowGoodsSta.GOODS_DETAIL, GoodsDetail.F.img}) 31 | private String img; 32 | } 33 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/facade/goods/GetLogisticInsuranceRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.facade.goods; 19 | 20 | import cn.kstry.framework.core.annotation.ReqTaskField; 21 | import lombok.Data; 22 | 23 | /** 24 | * @author lykan 25 | */ 26 | @Data 27 | public class GetLogisticInsuranceRequest { 28 | 29 | @ReqTaskField(GoodsDetailRequest.F.source) 30 | private String source; 31 | } 32 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/facade/goods/GoodsDetailRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.facade.goods; 19 | 20 | import lombok.Data; 21 | import lombok.experimental.FieldNameConstants; 22 | 23 | /** 24 | * 25 | * @author lykan 26 | */ 27 | @Data 28 | @FieldNameConstants(innerTypeName = "F") 29 | public class GoodsDetailRequest { 30 | 31 | private Long id; 32 | 33 | private String source; 34 | 35 | private String businessId; 36 | } 37 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/facade/goods/InitSkuResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2020-2021, Lykan (jiashuomeng@gmail.com). 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package cn.kstry.flux.demo.facade.goods; 19 | 20 | import cn.kstry.flux.demo.dto.goods.GoodsDetail; 21 | import cn.kstry.flux.demo.dto.goods.SkuInfo; 22 | import cn.kstry.framework.core.annotation.NoticeSta; 23 | import lombok.Builder; 24 | import lombok.Data; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author lykan 30 | */ 31 | @Data 32 | @Builder 33 | public class InitSkuResponse { 34 | 35 | @NoticeSta(target = {ShowGoodsSta.GOODS_DETAIL, GoodsDetail.F.skuInfos}) 36 | private List skuInfos; 37 | } 38 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/facade/goods/ShowGoodsSta.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.facade.goods; 2 | 3 | public interface ShowGoodsSta { 4 | 5 | String GOODS_DETAIL = "GOODS_DETAIL"; 6 | 7 | String SHOP_INFO = "SHOP_INFO"; 8 | } 9 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/facade/http/ResultProperty.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.facade.http; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ResultProperty { 7 | 8 | private String target; 9 | 10 | private String converter; 11 | 12 | private String type; 13 | } 14 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/facade/student/QueryScoreRequest.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.facade.student; 2 | 3 | import lombok.Data; 4 | import lombok.experimental.FieldNameConstants; 5 | 6 | @Data 7 | @FieldNameConstants(innerTypeName = "F") 8 | public class QueryScoreRequest { 9 | 10 | private Long studentId; 11 | 12 | private boolean needScore; 13 | } 14 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/facade/student/QueryScoreResponse.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.facade.student; 2 | 3 | import cn.kstry.flux.demo.dto.student.ScoreInfo; 4 | import cn.kstry.flux.demo.dto.student.Student; 5 | import lombok.Data; 6 | import lombok.experimental.FieldNameConstants; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @FieldNameConstants(innerTypeName = "F") 12 | public class QueryScoreResponse { 13 | 14 | private Student student; 15 | 16 | private List scoreInfos; 17 | } 18 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/java/cn/kstry/flux/demo/facade/student/QueryScoreVarScope.java: -------------------------------------------------------------------------------- 1 | package cn.kstry.flux.demo.facade.student; 2 | 3 | import cn.kstry.flux.demo.dto.student.*; 4 | import cn.kstry.framework.core.bus.ScopeData; 5 | import cn.kstry.framework.core.enums.ScopeTypeEnum; 6 | import lombok.Data; 7 | import lombok.experimental.FieldNameConstants; 8 | 9 | import java.util.List; 10 | 11 | @Data 12 | @FieldNameConstants(innerTypeName = "F") 13 | public class QueryScoreVarScope implements ScopeData { 14 | 15 | private StudentBasic studentBasic; 16 | 17 | private StudentPrivacy studentPrivacy; 18 | 19 | private String student; 20 | 21 | private List studyExperienceList; 22 | 23 | private List classIds; 24 | 25 | private List classInfos; 26 | 27 | private List scoreInfos; 28 | 29 | @Override 30 | public ScopeTypeEnum getScopeDataEnum() { 31 | return ScopeTypeEnum.VARIABLE; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: kstry-flux-demo 4 | profiles: 5 | active: dev 6 | 7 | kstry: 8 | thread: 9 | pool: 10 | shutdown-now-await: 3000 11 | shutdown-await: 3000 12 | queue-size: 5000 13 | keep-alive-time: 10 14 | max-size: 16 15 | core-size: 8 16 | monitor: 17 | enable: true 18 | delay: 60000 19 | open-virtual: true 20 | story: 21 | request-id: traceId 22 | tracking: 23 | log: true 24 | type: service 25 | success-code: 200 26 | timeout: 3000 -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/resources/config/global-default.yml: -------------------------------------------------------------------------------- 1 | default: 2 | banner: https://aass.png 3 | shop-blacklist-ids: 4 | - 2 5 | - 3 6 | - 4 7 | - 5 8 | 9 | default@dev: 10 | shop-blacklist-ids: 11 | - 8 12 | - 9 13 | -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/resources/config/goods-config.yml: -------------------------------------------------------------------------------- 1 | init-shop-info: 2 | labels: 3 | - url: https://xxx.png 4 | name: L1 5 | index: 1 6 | - url: https://xxx2.png 7 | name: L2 8 | index: 2 -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/resources/config/risk-control-config.yml: -------------------------------------------------------------------------------- 1 | # risk-control-config.yml 同样是为了维护和阅读方便才新建的文件 2 | 3 | # 风控默认配置 4 | risk-control: 5 | img-max-size: 100 6 | 7 | # 业务维度变量配置 8 | special-channel: # 请求入参传入的businessId 9 | risk-control: # 在修改风控域变量时 10 | img-max-size: 200 # 将该字段的风控域默认变量,替换成这个变量的值 -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/resources/img/goods-show-demo-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/kstry-flux-demo/kstry-flux-demo-web/src/main/resources/img/goods-show-demo-flow.png -------------------------------------------------------------------------------- /kstry-flux-demo/kstry-flux-demo-web/src/main/resources/server/httpServer.js: -------------------------------------------------------------------------------- 1 | var 2 | http = require('http'), 3 | fs = require('fs') 4 | 5 | var server = http.createServer(function(request, response) { 6 | var url = request.url.substr(1); 7 | setTimeout(() => { 8 | fs.readFile('./data.json', function(err, data) { 9 | if (!err) { 10 | response.writeHead(200, { 11 | "Content-Type": "application/json; charset=utf-8" 12 | }); 13 | var reqData = ''; 14 | request.on('data', function (raw) { 15 | reqData += raw; 16 | }); 17 | request.on('end', function () { 18 | var d = JSON.parse(data); 19 | console.log(new Date().toLocaleString() + " - request data: " + decodeURI(reqData) + ". response data: " + JSON.stringify(d[url])); 20 | response.end(JSON.stringify(d[url])); 21 | }); 22 | } else { 23 | throw err; 24 | } 25 | }) 26 | }, 0) 27 | }); 28 | server.listen(8787); 29 | console.log("server is running at http://127.0.0.1:8787"); -------------------------------------------------------------------------------- /kstry-process-designer/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /kstry-process-designer/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | browser: true, 5 | node: true, 6 | es6: true 7 | }, 8 | extends: ["plugin:vue/essential", "eslint:recommended", "plugin:prettier/recommended"], 9 | parserOptions: { 10 | parser: "@babel/eslint-parser" 11 | }, 12 | rules: { 13 | "prettier/prettier": [ 14 | "warn", 15 | { 16 | singleQuote: false, // 不使用单引号 17 | printWidth: 120, // 换行字符串阈值 18 | semi: true, // 句末加分号 19 | trailingComma: "none" // 最后一个对象元素加逗号 20 | } 21 | ], 22 | "vue/no-mutating-props": 0, 23 | "linebreak-style": 0, 24 | "no-unused-vars": 0, 25 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", 26 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off" 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /kstry-process-designer/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /kstry-process-designer/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/cli-plugin-babel/preset"] 3 | }; 4 | -------------------------------------------------------------------------------- /kstry-process-designer/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "esnext", 5 | "baseUrl": "./", 6 | "moduleResolution": "node", 7 | "paths": { 8 | "@/*": [ 9 | "src/*" 10 | ] 11 | }, 12 | "lib": [ 13 | "esnext", 14 | "dom", 15 | "dom.iterable", 16 | "scripthost" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /kstry-process-designer/lint-staged.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "*.{js,jsx,vue}": "vue-cli-service lint" 3 | }; 4 | -------------------------------------------------------------------------------- /kstry-process-designer/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name localhost; 4 | 5 | set $target http://node-server-container:3000; 6 | 7 | #charset koi8-r; 8 | # gzip 9 | access_log /var/log/nginx/host.access.log main; 10 | error_log /var/log/nginx/error.log error; 11 | 12 | location / { 13 | root /usr/share/nginx/html; 14 | index index.html index.htm; 15 | } 16 | 17 | error_page 500 502 503 504 /50x.html; 18 | 19 | location = /50x.html { 20 | root /usr/share/nginx/html; 21 | } 22 | 23 | 24 | location ~* ^\/(user|login|search)\/ { 25 | proxy_pass $target; 26 | 27 | proxy_http_version 1.1; 28 | proxy_set_header Host $host; 29 | proxy_set_header X-Real-IP $remote_addr; 30 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 31 | proxy_set_header Upgrade $http_upgrade; 32 | proxy_set_header Connection "upgrade"; 33 | proxy_connect_timeout 60; 34 | proxy_read_timeout 600; 35 | proxy_send_timeout 600; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/AutoPlace/index.js: -------------------------------------------------------------------------------- 1 | // import AutoPlaceModule from "diagram-js/lib/features/auto-place"; 2 | // import CustomAutoPlace from "./CustomAutoPlace"; 3 | // 4 | // // 将元素自动放置到合适位置(默认在后方,正后方存在元素时向右下偏移)并调整连接的方法。通常在点击contentPad创建新元素的时候触发。注入基础模块eventBus与modeling。 5 | // export default { 6 | // __depends__: [AutoPlaceModule], 7 | // __init__: ["customAutoPlace"], 8 | // customAutoPlace: ["type", CustomAutoPlace] 9 | // }; 10 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/ContextPad/EnhancementContextPad/index.js: -------------------------------------------------------------------------------- 1 | import enhancementContextPadProvider from "./enhancementContextPadProvider"; 2 | 3 | const enhancementContextPad = { 4 | __init__: ["enhancementContextPadProvider"], 5 | enhancementContextPadProvider: ["type", enhancementContextPadProvider] 6 | }; 7 | 8 | export default enhancementContextPad; 9 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/ContextPad/RewriteContextPad/index.js: -------------------------------------------------------------------------------- 1 | import rewriteContextPadProvider from "./rewriteContextPadProvider"; 2 | 3 | const rewriteContextPad = { 4 | __init__: ["contextPadProvider"], 5 | contextPadProvider: ["type", rewriteContextPadProvider] 6 | }; 7 | 8 | export default rewriteContextPad; 9 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/ElementFactory/CustomElementFactory.js: -------------------------------------------------------------------------------- 1 | // import ElementFactory from "bpmn-js/lib/features/modeling/ElementFactory"; 2 | // import { getBusinessObject, is } from "bpmn-js/lib/util/ModelUtil"; 3 | // 4 | // class CustomElementFactory extends ElementFactory { 5 | // constructor(config, bpmnFactory, moddle, translate) { 6 | // super(bpmnFactory, moddle, translate); 7 | // this._config = config; 8 | // } 9 | // 10 | // getDefaultSize(element, di) { 11 | // const bo = getBusinessObject(element); 12 | // const types = Object.keys(this._config || {}); 13 | // for (const type of types) { 14 | // if (is(bo, type)) { 15 | // return this._config[type]; 16 | // } 17 | // } 18 | // return super.getDefaultSize(element, di); 19 | // } 20 | // } 21 | // 22 | // CustomElementFactory.$inject = ["config.elementFactory", "bpmnFactory", "moddle", "translate"]; 23 | // 24 | // export default CustomElementFactory; 25 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/ElementFactory/index.js: -------------------------------------------------------------------------------- 1 | // import CustomElementFactory from "./CustomElementFactory"; 2 | // 3 | // export default { 4 | // elementFactory: ["type", CustomElementFactory] 5 | // }; 6 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Lint/customLintRules/taskRequired.js: -------------------------------------------------------------------------------- 1 | const { is, isAny } = require("bpmnlint-utils"); 2 | 3 | module.exports = function () { 4 | function hasStartEvent(node) { 5 | const flowElements = node.flowElements || []; 6 | 7 | return flowElements.some((node) => is(node, "bpmn:Task")); 8 | } 9 | 10 | function check(node, reporter) { 11 | if (!isAny(node, ["bpmn:Process", "bpmn:SubProcess"])) { 12 | return; 13 | } 14 | 15 | if (!hasStartEvent(node)) { 16 | const type = is(node, "bpmn:SubProcess") ? "Sub process" : "Process"; 17 | 18 | reporter.report(node.id, type + " is missing task node"); 19 | } 20 | } 21 | 22 | return { check }; 23 | }; 24 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Palette/EnhancementPalette/index.js: -------------------------------------------------------------------------------- 1 | import enhancementPaletteProvider from "./enhancementPaletteProvider"; 2 | 3 | const EnhancementPalette = { 4 | __init__: ["enhancementPaletteProvider"], 5 | enhancementPaletteProvider: ["type", enhancementPaletteProvider] 6 | }; 7 | 8 | export default EnhancementPalette; 9 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Palette/RewritePalette/index.js: -------------------------------------------------------------------------------- 1 | import rerenderPaletteProvider from "./rewritePaletteProvider"; 2 | 3 | // 使用 paletteProvider 同名参数 覆盖 默认 paletteProvider 构造函数 4 | const RerenderPalette = { 5 | __init__: ["paletteProvider"], 6 | paletteProvider: ["type", rerenderPaletteProvider] 7 | }; 8 | 9 | export default RerenderPalette; 10 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Palette/utils.js: -------------------------------------------------------------------------------- 1 | import { assign } from "min-dash"; 2 | import { notNull } from "@utils/tool"; 3 | 4 | export function createAction(elementFactory, create, type, group, className, title, options) { 5 | function createListener(event) { 6 | const shape = elementFactory.createShape(assign({ type: type }, options)); 7 | 8 | if (options) { 9 | !shape.businessObject.di && (shape.businessObject.di = {}); 10 | notNull(options.isExpanded) && (shape.businessObject.di.isExpanded = options.isExpanded); 11 | } 12 | 13 | create.start(event, shape); 14 | } 15 | 16 | return { 17 | group: group, 18 | className: className, 19 | title: title, 20 | action: { 21 | dragstart: createListener, 22 | click: createListener 23 | } 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/PopupMenu/EnhancementPopupMenu/enhancementPopupMenuProvider.js: -------------------------------------------------------------------------------- 1 | class EnhancementPopupMenuProvider {} 2 | 3 | export default EnhancementPopupMenuProvider; 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/PopupMenu/EnhancementPopupMenu/index.js: -------------------------------------------------------------------------------- 1 | import enhancementPopupMenuProvider from "./enhancementPopupMenuProvider"; 2 | 3 | const enhancementPopupMenu = { 4 | __init__: ["enhancementPopupMenuProvider"], 5 | enhancementPopupMenuProvider: ["type", enhancementPopupMenuProvider] 6 | }; 7 | 8 | export default enhancementPopupMenu; 9 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/PopupMenu/RewritePopupMenu/index.js: -------------------------------------------------------------------------------- 1 | import rewritePopupMenuProvider from "./rewritePopupMenuProvider"; 2 | 3 | const rewritePopupMenu = { 4 | __init__: ["replaceMenuProvider"], 5 | replaceMenuProvider: ["type", rewritePopupMenuProvider] 6 | }; 7 | 8 | export default rewritePopupMenu; 9 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/PopupMenu/RewritePopupMenu/rewritePopupMenuProvider.js: -------------------------------------------------------------------------------- 1 | class RewritePopupMenuProvider {} 2 | 3 | export default RewritePopupMenuProvider; 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Renderer/EnhancementRenderer/index.js: -------------------------------------------------------------------------------- 1 | import EnhancementRenderer from "./EnhancementRenderer"; 2 | 3 | const enhancementRenderer = { 4 | __init__: ["enhancementRenderer"], 5 | enhancementRenderer: ["type", EnhancementRenderer] 6 | }; 7 | 8 | export default enhancementRenderer; 9 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Renderer/RewriteRenderer/index.js: -------------------------------------------------------------------------------- 1 | import RewriteRenderer from "./RewriteRenderer"; 2 | 3 | const rewriteRenderer = { 4 | __init__: ["bpmnRenderer"], 5 | bpmnRenderer: ["type", RewriteRenderer] 6 | }; 7 | 8 | export default rewriteRenderer; 9 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Rules/CustomRules.js: -------------------------------------------------------------------------------- 1 | import RuleProvider from "diagram-js/lib/features/rules/RuleProvider"; 2 | 3 | class CustomRules extends RuleProvider { 4 | constructor(eventBus) { 5 | super(eventBus); 6 | this.init(); 7 | } 8 | 9 | init() { 10 | // 禁止删除开始和结束 11 | // this.addRule(["elements.delete"], 2000, function (context) { 12 | // const [element] = context.elements; 13 | // return element.type !== "bpmn:StartEvent" && element.type !== "bpmn:EndEvent"; 14 | // }); 15 | } 16 | } 17 | 18 | // @ts-ignore 19 | CustomRules.$inject = ["eventBus"]; 20 | 21 | export default CustomRules; 22 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Rules/index.js: -------------------------------------------------------------------------------- 1 | import CustomRules from "./CustomRules"; 2 | 3 | export default { 4 | __init__: ["customRules"], 5 | customRules: ["type", CustomRules] 6 | }; 7 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Translate/index.js: -------------------------------------------------------------------------------- 1 | import zhCN from "./zh-cn"; 2 | 3 | export function customTranslate(template, replacements) { 4 | replacements = replacements || {}; 5 | 6 | // Translate 7 | template = zhCN[template] || template; 8 | 9 | // Replace 10 | return template.replace(/{([^}]+)}/g, function (_, key) { 11 | return replacements[key] || "{" + key + "}"; 12 | }); 13 | } 14 | 15 | export default { 16 | translate: ["value", customTranslate] 17 | }; 18 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Translate/zh-cn/gateway.js: -------------------------------------------------------------------------------- 1 | export default { 2 | Gateway: "网关", 3 | "Exclusive Gateway": "排他网关", 4 | "Parallel Gateway": "并行网关", 5 | "Inclusive Gateway": "包含网关", 6 | "Complex Gateway": "复杂网关", 7 | "Event based Gateway": "事件网关", 8 | ExclusiveGateway: "排他网关", 9 | ParallelGateway: "并行网关", 10 | InclusiveGateway: "包含网关", 11 | ComplexGateway: "复杂网关", 12 | EventBasedGateway: "事件网关" 13 | }; 14 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Translate/zh-cn/index.js: -------------------------------------------------------------------------------- 1 | import tasks from "./tasks"; 2 | import events from "./events"; 3 | import gateway from "./gateway"; 4 | import lint from "./lint"; 5 | import other from "./other"; 6 | 7 | export default { 8 | ...other, 9 | ...events, 10 | ...gateway, 11 | ...lint, 12 | ...tasks 13 | }; 14 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Translate/zh-cn/lint.js: -------------------------------------------------------------------------------- 1 | export default { 2 | Errors: "错误", 3 | Warnings: "警告" 4 | }; 5 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/additional-modules/Translate/zh-cn/tasks.js: -------------------------------------------------------------------------------- 1 | export default { 2 | Task: "任务", 3 | "Send Task": "发送任务", 4 | "Receive Task": "接收任务", 5 | "User Task": "用户任务", 6 | "Manual Task": "手工任务", 7 | "Business Rule Task": "业务规则任务", 8 | "Service Task": "服务任务", 9 | "Script Task": "脚本任务", 10 | "Call Activity": "调用活动", 11 | "Sub Process (collapsed)": "子流程(折叠的)", 12 | "Sub Process (expanded)": "子流程(展开的)", 13 | "Start Event": "开始事件", 14 | "Intermediate Throw Event": "中间事件", 15 | "End Event": "结束事件", 16 | StartEvent: "开始事件", 17 | EndEvent: "结束事件", 18 | SendTask: "发送任务", 19 | ReceiveTask: "接收任务", 20 | UserTask: "用户任务", 21 | ManualTask: "手工任务", 22 | BusinessRuleTask: "业务规则任务", 23 | ServiceTask: "服务任务", 24 | ScriptTask: "脚本任务", 25 | CallActivity: "调用活动", 26 | SubProcess: "子流程" 27 | }; 28 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bo-utils/idUtil.js: -------------------------------------------------------------------------------- 1 | import { catchError } from "@utils/printCatch"; 2 | import { getModeler } from "@packages/bpmn-utils/BpmnDesignerUtils"; 3 | import { isIdValid } from "@packages/bpmn-utils/BpmnValidator"; 4 | 5 | export function getIdValue(element) { 6 | return element.businessObject.id; 7 | } 8 | 9 | export function setIdValue(element, value) { 10 | const errorMsg = isIdValid(element.businessObject, value); 11 | 12 | if (errorMsg && errorMsg.length) { 13 | return catchError(errorMsg); 14 | } 15 | 16 | const modeling = getModeler.getModeling(); 17 | 18 | modeling.updateProperties(element, { 19 | id: value 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bo-utils/processUtil.js: -------------------------------------------------------------------------------- 1 | import { getModeler, getProcessEngine } from "@packages/bpmn-utils/BpmnDesignerUtils"; 2 | 3 | export function getProcessExecutable(element) { 4 | return !!element.businessObject.isExecutable; 5 | } 6 | 7 | export function setProcessExecutable(element, value) { 8 | const modeling = getModeler.getModeling(); 9 | modeling.updateProperties(element, { 10 | isExecutable: value 11 | }); 12 | } 13 | 14 | export function getProcessVersionTag(element) { 15 | const prefix = getProcessEngine(); 16 | 17 | return element.businessObject.get(`${prefix}:versionTag`); 18 | } 19 | 20 | export function setProcessVersionTag(element, value) { 21 | const modeling = getModeler.getModeling(); 22 | const prefix = getProcessEngine(); 23 | 24 | modeling.updateProperties(element, { 25 | [`${prefix}:versionTag`]: value 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-empty-state.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-association.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-business-rule-task.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-collaboration.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-conditional-flow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-connection.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-data-input-output-association.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-data-input.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-data-object.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-data-output.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-default-flow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-end-event-escalation.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-end-event-multiple.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-end-event-none.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-end-event-signal.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-end-event-terminate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-gateway-eventbased.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-gateway-none.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-gateway-or.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-lane.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-participant.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-receive-task.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-send-task.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-start-event-none.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-subprocess-expanded.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-task-none.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-icons/bpmn-icon-text-annotation.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-utils/BpmnEventDefinition.js: -------------------------------------------------------------------------------- 1 | import { getBusinessObject, is } from "bpmn-js/lib/util/ModelUtil"; 2 | import { find } from "min-dash"; 3 | 4 | export function getEventDefinition(element, eventType) { 5 | const businessObject = getBusinessObject(element); 6 | 7 | const eventDefinitions = businessObject.get("eventDefinitions") || []; 8 | 9 | return find(eventDefinitions, function (definition) { 10 | return is(definition, eventType); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/bpmn-utils/BpmnValidator.js: -------------------------------------------------------------------------------- 1 | const SPACE_REGEX = /\s/; 2 | 3 | // for QName validation as per http://www.w3.org/TR/REC-xml/#NT-NameChar 4 | // | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] 5 | const QNAME_REGEX = /^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i; 6 | 7 | // for ID validation as per BPMN Schema (QName - Namespace) 8 | const ID_REGEX = /^[a-z_][\w-.]*$/i; 9 | 10 | export function containsSpace(value) { 11 | return SPACE_REGEX.test(value); 12 | } 13 | 14 | /** 15 | * checks whether the id value is valid 16 | * 17 | * @param {ModdleElement} element 18 | * @param {String} idValue 19 | * 20 | * @return {String} error message 21 | */ 22 | export function isIdValid(element, idValue) { 23 | const assigned = element.$model.ids.assigned(idValue); 24 | const idAlreadyExists = assigned && assigned !== element; 25 | 26 | if (!idValue) { 27 | return "ID 不能为空."; 28 | } 29 | 30 | if (idAlreadyExists) { 31 | return "ID 必须是唯一的"; 32 | } 33 | 34 | return validateId(idValue); 35 | } 36 | export function validateId(idValue) { 37 | if (containsSpace(idValue)) { 38 | return "ID 不能包含空格"; 39 | } 40 | 41 | if (!ID_REGEX.test(idValue)) { 42 | if (QNAME_REGEX.test(idValue)) { 43 | return "ID 不能包含前缀"; 44 | } 45 | 46 | return "ID 必须符合 BPMN 规范"; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/Panel/components/ActivityElementCalled.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 47 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/Panel/components/ElementIterateProperties.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 27 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/Panel/components/ElementPostInstructions.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/Panel/components/ElementPrevInstructions.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/Panel/components/ElementRateLimitProperties.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 27 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/Panel/components/ElementRunProperties.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 27 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/Panel/components/ElementServiceTaskNodeProperties.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 27 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/Toolbar/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 28 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/common/BpmnIcon.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 23 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/common/CollapseTitle.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | 20 | 32 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/common/EditItem.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 38 | 39 | 54 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/common/LucideIcon.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 39 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/common/NumberTag.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 35 | 36 | 48 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/components/common/index.js: -------------------------------------------------------------------------------- 1 | import BpmnIcon from "@packages/components/common/BpmnIcon"; 2 | import CollapseTitle from "@packages/components/common/CollapseTitle"; 3 | import EditItem from "@packages/components/common/EditItem"; 4 | import LucideIcon from "@packages/components/common/LucideIcon"; 5 | import NumberTag from "@packages/components/common/NumberTag"; 6 | 7 | const components = [BpmnIcon, CollapseTitle, EditItem, LucideIcon, NumberTag]; 8 | 9 | export default { 10 | install: (Vue) => { 11 | components.forEach((component) => { 12 | Vue.component(component.name, component); 13 | }); 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/highlight/index.js: -------------------------------------------------------------------------------- 1 | const hljs = require("highlight.js/lib/core"); 2 | hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml")); 3 | hljs.registerLanguage("json", require("highlight.js/lib/languages/json")); 4 | 5 | module.exports = hljs; 6 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/preset-configuration/editor.config.js: -------------------------------------------------------------------------------- 1 | export const defaultSettings = { 2 | processId: `Process_${new Date().getTime()}`, 3 | processName: `业务流程`, 4 | processEngine: "camunda", 5 | paletteMode: "rewrite", 6 | penalMode: "custom", 7 | contextPadMode: "enhancement", 8 | rendererMode: "", 9 | bg: "grid-image", 10 | toolbar: true, 11 | useMinimap: true, 12 | useLint: true, 13 | useMock: false, 14 | contextmenu: false, 15 | customContextmenu: false, 16 | otherModule: true, 17 | templateChooser: true, 18 | customTheme: {} 19 | }; 20 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/store/modules/index.js: -------------------------------------------------------------------------------- 1 | const state = { 2 | localBpmnXml: "" 3 | }; 4 | 5 | const getters = { 6 | getLocalBpmnXml: (state) => state.localBpmnXml 7 | }; 8 | 9 | const mutations = { 10 | changeLocalBpmnXml(state, xml) { 11 | state.localBpmnXml = xml; 12 | } 13 | }; 14 | 15 | export default { 16 | namespaced: true, 17 | state, 18 | getters, 19 | mutations 20 | }; 21 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/theme/camunda-panel.scss: -------------------------------------------------------------------------------- 1 | .camunda-panel { 2 | width: 480px; 3 | } 4 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/theme/context-pad.scss: -------------------------------------------------------------------------------- 1 | .enhancement-op { 2 | background: url('./images/tool.png'); 3 | background-size: 100% 100%; 4 | &:hover { 5 | background-image: url('./images/tool.png') !important; 6 | background-size: 100% 100% !important; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/theme/contextmenu.scss: -------------------------------------------------------------------------------- 1 | .bpmn-context-menu { 2 | display: flex; 3 | width: 400px; 4 | max-height: 360px; 5 | overflow: hidden; 6 | flex-direction: column; 7 | position: fixed; 8 | z-index: 100; 9 | background-color: rgba(255, 255, 255, 1); 10 | border-radius: 2px; 11 | padding: 8px 14px; 12 | box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05); 13 | line-height: 1.6; 14 | .context-menu_header { 15 | line-height: 40px; 16 | font-size: 16px; 17 | font-weight: bold; 18 | border-bottom: 1px solid rgb(239, 239, 245); 19 | } 20 | .context-menu_body { 21 | flex: 1; 22 | display: flex; 23 | flex-direction: column; 24 | overflow-x: hidden; 25 | overflow-y: auto; 26 | } 27 | .context-menu_item { 28 | width: 100%; 29 | height: 32px; 30 | font-size: 14px; 31 | cursor: pointer; 32 | border-radius: 4px; 33 | padding: 0 4px; 34 | display: flex; 35 | align-items: center; 36 | &:hover { 37 | background-color: rgb(241, 242, 244); 38 | } 39 | .context-menu_item_icon { 40 | font-size: 20px; 41 | margin-right: 8px; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/theme/images/04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/kstry-process-designer/packages/theme/images/04.jpg -------------------------------------------------------------------------------- /kstry-process-designer/packages/theme/images/tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/kstry-process-designer/packages/theme/images/tool.png -------------------------------------------------------------------------------- /kstry-process-designer/packages/theme/palette.scss: -------------------------------------------------------------------------------- 1 | .palette { 2 | width: 360px; 3 | box-sizing: border-box; 4 | padding: 16px; 5 | } 6 | .miyue-sql-task{ 7 | background-image: url("./process-icons/mysql.png"); 8 | background-size: 1em 1em; 9 | background-position: center center; 10 | background-repeat: no-repeat; 11 | } 12 | -------------------------------------------------------------------------------- /kstry-process-designer/packages/theme/process-icons/mysql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/kstry-process-designer/packages/theme/process-icons/mysql.png -------------------------------------------------------------------------------- /kstry-process-designer/playground/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 36 | -------------------------------------------------------------------------------- /kstry-process-designer/playground/main.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import App from "./App.vue"; 3 | import store from "../packages/store"; 4 | 5 | import "@packages/bpmn-icons"; 6 | 7 | // 加载基础ElementUI 8 | import ElementUI from "element-ui"; 9 | 10 | Vue.use(ElementUI, { size: "small" }); 11 | import "@packages/theme/element-variables.scss"; 12 | 13 | import { vuePlugin } from "../packages/highlight"; 14 | import "highlight.js/styles/atom-one-dark-reasonable.css"; 15 | 16 | Vue.use(vuePlugin); 17 | 18 | import Common from "@packages/components/common"; 19 | 20 | Vue.use(Common); 21 | 22 | import ResetPopover from "../utils/resetPopover"; 23 | 24 | Vue.directive("r-popover", ResetPopover); 25 | 26 | import "../packages/theme/index.scss"; 27 | 28 | new Vue({ 29 | store, 30 | render: (h) => h(App) 31 | }).$mount("#app"); 32 | -------------------------------------------------------------------------------- /kstry-process-designer/playground/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import VueRouter from "vue-router"; 3 | 4 | Vue.use(VueRouter); 5 | 6 | const routes = []; 7 | 8 | const router = new VueRouter({ 9 | routes 10 | }); 11 | 12 | export default router; 13 | -------------------------------------------------------------------------------- /kstry-process-designer/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/kstry-process-designer/public/favicon.ico -------------------------------------------------------------------------------- /kstry-process-designer/public/icon-process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/kstry-process-designer/public/icon-process.png -------------------------------------------------------------------------------- /kstry-process-designer/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Kstry流程配置台 9 | 10 | 11 | 12 | 13 | 14 | 17 |

18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /kstry-process-designer/public/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/kstry-process-designer/public/logo.ico -------------------------------------------------------------------------------- /kstry-process-designer/types/bpmn-moddle/bpmn-form.d.ts: -------------------------------------------------------------------------------- 1 | declare interface ScriptForm extends BpmnScript { 2 | scriptType?: string 3 | } 4 | 5 | declare interface ExecutionListenerForm extends BpmnExecutionListener { 6 | type: string 7 | script?: ScriptForm 8 | } 9 | 10 | declare interface FormItemVisible { 11 | listenerType: string 12 | scriptType: string 13 | } 14 | 15 | declare interface ConditionalForm { 16 | conditionType?: string 17 | expression?: string 18 | scriptType?: string 19 | language?: string 20 | body?: string 21 | resource?: string 22 | } 23 | -------------------------------------------------------------------------------- /kstry-process-designer/types/bpmn-moddle/bpmn-instance.d.ts: -------------------------------------------------------------------------------- 1 | declare interface BpmnScript { 2 | scriptFormat?: string 3 | resource?: string 4 | value?: string 5 | } 6 | 7 | declare interface BpmnField { 8 | name: string 9 | expression?: string 10 | stringValue?: string 11 | string?: string 12 | htmlVar?: string 13 | } 14 | 15 | declare interface BpmnExtensionElements { 16 | values: any[] 17 | } 18 | 19 | declare interface BpmnExecutionListener { 20 | event: string 21 | expression?: string 22 | class?: string 23 | delegateExpression?: string 24 | script?: BpmnScript 25 | fields?: BpmnField[] 26 | } 27 | 28 | declare interface BpmnExtensionProperty { 29 | id?: string 30 | name?: string 31 | value?: string 32 | } 33 | 34 | declare interface BpmnExtensionProperties { 35 | values: BpmnExtensionProperty[] 36 | } 37 | -------------------------------------------------------------------------------- /kstry-process-designer/types/editor/global.d.ts: -------------------------------------------------------------------------------- 1 | import { Base, Shape, Connection, Label } from 'diagram-js/lib/model' 2 | import { MessageApiInjection } from 'naive-ui/lib/message/playground/MessageProvider' 3 | 4 | declare global { 5 | interface Window { 6 | bpmnInstances: any 7 | __messageBox: MessageApiInjection 8 | } 9 | interface Object { 10 | [key: string | number]: string | number | boolean | undefined | null | Object | Function 11 | } 12 | 13 | type BpmnElement = Base | Shape | Connection | Label 14 | } 15 | 16 | declare interface Window { 17 | bpmnInstances: any 18 | } 19 | -------------------------------------------------------------------------------- /kstry-process-designer/types/editor/settings.d.ts: -------------------------------------------------------------------------------- 1 | import { ViewerOptions } from 'diagram-js/lib/model' 2 | import { ModuleDeclaration } from 'didi' 3 | 4 | export interface EditorSettings { 5 | processName: string 6 | processId: string 7 | processEngine: 'flowable' | 'activiti' | 'camunda' 8 | paletteMode: 'default' | 'custom' | 'rewrite' | 'enhancement' 9 | penalMode: 'default' | 'custom' | 'rewrite' 10 | contextPadMode: 'default' | 'rewrite' | 'enhancement' 11 | rendererMode: 'default' | 'rewrite' | 'enhancement' 12 | bg: string 13 | toolbar: boolean 14 | miniMap: boolean 15 | contextmenu: boolean 16 | customContextmenu: boolean 17 | otherModule: boolean 18 | templateChooser: boolean 19 | useLint: boolean 20 | customTheme: Record 21 | } 22 | 23 | export type ModelerOptions = ViewerOptions & { 24 | additionalModules: ModuleDeclaration[] 25 | moddleExtensions: Object 26 | } 27 | 28 | // bpmn.js 事件参数 29 | // 1. canvas 事件 30 | type CanvasEventParams = { 31 | svg: SVGElement 32 | viewport: SVGElement 33 | } 34 | -------------------------------------------------------------------------------- /kstry-process-designer/types/editor/utils.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@utils/Logger' { 2 | export class Logger { 3 | constructor() 4 | static print(type: string, text: any, back?: boolean): void 5 | static printBack(type: string, text: any): void 6 | static pretty(type: any, title: string, ...text: any[]): void 7 | static prettyPrimary(title: string, ...text: any[]): void 8 | static prettySuccess(title: string, ...text: any[]): void 9 | static prettyWarn(title: string, ...text: any[]): void 10 | static prettyError(title: string, ...text: any[]): void 11 | static prettyInfo(title: string, ...text: any[]): void 12 | } 13 | export default Logger 14 | } 15 | -------------------------------------------------------------------------------- /kstry-process-designer/types/index.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kstry/kstry-core/3a699f3c7c86e32719cab985ff788d1354e36777/kstry-process-designer/types/index.d.ts -------------------------------------------------------------------------------- /kstry-process-designer/types/process-designer.d.ts: -------------------------------------------------------------------------------- 1 | export class ProcessDesigner { 2 | value: string; 3 | translations: { [key: string]: string }; 4 | additionalModel: any; 5 | moddleExtension: any; 6 | onlyCustomizeAddi: boolean; 7 | onlyCustomizeModdle: boolean; 8 | prefix: string; 9 | events: string[]; 10 | headerButtonSize: "default" | "medium" | "small" | "mini"; 11 | } 12 | -------------------------------------------------------------------------------- /kstry-process-designer/utils/files.js: -------------------------------------------------------------------------------- 1 | // 根据所需类型进行转码并返回下载地址 2 | export function setEncoded(type, filename, data) { 3 | const encodedData = encodeURIComponent(data); 4 | return { 5 | filename: `${filename}.${type.toLowerCase()}`, 6 | href: `data:application/${type === "svg" ? "text/xml" : "bpmn20-xml"};charset=UTF-8,${encodedData}`, 7 | data: data 8 | }; 9 | } 10 | 11 | // 文件下载方法 12 | export function downloadFile(href, filename) { 13 | if (href && filename) { 14 | const a = document.createElement("a"); 15 | a.download = filename; //指定下载的文件名 16 | a.href = href; // URL对象 17 | a.click(); // 模拟点击 18 | URL.revokeObjectURL(a.href); // 释放URL 对象 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /kstry-process-designer/utils/printCatch.js: -------------------------------------------------------------------------------- 1 | import Logger from "@utils/Logger"; 2 | 3 | export function catchWarning(warn) { 4 | Logger.prettyWarn("[Process Designer Warning]", warn); 5 | } 6 | 7 | export function catchError(error) { 8 | Logger.prettyError("[Process Designer Error]", typeof error === "string" ? error : error.message); 9 | } 10 | -------------------------------------------------------------------------------- /kstry-process-designer/utils/resetPopover.js: -------------------------------------------------------------------------------- 1 | const getReference = (el, binding, vnode) => { 2 | const { arg, value } = binding; 3 | let elRefs; 4 | if (arg) { 5 | elRefs = vnode.context.$refs[arg]; 6 | if (Array.isArray(elRefs)) { 7 | elRefs[value].$refs.reference = el; 8 | } else { 9 | elRefs.$refs.reference = el; 10 | } 11 | } else { 12 | vnode.context.$refs[value].$refs.reference = arg; 13 | } 14 | }; 15 | 16 | export default { 17 | bind(el, binding, vnode) { 18 | getReference(el, binding, vnode); 19 | }, 20 | inserted(el, binding, vnode) { 21 | getReference(el, binding, vnode); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /kstry-process-designer/utils/tool.js: -------------------------------------------------------------------------------- 1 | /* 空函数 */ 2 | export function noop() {} 3 | 4 | /** 5 | * 校验非空 6 | * @param {*} val 7 | * @return boolean 8 | */ 9 | export function notEmpty(val) { 10 | if (!notNull(val)) { 11 | return false; 12 | } 13 | if (getRawType(val) === "array") { 14 | return val.length; 15 | } 16 | if (getRawType(val) === "object") { 17 | return !!Object.keys(val).length; 18 | } 19 | return true; 20 | } 21 | 22 | export function notNull(val) { 23 | return val !== undefined && val !== null; 24 | } 25 | 26 | /** 27 | * 返回数据原始类型 28 | * @param value 29 | * @return { string } type 30 | */ 31 | export function getRawType(value) { 32 | return Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); 33 | } 34 | 35 | // 取消响应式 36 | export function unObserver(val) { 37 | if (getRawType(val) === "object" || getRawType(val) === "array") { 38 | val.__v_skip = true; 39 | return val; 40 | } 41 | return val; 42 | } 43 | -------------------------------------------------------------------------------- /kstry-process-designer/utils/uuid.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 随机生成一个指定长度的 id, 默认长度为 8 3 | * @param length {number} 4 | * @param [chars] {string} 5 | * @returns {string} 6 | */ 7 | export default function uuid(length = 8, chars) { 8 | let result = ""; 9 | const charsString = chars || "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 10 | for (let i = length; i > 0; --i) { 11 | result += charsString[Math.floor(Math.random() * charsString.length)]; 12 | } 13 | return result; 14 | } 15 | --------------------------------------------------------------------------------