비즈니스 규칙에서 워크플로우 스크래치패드에 접근
카탈로그 항목이 요청되었으며 첨부된 워크플로우에 스크래치패드의 값을 채우는 스크립트 실행 활동이 포함되어 있습니다. 요청된 항목에서 실행되는 비즈니스 규칙에서 스크래치패드 값을 검색하거나 설정하려고 합니다.
필수 구성요소
필요한 역할: admin.
이름: 비즈니스 규칙에서 워크플로우 스크래치패드에 액세스합니다.
유형: 비즈니스 규칙
테이블: sc_req_item(요청된 항목).
설명: 카탈로그 항목이 요청되었으며, 첨부된 워크플로우에는 스크래치패드의 값을 채우는 스크립트 실행 활동이 포함되어 있습니다. 요청된 항목에서 실행되는 비즈니스 규칙에서 스크래치패드 값을 검색하거나 설정하려고 합니다.
매개변수: n/a.
스크립트:
//the run script activity sets a value in the scratchpad
workflow.scratchpad.important_msg = "scratch me";
//get the workflow script include helper
var workflow = new Workflow();
//get the requested items workflow context
//this will get all contexts so you will need to get the proper one if you have multiple workflows for a record
var context = workflow.getContexts(current);
//make sure we have a valid context
if (context.next()) {
//get a value from the scratchpad
var msg = context.scratchpad.important_msg;
//msg now equals "scratch me", that was set in the run script activity
//add or modify a scratchpad value
context.scratchpad.status = "completed";
//we need to save the context record to save the scratchpad
context.update();
}