Skip to content

普通员工和管理者之间的差别

我一直在思考普通员工和管理者之间到底有啥差别,下面按照我个人的愚见整理,欢迎指点,不吝赐教!

1. 经验:比较明显的差别是管理者的人在做决策的时候更有经验。管理者的人一般都经过实际项目历练才站到这个位置,经历过各种痛苦失败,知道什么路可通,什么路不通。他们会依靠这些经验做出让事情趋于成功的决定。
2. 管理技巧:工作安排、任务追踪、结果汇报等这些管理技巧我倒是觉得可以快速掌握的东西,一个规范的公司一般对公司内部的管理机制有一套完整说明,经过正常培训后,一般都能掌握。
3. 目标管理:管理者了解项目整体状况,有明确的目标意识,完成一个目标都有哪些任务,每个任务都需在什么时间点达成。项目过程中会遇到各种各样的困难,会阻扰项目正常进度,管理者需审时度势,灵活调整任务,增加强度,完成目标。
4. 人力资源管理:管理者需了解人力资源状况,并能将所有任务进行合理分工。能合理判断人力不足或人力过多的情况,并提出人力资源调整的要求。
5. 坚持原则:管理者需要起到带头示范作用,属下的员工都看着你的一言一行,如果管理者都不遵守规定,员工自然就有了懈怠推脱的理由。
6. 管理者意识:也就是能够时刻意识到自己是管理者,我认为这是最为重要的一点。管理者和普通员工思考的维度完全不在同一个层次上,普通员工只需思考的是如何完成手头上的任务。从一个普通员工转型为管理者,这个过程最为关键的不是能力的转型,而是意识的转型。意识转型了,能力不够,可以学习。能力够了,意识未转型,做出的安排常常是不合规不合理的,还可能导致团队的结果出力不讨好大伤士气情况。

对于普通员工来说,要成为合格的管理者,这其间的距离真不小。人一旦习惯了一种思维方式,很难做改变。要成为管理者除了各种各样的管理技巧能力的学习,还需转变思维方式,转变意识,这往往才是最难的!

面对困难的态度

安逸幸福的生活是大多数人所期望的,但现实生活却并非这样,充满着各种各样的困难和矛盾。

对待困难的不同的态度决定了不同的人生。有的人惧怕面对困难,采用躲避的方式应对,那么注定是失败的人生,因为人生注定有躲不开的困难。有的人厌恶困难,遇到困难被困难逼着一步步往前走,那么注定是平凡的人生,因为他们把困难看成绊脚石,看成包袱,举步维艰。有的人主动迎接困难,把客服困难当成一种理所应当家常便饭的事,不会为有遇到困难而苦恼,困难不是他们的压力而是动力,那么他们的人生是成功的,因为他们攀登上一个个困难山峰之后会看到人生最美的风景。

有人说,创业者之创业,就是克服一个个接踵而来的困难的过程! 可看出创业者至少成功的创业者之于常人不一样态度和勇气。

以前遇到麻烦事总是感觉压力山大,心情恶化,被动行事。认识到这一点,突然觉得心情舒坦了很多。我不是创业者不是什么成功人士,但要迈出这一步,或者说为了一个成功的人生,对待困难的态度就该变得从容积极一些,接受接纳克服它。因遇到困难而更具动力,笑对人生!

Call C API through Java Native Interfaces

Java could call C API through Java Native Interfaces, we could implement that in following steps:
There should be a diagram to illustrate this process:

JAVA program –> JNI class –> .so/.dll (implement c API generated from JNI class) –> C APIs we want to call

==========================================

1. Build a Java class, declaring the native interfaces. These native interfaces are called by other classes who want to call the C APIs.

a example of JNI class:
——————————
package coresystem;
class Adapter {
native String call(String in);
static {
System.loadLibrary(“coresystem”);
}
}
——————————
Note:
a. We must declare all the APIs which we want to call them in java into native methods;
b. Native methods are loaded with the System.loadLibrary method. The argument to System.loadLibrary is a library name chosen arbitrarily by the programmer. The system follows a standard, but platform-specific, approach to convert the library name to a native library name. For example, a Solaris system converts the name coresystem to libcoresystem.so, while a Win32 system converts the same coresystem name to coresystem.dll.

2. Compiling:

creating class file:
# javac coresystem/Adapter.java
creating head file for native library:
# javah coresystem.Adapter
You could see a file named coresystem_Adapter.h was generated.

3. implement the C APIs descripted in coresystem_Adapter.h and create a .so file.
In this .so file, there should be the logic to call the C APIs that Java want to call.

