TheOpenCloudEngine / uEngine5-base

uEngine5 BPMS that totally re-written in Microservices architecture. uEngine5 can act as not only a conventional Workflow or BPMS but also as a REST api orchestrator or a BPaaS (Business process as a service) of members of OCE's MSA components.
MIT License
10 stars 13 forks source link

WorkItemService and work-item-handler tag component #10

Open jinyoung opened 7 years ago

jinyoung commented 7 years ago

WorkItemService that

GET will returns:

{
    "worklist": {
        "taskId": 2,
        "instId": 1,
        "processInstance": null,
        "title": "피자선택",
        "description": null,
        "endpoint": "jyjang@opence.org",
        "roleName": "고객",
        "refRoleName": "null",
        "resName": "jyjang@opence.org",
        "defId": "codi/test2.json",
        "defName": "codi/test2.json",
        "trcTag": "Task_1",
        "tool": "defaultHandler",
        "parameter": null,
        "priority": 1,
        "startDate": 1503415481615,
        "endDate": null,
        "saveDate": null,
        "dueDate": 1503847481617,
        "status": "NEW",
        "dispatchOption": 0,
        "dispatchParam1": null,
        "prevUserName": null,
        "rootInstId": 1,
        "readDate": null,
        "actType": null,
        "absTrcTag": null,
        "delegated": null,
        "urget": null,
        "execScope": null,
        "ext1": null,
        "ext2": null,
        "ext3": null,
        "ext4": null,
        "ext5": null
    },
    "activity": {
        "metaworksContext": null,
        "viewId": null,
        "breakpoint": false,
        "name": "피자선택",
        "description": null,
        "tracingTag": "Task_1",
        "cost": 0,
        "extendedAttributes": null,
        "retryLimit": 0,
        "retryDelay": 60,
        "integrity": 0,
        "activityIcon": null,
        "statusCode": null,
        "checked": false,
        "elementView": {
            "id": "Task_1",
            "parent": null,
            "shapeId": "OG.shape.bpmn.A_HumanTask",
            "x": 366,
            "y": 248,
            "width": 100,
            "height": 80,
            "fromEdge": null,
            "toEdge": null,
            "label": "피자선택",
            "style": null,
            "index": 0,
            "metaworksContext": null,
            "instStatus": null,
            "backgroundColor": null,
            "viewType": null,
            "propertyDialogHeight": 700,
            "propertyDialogWidth": 800,
            "elementViewActionDelegate": null,
            "changed": false,
            "byDrop": false
        },
        "document": null,
        "message": "onHumanActivityResultTask_1",
        "messageDefinition": null,
        "parameters": null,
        "fromRole": null,
        "mapper": null,
        "mapperIn": null,
        "mappingContexts": null,
        "mappingContextsIn": null,
        "role": {
            "metaworksContext": null,
            "name": "고객",
            "roleResolutionContext": null,
            "dispatchingOption": 0,
            "serviceType": null,
            "askWhenInit": true,
            "identifier": null,
            "defaultEndpoint": null,
            "displayName": {
                "text": null,
                "localedTexts": null
            },
            "dontPersistResolutionResult": false,
            "currentEditorId": null,
            "elementView": {
                "id": "Process_1",
                "parent": "null",
                "shapeId": "OG.shape.HorizontalLaneShape",
                "x": 753,
                "y": 317,
                "width": 1268,
                "height": 258,
                "fromEdge": null,
                "toEdge": null,
                "label": "고객",
                "style": null,
                "index": 0,
                "metaworksContext": null,
                "instStatus": null,
                "backgroundColor": null,
                "viewType": null,
                "propertyDialogHeight": 0,
                "propertyDialogWidth": 0,
                "elementViewActionDelegate": null,
                "changed": false,
                "byDrop": false
            },
            "description": null,
            "humanWorker": false
        },
        "referenceRole": null,
        "tool": "defaultHandler",
        "id": null,
        "duration": 5,
        "co2Emission": 0,
        "workload": 0,
        "priority": 0,
        "input": null,
        "extValue1": null,
        "extValue2": null,
        "extValue3": null,
        "extValue4": null,
        "extValue5": null,
        "extValue6": null,
        "extValue7": null,
        "extValue8": null,
        "extValue9": null,
        "extValue10": null,
        "instruction": {
            "text": null,
            "localedTexts": {}
        },
        "keyword": {
            "text": null,
            "localedTexts": {}
        },
        "notificationWorkitem": false,
        "parameterMap": null,
        "sendEmailWorkitem": true,
        "allowAnonymous": true,
        "hidden": false,
        "previousActivities": [
            {
                "metaworksContext": null,
                "viewId": null,
                "breakpoint": false,
                "name": "피자먹고싶어",
                "description": null,
                "tracingTag": "StartEvent_1",
                "cost": 0,
                "extendedAttributes": null,
                "retryLimit": 0,
                "retryDelay": 60,
                "integrity": 0,
                "activityIcon": null,
                "statusCode": null,
                "checked": false,
                "elementView": {
                    "id": "StartEvent_1",
                    "parent": null,
                    "shapeId": "OG.shape.bpmn.E_Start",
                    "x": 233,
                    "y": 248,
                    "width": 30,
                    "height": 30,
                    "fromEdge": null,
                    "toEdge": null,
                    "label": "피자먹고싶어",
                    "style": null,
                    "index": 0,
                    "metaworksContext": null,
                    "instStatus": null,
                    "backgroundColor": null,
                    "viewType": null,
                    "propertyDialogHeight": 0,
                    "propertyDialogWidth": 0,
                    "elementViewActionDelegate": null,
                    "changed": false,
                    "byDrop": false
                },
                "document": null,
                "attachedToRef": null,
                "eventType": null,
                "intermediate": false,
                "startTriggerCode": null,
                "message": "event",
                "hidden": false,
                "previousActivities": null,
                "dynamicChangeAllowed": true,
                "queuingEnabled": false,
                "faultTolerant": false
            }
        ],
        "dynamicChangeAllowed": true,
        "queuingEnabled": false,
        "faultTolerant": false
    },
}

if you changes the worklist.status to following values and POST it, it will be:

  1. 'COMPLETED': workitem will be completed,
  2. 'DRAFT': workitem will be saved with the changes.
  3. 'CANCELLED': workitem will be skipped.

the state mapping are found at : DefaultWorkList.java:

public class DefaultWorkList implements WorkList{

    public final static String WORKITEM_STATUS_DRAFT    = "DRAFT";
    public final static String WORKITEM_STATUS_NEW      = "NEW";
    public final static String WORKITEM_STATUS_CONFIRMED= "CONFIRMED";
    public final static String WORKITEM_STATUS_RESERVED = "RESERVED";
    public final static String WORKITEM_STATUS_REFERENCE= "REFERENCE";
    public final static String WORKITEM_STATUS_COMPLETED= "COMPLETED";
    public final static String WORKITEM_STATUS_CANCELLED= "CANCELLED";
    public final static String WORKITEM_STATUS_SUSPENDED= "SUSPENDED";
    //When user delegate a workitem, the workitem's status whould be changed to this status and another workitem.   
    public final static String WORKITEM_STATUS_DELEGATED= "DELEGATED";