18 changed files with 335 additions and 60 deletions
@ -0,0 +1,71 @@ |
|||||
|
package irbs.cust.rating.initializer; |
||||
|
|
||||
|
import io.sc.platform.core.Environment; |
||||
|
import io.sc.platform.core.initializer.ApplicationInitializer; |
||||
|
import io.sc.platform.core.initializer.ApplicationInitializerExecuteException; |
||||
|
import io.sc.platform.core.util.FileUtil; |
||||
|
import io.sc.platform.flowable.enums.ProcessStatus; |
||||
|
import io.sc.platform.flowable.jpa.entity.ProcessEntity; |
||||
|
import io.sc.platform.flowable.service.ProcessEntityService; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.context.ApplicationContext; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.List; |
||||
|
import java.util.Locale; |
||||
|
|
||||
|
public class CustRatingWorkFlowInitializer implements ApplicationInitializer{ |
||||
|
private static final Logger log =LoggerFactory.getLogger(CustRatingWorkFlowInitializer.class); |
||||
|
private Boolean isInitialized =null; |
||||
|
private ApplicationContext applicationContext; |
||||
|
private ProcessEntityService processEntityService; |
||||
|
|
||||
|
@Override |
||||
|
public void init(ApplicationContext applicationContext) { |
||||
|
this.processEntityService =applicationContext.getBean(ProcessEntityService.class); |
||||
|
this.applicationContext =applicationContext; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int getOrder() { |
||||
|
return 1100; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public synchronized boolean isInitialized() { |
||||
|
if(isInitialized!=null) { |
||||
|
return isInitialized; |
||||
|
} |
||||
|
List<ProcessEntity> entities =processEntityService.getRepository().findByKey("COMPANY_CUSTOMER_RATING"); |
||||
|
if(entities==null || entities.isEmpty()){ |
||||
|
isInitialized =false; |
||||
|
}else { |
||||
|
isInitialized = true; |
||||
|
} |
||||
|
return isInitialized; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void execute() throws ApplicationInitializerExecuteException { |
||||
|
try { |
||||
|
ProcessEntity entity = new ProcessEntity(); |
||||
|
entity.setCategory("COMPANY_CUSTOMER_RATING"); |
||||
|
entity.setKey("COMPANY_CUSTOMER_RATING"); |
||||
|
entity.setName(applicationContext.getMessage("WORK_FLOW.COMPANY_CUSTOMER_RATING", null, Locale.getDefault())); |
||||
|
entity.setStatus(ProcessStatus.RELEASE); |
||||
|
entity.setVersion(1); |
||||
|
entity.setCanClaimTask(false); |
||||
|
entity.setXml(getRuleEngineWorkflowXmlContent()); |
||||
|
entity = processEntityService.add(entity); |
||||
|
processEntityService.deploy(entity.getId()); |
||||
|
}catch (Exception e){ |
||||
|
log.error("",e); |
||||
|
throw new ApplicationInitializerExecuteException(e); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private String getRuleEngineWorkflowXmlContent() throws IOException { |
||||
|
return FileUtil.readString("classpath:/workflow/irbs/cust/rating/CustRating.bpmn", Environment.DEFAULT_CHARSET_NAME); |
||||
|
} |
||||
|
} |
@ -0,0 +1 @@ |
|||||
|
irbs.cust.rating.initializer.CustRatingWorkFlowInitializer |
@ -0,0 +1,172 @@ |
|||||
|
<?xml version='1.0' encoding='UTF-8'?> |
||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test" exporter="Flowable Open Source Modeler" exporterVersion="6.8.0"> |
||||
|
<process id="COMPANY_CUSTOMER_RATING" name="公司客户评级流程分类" isExecutable="true"> |
||||
|
<dataObject id="assignment-strategy" name="任务分配策略" itemSubjectRef="xsd:string"> |
||||
|
<extensionElements> |
||||
|
<flowable:value>{"A2":"frAssigneeQueryService"}</flowable:value> |
||||
|
</extensionElements> |
||||
|
</dataObject> |
||||
|
<startEvent id="startevent1" name="Start" flowable:formFieldValidation="true"/> |
||||
|
<userTask id="A1" name="客户经理提交申请" flowable:assignee="${assignee}" flowable:formFieldValidation="true" flowable:skipExpression="${execution.getVariable('skipFirst')==true}"> |
||||
|
<documentation>${desc}</documentation> |
||||
|
<extensionElements> |
||||
|
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete> |
||||
|
</extensionElements> |
||||
|
</userTask> |
||||
|
<userTask id="A2" name="一级支行评级审查岗" flowable:assignee="${assignee}" flowable:candidateGroups="y_cust_rating_examine" flowable:formFieldValidation="true"> |
||||
|
<documentation>${desc}</documentation> |
||||
|
<extensionElements> |
||||
|
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete> |
||||
|
</extensionElements> |
||||
|
</userTask> |
||||
|
<userTask id="A3" name="一级支行评级审批岗" flowable:assignee="${assignee}" flowable:candidateGroups="y_cust_rating_approve" flowable:formFieldValidation="true"> |
||||
|
<documentation>${desc}</documentation> |
||||
|
<extensionElements> |
||||
|
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete> |
||||
|
</extensionElements> |
||||
|
</userTask> |
||||
|
<userTask id="A4" name="总行审查岗" flowable:assignee="${assignee}" flowable:candidateGroups="z_company_rating_examine" flowable:formFieldValidation="true"> |
||||
|
<documentation>${desc}</documentation> |
||||
|
<extensionElements> |
||||
|
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete> |
||||
|
</extensionElements> |
||||
|
</userTask> |
||||
|
<userTask id="A5" name="总行审批岗" flowable:assignee="${assignee}" flowable:candidateGroups="z_company_rating_approve" flowable:formFieldValidation="true"> |
||||
|
<documentation>${desc}</documentation> |
||||
|
<extensionElements> |
||||
|
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete> |
||||
|
</extensionElements> |
||||
|
</userTask> |
||||
|
<endEvent id="endevent1" name="End"/> |
||||
|
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="A1"/> |
||||
|
<endEvent id="endevent2" name="结束"/> |
||||
|
<sequenceFlow id="flow2" name="提交" sourceRef="A1" targetRef="A2"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==6}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="flow12" name="退回发起人" sourceRef="A3" targetRef="A1"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==-1}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="flow8" name="退回发起人" sourceRef="A2" targetRef="A1"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==-1}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="flow9" name="退回发起人" sourceRef="A4" targetRef="A1"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==-1}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="flow10" name="否决" sourceRef="A3" targetRef="endevent1"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==2}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="flow4" name="通过" sourceRef="A3" targetRef="endevent1"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==1}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="flow3" name="提交" sourceRef="A2" targetRef="A3"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==6}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="flow6" name="提交" sourceRef="A4" targetRef="A5"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==6}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="sid-C0A72034-8C59-4DCB-B2E0-1AC84315A8BA" name="否决" sourceRef="A5" targetRef="endevent2"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==2}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="sid-48C11432-6FBB-4657-A7B0-5AA0F9C3D900" name="通过" sourceRef="A5" targetRef="endevent2"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==1}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="flow13" name="退回发起人" sourceRef="A5" targetRef="A1"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${goback==-1}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
<sequenceFlow id="flow5" name="提交" sourceRef="A3" targetRef="A4"> |
||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${submit==1}]]></conditionExpression> |
||||
|
</sequenceFlow> |
||||
|
</process> |
||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_COMPANY_CUSTOMER_RATING"> |
||||
|
<bpmndi:BPMNPlane bpmnElement="COMPANY_CUSTOMER_RATING" id="BPMNPlane_COMPANY_CUSTOMER_RATING"> |
||||
|
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> |
||||
|
<omgdc:Bounds height="30.0" width="30.0" x="32.02187570282153" y="169.09844066269687"/> |
||||
|
</bpmndi:BPMNShape> |
||||
|
<bpmndi:BPMNShape bpmnElement="A1" id="BPMNShape_A1"> |
||||
|
<omgdc:Bounds height="80.0" width="105.0" x="105.0" y="144.09844066269687"/> |
||||
|
</bpmndi:BPMNShape> |
||||
|
<bpmndi:BPMNShape bpmnElement="A2" id="BPMNShape_A2"> |
||||
|
<omgdc:Bounds height="80.0" width="105.0" x="300.0" y="144.09844066269687"/> |
||||
|
</bpmndi:BPMNShape> |
||||
|
<bpmndi:BPMNShape bpmnElement="A3" id="BPMNShape_A3"> |
||||
|
<omgdc:Bounds height="80.0" width="105.0" x="500.0" y="144.09844066269687"/> |
||||
|
</bpmndi:BPMNShape> |
||||
|
<bpmndi:BPMNShape bpmnElement="A4" id="BPMNShape_A4"> |
||||
|
<omgdc:Bounds height="80.0" width="105.0" x="500.0" y="315.0"/> |
||||
|
</bpmndi:BPMNShape> |
||||
|
<bpmndi:BPMNShape bpmnElement="A5" id="BPMNShape_A5"> |
||||
|
<omgdc:Bounds height="80.0" width="105.0" x="720.0" y="315.0"/> |
||||
|
</bpmndi:BPMNShape> |
||||
|
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> |
||||
|
<omgdc:Bounds height="28.0" width="28.0" x="695.0" y="170.09844066269687"/> |
||||
|
</bpmndi:BPMNShape> |
||||
|
<bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2"> |
||||
|
<omgdc:Bounds height="28.0" width="28.0" x="915.0" y="341.0"/> |
||||
|
</bpmndi:BPMNShape> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="52.5" flowable:targetDockerY="40.0"> |
||||
|
<omgdi:waypoint x="772.5" y="394.95000000000005"/> |
||||
|
<omgdi:waypoint x="772.5" y="485.0"/> |
||||
|
<omgdi:waypoint x="157.5" y="485.0"/> |
||||
|
<omgdi:waypoint x="157.5" y="224.0484406626969"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="sid-48C11432-6FBB-4657-A7B0-5AA0F9C3D900" id="BPMNEdge_sid-48C11432-6FBB-4657-A7B0-5AA0F9C3D900" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="14.0" flowable:targetDockerY="14.0"> |
||||
|
<omgdi:waypoint x="824.9499999999999" y="355.0"/> |
||||
|
<omgdi:waypoint x="864.5" y="355.0"/> |
||||
|
<omgdi:waypoint x="851.5" y="355.0"/> |
||||
|
<omgdi:waypoint x="915.0" y="355.0"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1" flowable:sourceDockerX="15.0" flowable:sourceDockerY="15.0" flowable:targetDockerX="52.5" flowable:targetDockerY="40.0"> |
||||
|
<omgdi:waypoint x="61.97187420581508" y="184.09844066269687"/> |
||||
|
<omgdi:waypoint x="105.0" y="184.09844066269687"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="52.5" flowable:targetDockerY="40.0"> |
||||
|
<omgdi:waypoint x="209.9499999999619" y="184.09844066269687"/> |
||||
|
<omgdi:waypoint x="300.0" y="184.09844066269687"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="52.5" flowable:targetDockerY="40.0"> |
||||
|
<omgdi:waypoint x="404.95000000000005" y="184.09844066269687"/> |
||||
|
<omgdi:waypoint x="500.0" y="184.09844066269687"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="14.0" flowable:targetDockerY="14.0"> |
||||
|
<omgdi:waypoint x="604.94999999995" y="184.09844066269687"/> |
||||
|
<omgdi:waypoint x="695.0" y="184.09844066269687"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="52.5" flowable:targetDockerY="14.0"> |
||||
|
<omgdi:waypoint x="552.5" y="224.0484406626969"/> |
||||
|
<omgdi:waypoint x="552.5" y="315.0"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="52.5" flowable:targetDockerY="40.0"> |
||||
|
<omgdi:waypoint x="604.95" y="355.0"/> |
||||
|
<omgdi:waypoint x="720.0" y="355.0"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="sid-C0A72034-8C59-4DCB-B2E0-1AC84315A8BA" id="BPMNEdge_sid-C0A72034-8C59-4DCB-B2E0-1AC84315A8BA" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="14.0" flowable:targetDockerY="14.0"> |
||||
|
<omgdi:waypoint x="772.5" y="315.0"/> |
||||
|
<omgdi:waypoint x="772.5" y="275.0"/> |
||||
|
<omgdi:waypoint x="929.0" y="275.0"/> |
||||
|
<omgdi:waypoint x="929.0" y="341.0"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="14.0" flowable:targetDockerY="14.0"> |
||||
|
<omgdi:waypoint x="603.5071973955154" y="144.09844066269687"/> |
||||
|
<omgdi:waypoint x="642.0" y="114.0"/> |
||||
|
<omgdi:waypoint x="699.326689310983" y="173.97684030512815"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="52.5" flowable:targetDockerY="40.0"> |
||||
|
<omgdi:waypoint x="352.30934506477934" y="224.0484406626969"/> |
||||
|
<omgdi:waypoint x="352.0" y="289.0"/> |
||||
|
<omgdi:waypoint x="158.0" y="289.0"/> |
||||
|
<omgdi:waypoint x="157.69041661655163" y="224.0484406626969"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="52.5" flowable:targetDockerY="40.0"> |
||||
|
<omgdi:waypoint x="552.3320716888591" y="144.09844066269687"/> |
||||
|
<omgdi:waypoint x="552.0" y="65.0"/> |
||||
|
<omgdi:waypoint x="157.0" y="65.0"/> |
||||
|
<omgdi:waypoint x="157.33207168885912" y="144.09844066269687"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9" flowable:sourceDockerX="52.5" flowable:sourceDockerY="40.0" flowable:targetDockerX="52.5" flowable:targetDockerY="40.0"> |
||||
|
<omgdi:waypoint x="499.99999999986835" y="355.0"/> |
||||
|
<omgdi:waypoint x="157.0" y="355.0"/> |
||||
|
<omgdi:waypoint x="157.38297356631765" y="224.0484406626969"/> |
||||
|
</bpmndi:BPMNEdge> |
||||
|
</bpmndi:BPMNPlane> |
||||
|
</bpmndi:BPMNDiagram> |
||||
|
</definitions> |
Loading…
Reference in new issue