# export JAVA_HOME=/usr/java/jdk1.7.0_45
# export PATH=$JAVA_HOME/bin:$PATH
# export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server/:$LD_LIBRARY_PATH
# export C_INCLUDE_PATH=$JAVA_HOME/include:$JAVA_HOME/include/linux
# gcc -g coresystem.c -o libcoresystem.so -shared

4. set environment for the new generated .so:

# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/jc

5. Run Java program, it works!
———————————-
package coresystem;
class Test {
public static final void main(String[] args){
Adapter adapter = new Adapter();
String response = adapter.call(args[0]);
System.out.println(response);
}
}
———————————-
javac coresystem/Test.java
java coresystem.Test hello

A Shell Script for managing Tibco iProcess Cluster

#!/bin/sh
# gelnyang@163.com , 2015/6/8

. /etc/profile

export ORACLE_SID=ORCL
export ORACLE_BASE=/oracle
export GRID_HOME=/grid/grid_home
export ORACLE_HOME=$ORACLE_BASE/db11g
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib:$LD_LIBRARY_PATH
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export ORACLE_OWNER=oracle
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export LANG=en_US.UTF-8

export SWDIR=/opt/bpm/swnod1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SWDIR/libs
export PATH=$PATH:/usr/sso/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/sso/lib64
export SW_SYSCLASSPATH=$SWDIR/eaijava/libs/bootstrap/log4j-1.2.13.jar:$SWDIR/eaijava/libs/bootstrap/bootstrap.jar

datenow=$(date '+%Y%m%d')
USER=pro
sw_log_path=/tmp/iprocess/swbpm_$datenow.log
NODE1=IPESERVER1
NODE2=IPESERVER2
IPEPORT=1145
THREADPORTPREFIX=5578
TIMEWAIT=10

# check current node
CURR_NODE=$(hostname)
CURR_NODE=$(echo $CURR_NODE | tr '[a-z]' '[A-Z]')  
if [ "$CURR_NODE" == $NODE1 ]; then
    CURR_NODE=$NODE1
    REMOTE_NODE=$NODE2
else
    CURR_NODE=$NODE2
    REMOTE_NODE=$NODE1
fi

# create log directory
mkdir -p /tmp/iprocess/

function wait_ipe_thread_port_shutdown()
{
    portlength=$(netstat -anot |grep $THREADPORTPREFIX | tail -1 | wc -L)
    while (($portlength > 0 ))
    do
       echo "there are ports with prefix "$THREADPORTPREFIX", wait ..." >> $sw_log_path
       sleep 1
       portlength=$(netstat -anot |grep $THREADPORTPREFIX | tail -1 | wc -L)
    done
}

function start_ipe()
{
    echo "start iprocess on "$CURR_NODE >> $sw_log_path
    procmgrflag=$(/bin/ps -ef | grep $SWDIR"/etc/procmgr" | grep -v grep )
    if [ "$procmgrflag" != "" ]; then
        /bin/su $USER -c $SWDIR"/bin/swstart" >> $sw_log_path
    else
        wait_ipe_thread_port_shutdown
        /bin/su $USER -c $SWDIR"/bin/swstart -p" >> $sw_log_path
    fi
}

function shutdown_ipe()
{
    echo "shutdown iprocess on "$CURR_NODE >> $sw_log_path
    procmgrflag=$(/bin/ps -ef | grep $SWDIR"/etc/procmgr" | grep -v grep )
    if [ "$procmgrflag" != "" ]; then
        /bin/su $USER -c $SWDIR"/bin/swstop -f 10"
    fi
    processflag=$(ps aux | grep $SWDIR | grep -v grep |tail -1)
    if [ "$processflag" != "" ]; then
        ps aux | grep $SWDIR | grep -v grep | cut -c 9-15 | xargs kill -s 9 >> $sw_log_path
    fi
    if [ "$procmgrflag" != "" ]; then
        /bin/su $USER -c $SWDIR"/bin/swstop -p"
    fi
}

function set_master_slave()
{
    echo "set master to "$1",set slave to "$2 >> $sw_log_path
    /bin/su $USER -c $SWDIR"/util/swadm move_server 1 dummy" >> $sw_log_path
    /bin/su $USER -c $SWDIR"/util/swadm move_server 2 "$2 >> $sw_log_path
    /bin/su $USER -c $SWDIR"/util/swadm move_server 1 "$1 >> $sw_log_path
}

