package dingtalk import ( "dashoo.cn/opms_libary/plugin/dingtalk/workflow" "fmt" "github.com/alibabacloud-go/tea/tea" "testing" ) func TestQuerySchemaByProcessCode(t *testing.T) { client := NewClient() w := client.GetWorkflow() s, _ := w.QuerySchemaByProcessCode("PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19") fmt.Println(s) } func TestStartProcessInstance(t *testing.T) { client := NewClient() w := client.GetWorkflow() //formComponentValues0Details0Details0 := &workflow.StartProcessInstanceRequestFormComponentValuesDetailsDetails{ // Id: tea.String("PhoneField_IZI2LP8QF6O0"), // BizAlias: tea.String("Phone"), // Name: tea.String("PhoneField"), // Value: tea.String("123xxxxxxxx"), // ExtValue: tea.String("总个数:1"), // ComponentType: tea.String("PhoneField"), //} //formComponentValues0Details0 := &workflow.StartProcessInstanceRequestFormComponentValuesDetails{ // Id: tea.String("PhoneField_IZI2LP8QF6O0"), // BizAlias: tea.String("Phone"), // Name: tea.String("PhoneField"), // Value: tea.String("123xxxxxxxx"), // ExtValue: tea.String("总个数:1"), // Details: []*workflow.StartProcessInstanceRequestFormComponentValuesDetailsDetails{formComponentValues0Details0Details0}, //} //表单信息 TextField_1RC8GZWYGO4G0 := &workflow.StartProcessInstanceRequestFormComponentValues{ Id: tea.String("TextField_1RC8GZWYGO4G0"), Name: tea.String("单行输入框"), Value: tea.String("123xxxxxxxx"), } DDAttachment_17PC5KQBVEM80 := &workflow.StartProcessInstanceRequestFormComponentValues{ Id: tea.String("DDAttachment_17PC5KQBVEM80"), Name: tea.String("附件"), Value: tea.String("123xxxxxxxx"), } startProcessInstanceRequest := &workflow.StartProcessInstanceRequest{ OriginatorUserId: tea.String("47073111989114"), ProcessCode: tea.String("PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19"), DeptId: tea.Int64(435711466), FormComponentValues: []*workflow.StartProcessInstanceRequestFormComponentValues{TextField_1RC8GZWYGO4G0, DDAttachment_17PC5KQBVEM80}, } //w.StartProcessInstance("47073111989114", "PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19", 435711466) resp, _ := w.StartProcessInstance(startProcessInstanceRequest) fmt.Println(resp) }