提交 42bc5585 编写于 作者: sq3536's avatar sq3536

修改bug

上级 9da88fea
...@@ -144,6 +144,7 @@ public class ModelStorage { ...@@ -144,6 +144,7 @@ public class ModelStorage {
} }
else if (type.equals(TemplateFileType.workflow)) { else if (type.equals(TemplateFileType.workflow)) {
getSystemModel().getWorkflows().forEach(item -> { getSystemModel().getWorkflows().forEach(item -> {
CliOption opt = newCliOption(TemplateFileType.workflow) CliOption opt = newCliOption(TemplateFileType.workflow)
.baseData(item, item.getCodeName().toString()); .baseData(item, item.getCodeName().toString());
rt.addOption(opt); rt.addOption(opt);
......
...@@ -128,7 +128,7 @@ public class SystemModel extends BaseModel { ...@@ -128,7 +128,7 @@ public class SystemModel extends BaseModel {
workflowsMap = new LinkedHashMap<>(); workflowsMap = new LinkedHashMap<>();
getSystem().getAllPSWorkflows().forEach(workflow -> { getSystem().getAllPSWorkflows().forEach(workflow -> {
workflow.getPSWFVersions().forEach(workflowVersion -> { workflow.getPSWFVersions().forEach(workflowVersion -> {
workflowsMap.put(workflowVersion.getCodeName(), new WorkflowModel(this, workflowVersion)); workflowsMap.put(workflowVersion.getCodeName(), new WorkflowModel(this, workflow,workflowVersion));
}); });
}); });
} catch (Exception e) { } catch (Exception e) {
......
...@@ -22,10 +22,11 @@ import java.util.*; ...@@ -22,10 +22,11 @@ import java.util.*;
@Accessors(chain = true) @Accessors(chain = true)
public class WorkflowModel extends BaseModel{ public class WorkflowModel extends BaseModel{
public WorkflowModel(SystemModel systemModel, IPSWFVersion ver) public WorkflowModel(SystemModel systemModel, IPSWorkflow psWorkflow,IPSWFVersion ver)
{ {
this.opt=ver; this.opt=ver;
this.system=systemModel; this.system=systemModel;
this.psWorkflow=psWorkflow;
this.setCodeName(ver.getCodeName()); this.setCodeName(ver.getCodeName());
this.setName(ver.getName()); this.setName(ver.getName());
this.setId(String.format("%1$s-%2$s",system.getCodeName().toLowerCase(),ver.getCodeName().toLowerCase())); this.setId(String.format("%1$s-%2$s",system.getCodeName().toLowerCase(),ver.getCodeName().toLowerCase()));
...@@ -37,6 +38,9 @@ public class WorkflowModel extends BaseModel{ ...@@ -37,6 +38,9 @@ public class WorkflowModel extends BaseModel{
return (IPSWFVersion)opt; return (IPSWFVersion)opt;
} }
private IPSWorkflow psWorkflow;
private SystemModel system; private SystemModel system;
private Map<String,IPSWFProcessRole> refGroups; private Map<String,IPSWFProcessRole> refGroups;
...@@ -78,13 +82,15 @@ public class WorkflowModel extends BaseModel{ ...@@ -78,13 +82,15 @@ public class WorkflowModel extends BaseModel{
private Map<String,EntityModel> bookings; private Map<String,EntityModel> bookings;
public Map<String,EntityModel> getBookings() public Map<String,EntityModel> getBookings()
{ {
if(getWFVer().getPSWorkflow()!=null&&getWFVer().getPSWorkflow().getPSWFDEs()!=null) if(getPsWorkflow()!=null&&getPsWorkflow().getPSWFDEs()!=null)
{ {
if(bookings==null) if(bookings==null)
{ {
bookings=new LinkedHashMap<>(); bookings=new LinkedHashMap<>();
getWFVer().getPSWorkflow().getPSWFDEs().forEach(de->{ getPsWorkflow().getPSWFDEs().forEach(de->{
bookings.put(de.getCodeName(),getSystem().getEntity(de.getCodeName())); if(de.getPSDataEntity()==null)
return;
bookings.put(de.getPSDataEntity().getCodeName(),getSystem().getEntity(de.getPSDataEntity().getCodeName()));
}); });
} }
} }
...@@ -177,17 +183,19 @@ public class WorkflowModel extends BaseModel{ ...@@ -177,17 +183,19 @@ public class WorkflowModel extends BaseModel{
map.put("process",WFProcess); map.put("process",WFProcess);
List<IPSWFProcessRole> roles=null; List<IPSWFProcessRole> roles=null;
List<String> formParam=new ArrayList<>(); List<String> formParam=new ArrayList<>();
boolean multiInstanceLoopCharacteristics=false;
if(WFProcess instanceof IPSWFInteractiveProcess) if(WFProcess instanceof IPSWFInteractiveProcess)
{ {
IPSWFInteractiveProcess interactiveProcess=(IPSWFInteractiveProcess)WFProcess; IPSWFInteractiveProcess interactiveProcess=(IPSWFInteractiveProcess)WFProcess;
if("SEQUENTIAL".equalsIgnoreCase(interactiveProcess.getMultiInstMode())) { if("SEQUENTIAL".equalsIgnoreCase(interactiveProcess.getMultiInstMode())) {
map.put("sequential", true); map.put("sequential", true);
map.put("multiInstanceLoopCharacteristics",true); multiInstanceLoopCharacteristics=true;
} }
else if("PARALLEL".equalsIgnoreCase(interactiveProcess.getMultiInstMode())) { else if("PARALLEL".equalsIgnoreCase(interactiveProcess.getMultiInstMode())) {
map.put("sequential", false); map.put("sequential", false);
map.put("multiInstanceLoopCharacteristics",true); multiInstanceLoopCharacteristics=true;
} }
map.put("multiInstanceLoopCharacteristics",multiInstanceLoopCharacteristics);
roles=interactiveProcess.getPSWFProcessRoles(); roles=interactiveProcess.getPSWFProcessRoles();
map.put("hasForm",(!StringUtils.isEmpty(interactiveProcess.getFormCodeName()))||(!StringUtils.isEmpty(interactiveProcess.getMobFormCodeName()))); map.put("hasForm",(!StringUtils.isEmpty(interactiveProcess.getFormCodeName()))||(!StringUtils.isEmpty(interactiveProcess.getMobFormCodeName())));
...@@ -291,7 +299,7 @@ public class WorkflowModel extends BaseModel{ ...@@ -291,7 +299,7 @@ public class WorkflowModel extends BaseModel{
if(!ObjectUtils.isEmpty(assignUtCond)) if(!ObjectUtils.isEmpty(assignUtCond))
map.put("assignUtCond", String.join("|", assignUtCond)); map.put("assignUtCond", String.join("|", assignUtCond));
} }
if(formParam.size()>0&&map.containsKey("assignUtCond")) { if(multiInstanceLoopCharacteristics&&formParam.size()>0&&map.containsKey("assignUtCond")) {
formParam.add("candidateUsersList=\""+map.get("assignUtCond")+"\" "); formParam.add("candidateUsersList=\""+map.get("assignUtCond")+"\" ");
} }
} }
...@@ -386,11 +394,11 @@ public class WorkflowModel extends BaseModel{ ...@@ -386,11 +394,11 @@ public class WorkflowModel extends BaseModel{
String linkDeployId= DigestUtils.md5DigestAsHex((sourceProcessId+sourceProcessId).getBytes()); String linkDeployId= DigestUtils.md5DigestAsHex((sourceProcessId+sourceProcessId).getBytes());
String flowId="rid-"+linkDeployId; String flowId="rid-"+linkDeployId;
if(!"ROUTE".equals(WFLink.getWFLinkType())) if(!"ROUTE".equals(WFLink.getWFLinkType()))
flowId="lid-"+(StringUtils.isEmpty(WFLink.getLogicName())?WFLink.getName():WFLink.getLogicName())+"-"+linkDeployId; flowId="lid-"+WFLink.getName()+"-"+linkDeployId;
map.put(sourceProcessId,sourceProcessId); map.put("sourceProcessId",sourceProcessId);
map.put(targetProcessId,targetProcessId); map.put("targetProcessId",targetProcessId);
map.put(flowId,flowId); map.put("flowId",flowId);
List<String> linkParam=new ArrayList<>(); List<String> linkParam=new ArrayList<>();
if(WFLink instanceof PSWFInteractiveLinkImpl) if(WFLink instanceof PSWFInteractiveLinkImpl)
{ {
...@@ -410,7 +418,7 @@ public class WorkflowModel extends BaseModel{ ...@@ -410,7 +418,7 @@ public class WorkflowModel extends BaseModel{
} }
if(linkParam.size()>0) if(linkParam.size()>0)
map.put("linkParam",linkParam); map.put("linkParam",linkParam);
if("TIMEOUT".equalsIgnoreCase(WFLink.getWFLinkType())) if(!"TIMEOUT".equalsIgnoreCase(WFLink.getWFLinkType()))
{ {
if(!"Start001".equalsIgnoreCase(sourceProcess.getCodeName())) if(!"Start001".equalsIgnoreCase(sourceProcess.getCodeName()))
{ {
......
...@@ -44,12 +44,10 @@ ...@@ -44,12 +44,10 @@
<flowable:string>{{lowerCase wfde.uDStatePSDEField.codeName}}</flowable:string> <flowable:string>{{lowerCase wfde.uDStatePSDEField.codeName}}</flowable:string>
</flowable:field> </flowable:field>
{{/if}} {{/if}}
{{#if workflow.psWorkflow.entityWFStates}} {{#if workflow.psWorkflow.entityWFState}}
{{#neq workflow.psWorkflow.entityWFStates ""}}
<flowable:field name="udstateingval_{{pluralize wfde.psDataEntity.codeName}}"> <flowable:field name="udstateingval_{{pluralize wfde.psDataEntity.codeName}}">
<flowable:string>{{workflow.psWorkflow.entityWFStates}}</flowable:string> <flowable:string>{{workflow.psWorkflow.entityWFState}}</flowable:string>
</flowable:field> </flowable:field>
{{/neq}}
{{/if}} {{/if}}
{{#if workflow.psWorkflow.entityWFFinishState}} {{#if workflow.psWorkflow.entityWFFinishState}}
{{#neq workflow.psWorkflow.entityWFFinishState ""}} {{#neq workflow.psWorkflow.entityWFFinishState ""}}
...@@ -80,13 +78,15 @@ ...@@ -80,13 +78,15 @@
<flowable:string>{{lowerCase wfde.psDataEntity.majorPSDEField.codeName}}</flowable:string> <flowable:string>{{lowerCase wfde.psDataEntity.majorPSDEField.codeName}}</flowable:string>
</flowable:field> </flowable:field>
{{/if}} {{/if}}
{{#if wfde.psDataEntity.orgField}} {{/each}}
<flowable:field name="orgfield_{{pluralize wfde.psDataEntity.codeName}}"> {{#each workflow.bookings as |booking|}}
<flowable:string>{{lowerCase wfde.psDataEntity.orgField.codeName}}</flowable:string> {{#if booking.orgField}}
<flowable:field name="orgfield_{{pluralize booking.codeName}}">
<flowable:string>{{lowerCase booking.orgField.codeName}}</flowable:string>
</flowable:field> </flowable:field>
{{/if}} {{/if}}
<flowable:field name="isvalid"><flowable:string>{{#if workflow.valid}}1{{else}}0{{/if}}</flowable:string></flowable:field>
{{/each}} {{/each}}
<flowable:field name="isvalid"><flowable:string>{{#if workflow.valid}}1{{else}}0{{/if}}</flowable:string></flowable:field>
</extensionElements> </extensionElements>
{{#if workflow.psWFProcesses}} {{#if workflow.psWFProcesses}}
{{#each workflow.psWFProcesses as |WFProcess|}} {{#each workflow.psWFProcesses as |WFProcess|}}
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
{{#each workflow.sequenceFlows as |sequenceFlow|}} {{#each workflow.sequenceFlows as |sequenceFlow|}}
<sequenceFlow id="{{sequenceFlow.flowId}}" sourceRef="{{sequenceFlow.sourceProcessId}}" targetRef="{{sequenceFlow.targetProcessId}}" name="{{sequenceFlow.link.logicName}}"> <sequenceFlow id="{{sequenceFlow.flowId}}" sourceRef="{{sequenceFlow.sourceProcessId}}" targetRef="{{sequenceFlow.targetProcessId}}" name="{{sequenceFlow.link.logicName}}">
{{#if sequenceFlow.linkCond}} {{#if sequenceFlow.linkCond}}
<conditionExpression xsi:type="tFormalExpression" >{{sequenceFlow.linkCond}}</conditionExpression> <conditionExpression xsi:type="tFormalExpression" >{{sequenceFlow.linkCond}}</conditionExpression>
{{/if}} {{/if}}
{{#if sequenceFlow.linkParam}} {{#if sequenceFlow.linkParam}}
<extensionElements> <extensionElements>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册