function is_current_master()
{
    echo "check whether current node is the master node" >> $sw_log_path
    master_flag=$(/bin/su $USER -c $SWDIR"/util/swadm find_master |tail -1 |grep "$CURR_NODE)
    if [ "$master_flag" != "" ]; then
        echo "current $CURR_NODE is master node" >> $sw_log_path
        echo "Y"
    else
        echo "current $CURR_NODE is slave node" >> $sw_log_path
        echo "N"
    fi
}

function get_remote_status()
{
    echo $(nc $REMOTE_NODE $IPEPORT < /dev/null; echo $?)
}


# add log header
echo "----------------------------" >> $sw_log_path
echo  $(date '+%Y%m%d%H%M%S')  >> $sw_log_path
echo "$0" "$1" >> $sw_log_path
echo "----------------------------" >> $sw_log_path

case "$1" in
    start)
        echo "Starting iProcess Engine Server" >> $sw_log_path
       
        portflag=$(netstat -anot | grep $IPEPORT | grep -v grep |tail -1)
        echo $portflag  >> $sw_log_path
        if [ "$portflag" == "" ]; then
            echo "no port "$IPEPORT" running on current node, calling shutdown first ...!" >> $sw_log_path
            shutdown_ipe
        fi
       
        master_flag=$(is_current_master)
        if [ "$master_flag" == "Y" ]; then
            echo "current is master, move server" >> $sw_log_path
            set_master_slave $CURR_NODE $REMOTE_NODE
        else
            echo "current is slave node" >> $sw_log_path
            remotealive=$(get_remote_status)
            if [ "$remotealive" != "0" ]; then
                echo "master can't connect, wait to check again later .." >> $sw_log_path
                sleep $TIMEWAIT
                remotealive=$(get_remote_status)
                if [ "$remotealive" != "0" ]; then
                    echo "master is dead, make current node as master " >> $sw_log_path
                    set_master_slave $CURR_NODE $REMOTE_NODE
                fi
            fi
        fi
       
        start_ipe
        ;;
    stop)
        echo "Shutting down iProcess Engine Server" >> $sw_log_path
        master_flag=$(is_current_master)
        if [ "$master_flag" == "Y" ]; then
            echo "current is master, switch it to slave" >> $sw_log_path
            shutdown_ipe
            set_master_slave $REMOTE_NODE $CURR_NODE
       
            remotealive=$(get_remote_status)
            if [ "$remotealive" != "0" ]; then
                echo "master can't connect, wait to check again later .." >> $sw_log_path
                sleep $TIMEWAIT
                remotealive=$(get_remote_status)
                if [ "$remotealive" != "0" ]; then
                    echo $REMOTE_NODE" is master,but not started,can't start slave on "$CURR_NODE >> $sw_log_path
                else
                    echo $REMOTE_NODE" is master,and already started,start slave on "$CURR_NODE >> $sw_log_path
                    start_ipe
                fi
            fi
        else
            remotealive=$(get_remote_status)
            if [ "$remotealive" != "0" ]; then
                echo "master node is dead on "$REMOTE_NODE >> $sw_log_path
                shutdown_ipe
               
            else
                echo "master node is live, do nothing for slave stopping" >> $sw_log_path
            fi
        fi
       
        ;;
    status)
        echo "Checking status for iProcess Engine Server: " >> $sw_log_path
        procmgrflag=$(/bin/ps -ef | grep $SWDIR"/etc/procmgr" | grep -v grep )
        if [ "$procmgrflag" == "" ]; then
            echo "no process sentinel thread ..." >> $sw_log_path
            exit 1
        fi
       
        #return OK only for master node
        portflag=$(netstat -anot | grep $IPEPORT | grep -v grep |tail -1)
        echo $portflag  >> $sw_log_path
        if [ "$portflag" == "" ]; then
            exit 1
        else
            exit 0
        fi
        ;;
    *)
        echo "Usage: $0 {start|stop|status}" >> $sw_log_path
        exit 1
        ;;
esac

Required Ports for Tibco iProcess Engine

111(RPC for Worckspace)
1145(TCP for Director Service)
8080(WEB for Workspace Browser)
10000-10025(PORT RANGE for Workspace)
28021-28031(PORT RANGE FOR SPO service)

Required Oracle Privilege for Tibco iProcess installation user

Tibco iProcess安装db帐号创建有两种方式,一种是给管理员帐号,安装的时候自动创建;另一种是提前创建好,安装的时候选择已经创建好的db帐号。 生产环境db帐号管控严格,需要提前创建帐号,需要知道帐号都需要什么权限。测试环境安装是通过第一种方式自动创建的,通过以下两个语法可以查看帐号都需要那些权限。

