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

修改bug

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