CRM, C4C和Hybris的工做流簡介

CRM的例子

Step by Step to debug IC inbox workflow WS14000164java

C4C

Hybris

Hybris workflow的框架實現代碼在這個folder裏:app

而應用層面使用的workflow,和ABAP workflow同樣有所謂workflow template的概念。下圖是ABAP workflow template的一個例子:框架

Hybris workflow:this

也是經過impex定義的:spa

impex 中包括 WorkflowTemplate, WorkflowActionTemplate, WorkflowDecisionTemplate, WorkflowActionTemplateLinkTemplateRelation 這四種類型的modeldebug

1. 一個workflow至少有3三 種類型(start/normal/end)的 actioncode

2. 一個action最少有一種decisionorm

3. 一個decision 能夠經過 WorkflowActionTemplateLinkTemplateRelation 連接到下一個action上 直到結束節點 end.blog

建立workflow及觸發decision:ip

public void autoCreateWorkFlow(PrincipalModel principal, KeyInfoModel info) {
   validateParameterNotNull(principal, "principal model cannot be null");

   UserModel admin = userService.getUserForUID(ADMIN_CODE);

   WorkflowTemplateModel workflowTemplate = workflowTemplateService.getWorkflowTemplateForCode(workflowTemplateCode);

   //create a new workflow for given workflowtemplate

   final WorkflowModel workflow = workflowService.createWorkflow(workflowTemplate, admin);

   //add attachment for workflow

  final WorkflowItemAttachmentModel attachment = modelService.create(WorkflowItemAttachmentModel.class);

  AbstractOrderEntryModel orderEntry = info.getOrderEntry();

  attachment.setItem(info.getOrderEntry());

  attachment.setWorkflow(workflow);

  attachment.setCode(orderEntry.getPk()+"_OrderEntry");

  this.modelService.save(attachment);

  this.modelService.refresh(attachment);

  workflow.setAttachments(Collections.singletonList(attachment));

  workflowProcessingService.startWorkflow(workflow);

  this.autoDoStartDecision(workflow, admin);

}
相關文章
相關標籤/搜索