select * from session_privs;
——————————-
CREATE SESSION
UNLIMITED TABLESPACE
CREATE TABLE
CREATE CLUSTER
CREATE VIEW
CREATE SEQUENCE
CREATE PROCEDURE
CREATE TRIGGER
CREATE TYPE
CREATE OPERATOR
CREATE INDEXTYPE
QUERY REWRITE
MANAGE ANY QUEUE
ENQUEUE ANY QUEUE
DEQUEUE ANY QUEUE
CREATE EVALUATION CONTEXT
CREATE RULE SET
CREATE RULE

select * from user_role_privs;
——————————————–
USERNAME GRANTED_ROLE ADMIN_OPTION DEFAULT_ROLE OS_GRANTED
1 SWPRO AQ_ADMINISTRATOR_ROLE NO YES NO
2 SWPRO CONNECT NO YES NO
3 SWPRO RESOURCE NO YES NO

但安装的时候报执行初始化SQL语法错误,经查是对其中一个package body SSOLITE_MSG进行编译的时候报错,这个package body有引用DBMS_AQ,但报错DBMS_AQ没有定义,原因是没有DBMS_AQ执行权限,按照如下赋予权限重新安装即可:
GRANT EXECUTE ON DBMS_AQ TO swpro;
GRANT EXECUTE ON DBMS_AQ TO swuser;

Tibco iProcess Activity Monitoring and Work Queue Delta Publication

The TIBCO iProcess Engine can be enabled to publish both iProcess Engine activity information and iProcess Engine Work Queue Deltas to external applications, using JMS queues.

An activity is any instruction in the iProcess Engine that creates an audit trail entry, for example, Case started or Event Issued. You can configure any combination of step and/or activity to be monitored. This enables an external application to monitor important business events during the processing of cases.

A BG process can identify if a step is being processed and if activity monitoring has been configured for it. The BG process then sends details of the configured activities in XML format to the IAPJMS process.

Work Queue Delta publication enables an external application (iProcess Server Objects (Java) or iProcess Server Objects (.NET)) to monitor a queue and to retrieve only those work items in a given work queue that have changed since the subscription started. The WIS process sends messages reporting Work Queue changes to the IAPJMS process.

For both activity monitoring and Work Queue Delta publication, the IAPJMS process sends the XML message to a specified JMS topic, from which an external application (for example, iProcess Objects, iProcess Analytics or an external application that you have written yourself) can receive the JMS messages.

首次部署
1.将文件PSBC_IPE_MONITOR.xml放置到/opt/bpm/swnod1/util
2.创建pro用户
3.执行脚本
su – pro
cd /opt/bpm/swnod1/util
./swadm set_attribute 0 ALL 0 IAPJMS_PUBLISH 1
./swadm set_attribute 0 ALL 0 IAPJMS_SYNCHRONOUS 0
./swadm set_attribute 0 ALL 0 IAPJMS_ROLLBACK 0

4.修改文件$SWDIR/etc/staffcfg
STAFF/IAPSCHEMA==>1

5.注册监听步骤
cd /opt/bpm/swnod1/bin
./swutil IMPMONITOR PSBC_IPE_MONITOR.xml

6.在EMS创建TOPIC
cd /opt/tibco/ems/8.0/bin
./tibemsadmin
create topic IAPTOPIC

后续部署-需监听其他流程
1.修改PSBC_IPE_MONITOR.xml文件并将该文件放置到/opt/bpm/swnod1/util
2.注册监听步骤
su – pro
cd /opt/bpm/swnod1/bin
./swutil IMPMONITOR PSBC_IPE_MONITOR.xml

TIBCO iProcess Objects Director Configuration

The TIBCO iProcess Objects Director is a standalone program that maintains a list of TIBCO iProcess Objects Servers that are configured in a node cluster. When a client needs access to a TIBCO iProcess Objects Server, it first establishes a connection to the TIBCO iProcess Objects Director. The TIBCO iProcess Objects Director then decides, based on a “pick method,” which TIBCO iProcess Objects Server the client should connect to.

1.设置DIRECTOR属性
/opt/swnod1/util/swadm SET_ATTRIBUTE 1 DIRECTOR 0 BASE_TCP_SERVICE_NAME 28021
/opt/swnod1/util/swadm SET_ATTRIBUTE 1 DIRECTOR 0 TCP_SERVICE_NAME 1145
#bpmipe 为 iprocess server 域名
/opt/swnod1/util/swadm SET_ATTRIBUTE 1 DIRECTOR 0 IDENTIFY_SPO_MACHINE_BY bpmipe

2.修改配置
/opt/bpm/swnod1/seo/data/swentobjsv.cfg
TCPServiceName = 28021

3.重启IPE
su – pro
cd /opt/swnod1/bin
./swstop -p
netstat -anot |grep 5578
./swstart -p

注意:若$SWDIR/logs/spodirector01.log文件如果有以下错误,需执行4步骤
17098|EFB7FB90|03/02/2015 10:48:53.893|00000002|ERROR|check_for_spo_server(), failed to find SPO_SERVER

4.重启DIRECTOR进程
$SWDIR\util\swsvrmgr SHUTDOWN MachineID DIRECTOR ProcessInst
$SWDIR\util\swsvrmgr START MachineID DIRECTOR ProcessInst

Tibco iProcess Case Data Queue Parameter (CDQP)

Tibco iProcess Case Data Queue Parameter (CDQP) fields provide an efficient method of filtering on the value of fields in your work items. To make use of this functionality, you must first pre-designate the fields you want to filter on as CDQP fields. Fields are designated as CDQP fields with the utility, swutil. This utility is used to create a list, on the TIBCO iProcess Engine, of the case data fields that are available to use for filtering. See the TIBCO iProcess Engine Administrator’s Guide for information about using swutil.
=======================================================================================
To enter CDQP commands, use the following command:
./swutil QINFO

To add a field as a CDQP, or to change the definition of an existing CDQP, use the command:
F+FieldName,FieldSize,WQMDescription[,P]
where:
>> FieldName is the name of the iProcess field to be defined as a CDQP. FieldName must be less than or equal to 15 characters.
If the field is a composite field of the form TagName:FieldName, TagName must be less than 15 characters and FieldName must be less than 15 characters.
>> FieldSize is the size, in characters, of the CDQP. FieldSize must be less than or equal to 255.
>> WQMDescription is the name that will be used to represent this field in Work Queue Manager dialogs.
WQMDescription must be unique, and must be less than or equal to 39 characters.

=======================================================================================
To validate a set of new or updated CDQP configuration data before importing it, use the following command:
./swutil QINFO C:\TEMP\MYPROC.XFR PARSEONLY

=======================================================================================
To import a set of new or updated CDQP configuration data to the server, use the following command:
./swutil QINFO C:\TEMP\MYPROC.XFR

=======================================================================================
To import a set of new or updated CDQP configuration data to the server and publish it immediately, use the following command:
./swutil QINFO C:\TEMP\MYPROC.XFR PUBLISH

————————————–
[pro@IPESERVER bin]$ ./swutil QINFO /opt/swnod1/bin/cdqp.xfr PUBLISH
QINFO import: Started by ‘swadmin’ at 30/12/2014 15:42

QINFO import: Processing control file

lines processed successfully = 9
Control File Warnings: = 0
QINFO import: Completed at 30/12/2014 15:42

./swutil QINFO /opt/swnod1/bin/cdqp1.xfr PUBLISH
=======================================================================================
You can export CDQP definitions and mappings – either for the entire system, or for specific queues – using the following command:
./swutil QINFO EXPORT [queuename [GLOBAL]]
./swutil QINFO EXPORT

————————————–
[pro@IPESERVER bin]$ ./swutil QINFO EXPORT
R

;Global CDQPs
F+RELEASETYPE,1,releaseType
F+TELUSERTYPE,1,telUserType

;Default Group CDQPs
Q+SW_DEFAULT_CASEDATAQPARAM_GROUP
; d1
C+TELUSERTYPE
; d2
C+RELEASETYPE

;Default User CDQPs
Q+SW_DEFAULT_CASEDATAQPARAM_USER
; d1
C+TELUSERTYPE
; d2
C+RELEASETYPE

Windows regedit config file for Tibco iProcess RPC Server and SSO Client

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Staffware plc\Staffware Client\Default\RPC Servers]
"Server1"="IPEHOST,391875,1,IPE SERVER"

[HKEY_LOCAL_MACHINE\SOFTWARE\Staffware plc\Staffware SSO Client]
"TISOMultiChar"=hex(b):01,00,00,00,00,00,00,00
"TISOUnicodeConverterName"="UTF-8"
創用 CC 授權條款
Geln's BlogGeln Yang製作,以創用CC 姓名標示-相同方式分享 3.0 Unported 授權條款釋出。
此作品衍生自sisopipo.com